[CMake] using cmake on windows - query on existing targets

Alexander Neundorf a.neundorf-work at gmx.net
Wed Jan 6 16:24:29 EST 2010


On Wednesday 06 January 2010, Chauhan, Vikas wrote:
> Hi,
>
> I am quite new to using cmake and at the moment I am trying to find my
> way through it.
> I was wondering how we can query different targets on windows when using
> cmake.
> For example: I may have a set of separate directories(each containing a
> project) and from the top level root directory, I want to selectively
> build a subset of projects.

in KDE we have the macro
macro_optional_add_subdirectory()
http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/MacroOptionalAddSubdirectory.cmake?revision=940658&view=markup

E.g. if you do 
macro_optional_add_subdirectory(project1)

the subdir project1/ will be added like with normal add_subdirectory(), but 
additionally you'll have a cmake option "BUILD_project1", which you can 
enable and disable, and when disabled, the directory will not be added.

> How can I do it on the command line ? Also, can I query the list of
> targets/projects from the command line?

E.g. with the approach above, you can use cmake-gui or ccmake to have a look 
at the available options.

Does that help ?

Alex


More information about the CMake mailing list