[cmake-developers] Ninja and add_subdirectory EXCLUDE_FROM_ALL

Brad King brad.king at kitware.com
Wed Feb 10 13:47:10 EST 2016


On 02/10/2016 10:57 AM, Charles Huet wrote:
> When using Unix Makefiles (or MSVC) this causes the subfolder to contain
> a new Makefile, allowing me to build easily the whole subdir.
> 
> I cannot find such a facility with Ninja

The Makefile generator naturally lays makefiles out with launch points
in each directory.  The Xcode generator and Visual Studio generators
generate projects that can be loaded in the respective IDEs for each
source directory with a project() command in its CMakeLists.txt file:

 https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalXCodeGenerator.cxx;hb=v3.4.3#l407
 https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalVisualStudio7Generator.cxx;hb=v3.4.3#l383

They contain the relevant subsets of the build system needed for their
subdirectories.  Currently the Ninja generator does not have this
feature.  It may be possible to add but would take some investigation
into how intrusive the changes would be.

-Brad



More information about the cmake-developers mailing list