[CMake] subdirs and depenency handling

Brad King brad.king at kitware.com
Tue May 10 13:04:54 EDT 2005


Alexander Neundorf wrote:
> With ADD_SUBDIRECTORY my CMakeLists.txt now looks like this: 
>  
> ADD_SUBDIRECTORY(profileengine PREORDER) 
> ADD_SUBDIRECTORY(newui PREORDER) 
> SUBDIRS( profiles) 
>  
> Sorry, but IMHO this doesn't look like cmake, this looks like a hack.

This version of adding a subdirectory provides the behavior most users 
expect from SUBDIRS...in-order processing.  The idea of the syntax is to 
say "add a subdirectory to the build tree" just like one says "add a 
library" or "add an executable".  The optionally separate source 
directory allows sources from outside the tree to be included in the 
build.  Overall the command is significantly more powerful than the 
SUBDIRS command.  It is definately not a hack; it is the right way to do 
things.  The PREORDER option can probably be considered a hack, but it 
is necessary until a global makefile system is in place.

-Brad


More information about the CMake mailing list