[CMake] CMAKE 2.6.0: Wrong dependencies when CMake<LANG>Information.cmake is missing

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jun 9 18:06:00 EDT 2008


On Sunday 08 June 2008, Wojciech Migda wrote:
> Hi,
>
> I did have a problem with cmake regenerating the whole build tree
> everytime I executed make. As it turned out the rebuild was done due to
> the dependency check made in
> cmGlobalUnixMakefileGenerator3::WriteMainCMakefile. It came out that the
> CMAKE_MAKEFILE_DEPENDS list in Makefile.cmake contained the current
> directory (".") entry, which appeared to be always more recent than the
> newest output - CMakeFiles/cmake.check_cache. It was enough to remove
> the "." entry to get rid of the rebuild. Anyway I kept investigating.
>
> As it appeared the "." entry was present due to me using user-defined
> assembler compiler for the build. Commenting out the relevant
> ENABLE_LANGUAGE command in CMakeLists.txt led to proper behaviour. But
> why ? I looked at the cmGlobalGenerator::EnableLanguage function and
> after debugging I noticed that when a check for
> CMake<LANG>Information.cmake was made, a file which was missing - I did
> put all assembly compiler definitions into CMake<LANG>Compiler.cmake, a
> call to GetModulesFile returned an empty string. ReadListFile executed
> with that empty string did not fail, and that probably led to the "."
> directory being present in the CMAKE_MAKEFILE_DEPENDS list.

Another way to fix this would be to fail if CMake<LANG>Information.cmake is 
not found, so you would have noticed that something is going wrong. Maybe 
this would be a better approach, then the support for languages will be more 
consistent.
Bill ?

> I confirmed that by setting the CMAKE_<LANG>_INFORMATION_LOADED variable
> before execution of ENABLE_LANGUAGE - the dependencies were correct.
> Nonetheless I'd expect that a fix with additional check for ifpath being
> empty is introduced in
> cmGlobalGenerator.cxx/cmGlobalGenerator::EnableLanguage.
>
> I've prepared a patch against the 2.6.0 version. Unfortunately I could
> not find the patch format instructions for cmake, so I took those for
> linux kernel (diff -up).

Looks ok.

I had a look at your files.
What system are you building for ? 
Is it some rolled-your-own OS or some OS generally available ? If so, we could 
add support for it to cmake directly.

Why do you need CMAKE_FORCE_[C|CXX]_COMPILER() ?
Why do you need to set CMAKE_[C|CXX]_OUTPUT_EXTENSION_REPLACE to true ?
This looks like there is something not working which should work.

Bye
Alex


More information about the CMake mailing list