[CMake] kdevelop3 generator broke

Brad King brad.king at kitware.com
Fri Mar 11 08:54:40 EST 2005


>>3) After editing one of my included cmake-files cmake again scanned 
>>dependancies for all objects files and built them *all* again, although I 
>>changed only my custom rule to link them all together in the end. 
>>
> 
> This may be a bug.  The idea is that if a flag changes all the objects should
> be rebuilt.  However, this may be too aggressive, and there was a variable added
> to turn this off, perhaps that should be the default.   

This was a bug that I fixed on Tuesday.  When CMake regenerated the 
makefiles there was a bug that caused it to decide to remove the 
existing dependency files.  If you update CMake the problem should go away.

>>4) cmake now generates a subdir where it puts stuff and the Makefile is 
>>split into many small files. Which are the advantages of this approach ? 
>>The many included files in the Makefile don't make it easier to read. 
> 
> This allows for targets to have the same source file compiled with different flags.

It also properly rebuilds source files when the compile flags change, 
such as when the user adds a -D option to their CMAKE_CXX_FLAGS cache 
setting.  This is accomplished simply by having the build rules in each 
.o.make file depend on their own makefile fragment.  This behavior can 
be removed by adding

SET(CMAKE_SKIP_RULE_DEPENDENCY 1)

to your project.  It can also be made a user-level option by using

OPTION(CMAKE_SKIP_RULE_DEPENDENCY
        "Whether to skip making build rules depend on themselves." ON)

-Brad


More information about the CMake mailing list