[CMake] Selective build and install of subfolders

Amine Chadly amine.chadly at gmail.com
Mon Jan 7 06:21:52 EST 2013


 <screamingfist at ...> writes:

> 
> Hello list,
> 
> I have a project with subfolders that should be selectively 
> built and installed.
> The problem is that there are various dependencies between them.
> 

[snip]

Hi Stefan,

I think you should look into options, and the CMake dependent option macro.
http://www.cmake.org/cmake/help/v2.8.4/cmake.html#command:option
http://www.cmake.org/cmake/help/v2.8.4/cmake.html#module:CMakeDependentOption


The idea is to guard add_subdirectory commands with if commands.
The if commands would be checking the value of the options.
It's not really pretty, but it may be enough for you to do the job.

Hope that it helps.
--
  Amine



More information about the CMake mailing list