[CMake] Analyze file dependencies in Visual Studio for projectgeneratedbyCMake

Martin Apel martin.apel at simpack.de
Fri Apr 24 02:46:20 EDT 2009


Alexander Neundorf wrote:
> On Thursday 23 April 2009, Martin Apel wrote:
>   
>> Alexander Neundorf wrote:
>>     
>>> On Wednesday 22 April 2009, Martin Apel wrote:
>>>       
>>>> Hi all,
>>>>
>>>> I am currently fighting with Visual Studio regenerating a
>>>> CMake-generated project on every build, although nothing has changed. I
>>>> am searching for a method how to debug the generated dependencies inside
>>>> VS. The project builds a DLL from Fortran files, which are generated by
>>>> a Perl script. The setup looks something like this:
>>>>
>>>> ADD_CUSTOM_COMMAND(OUTPUT ${FortranSources}
>>>>                    COMMAND ${CMAKE_COMMAND} -E chdir
>>>> ${CMAKE_CURRENT_BINARY_DIR} ${PERL_EXECUTABLE}
>>>> {CMAKE_SOURCE_DIR}/scripts/createFortAccessors.pl
>>>>                    DEPENDS
>>>> ${CMAKE_SOURCE_DIR}/scripts/createFortAccessors.pl FortranModules.inp
>>>> FortranCommons.inp ${ModuleDefs} ${CommonDefs})
>>>> ADD_LIBRARY(FortranInterface SHARED ${FortranSources}
>>>> FortranInterface.def)
>>>>         
>>> What is ModuleDefs and CommonDefs ? Are this files ?
>>> How does FortranSources look like ? Does it contain absolute paths ?
>>> I think you need to give a bit more information so that we can help.
>>>       
>> Hi Alex,
>>
>> thanks for your reply. ModuleDefs, CommonDefs and FortranSources are all
>> lists of files given with their absolute paths. createFortAccessors
>> parses the files listed in FortranModules.inp and FortranCommons.inp
>> given as input and produces the files listed in FortranSources as
>> output. I tried replacing FortranModules.inp and FortranCommons.inp with
>> their absolute paths (${CMAKE_CURRENT_SOURCE_DIR}, but this doesn't
>> change anything. Do you have any idea, what might be going wrong here?
>>     
>
> No, not really.
> I would suggest:
> -make sure that the paths are really correct, i.e. use full paths everywhere.
> Maybe the files are generated but they end up in a different directory ?
>
> If that doesn't help, try to strip the problem down as much as possible so
> that you get a minimal version which works and can reproduce which step makes
> it fail.
> You can start ass simple as using something like
> echo "hello" > ${outputfile}
> as your command to execute.
>
>   
Hi Alex,

I tried using full paths everywhere, it doesn't change anything. I even
checked the generated dependencies inside Visual Studio (they are
visible as custom build rule). All dependencies are correct and are
listed with full paths. Remember, the same build runs flawlessly on
Linux and with NMake.
I was more searching for a way, how to trace, why Visual Studio
regenerates a target, something along the lines of "gmake -d". I'm not
sure, that it's CMake's fault, it might be, that CMake is triggering a
bug in Visual Studio.

Martin
____________
Virus checked by G DATA AntiVirus
Version: AVF 19.351 from 23.04.2009




More information about the CMake mailing list