[CMake] Feature: optional targets that respect dependencies?

Christian Convey christian.convey at gmail.com
Mon Aug 13 15:26:44 EDT 2007


Is the following something that should be added to CMake?

My project has about 70 targets: about 20 libraries and 50 apps.

I'd like to make the building of any particular target be optional, as
expressed by the OPTION(...) command.  However, if I try to build an
app that depends on a library target the user has specified to NOT
build, there's an obvious problem at link time.

CMake knows about all the dependencies between build targets.  Should
we do something like the following, in a future version of CMake? :

ADD_EXECUTABLE(...
    ...
   [ OPTIONAL  { FORCE_DEPENDENCY_BUILDS |
WARN_IF_DEPENDENCIES_NOT_BUILT } [ option-variable-name
[option-default-value] ] ]
   ...
   )


More information about the CMake mailing list