[cmake-developers] Ninja and add_subdirectory EXCLUDE_FROM_ALL

Charles Huet charles.huet at gmail.com
Mon Mar 14 05:04:37 EDT 2016


Hi,

I modified my patch a bit to use C++98 only, and try to stick to the coding
conventions.

This now adds a target per folder, which contains all the targets in the
folder and all its children folders.

These targets are prefixed with "path/" in order to set them apart of
normal CMake targets.

Please tell me if more modifications are required.
Best.

Le ven. 11 mars 2016 à 16:58, Brad King <brad.king at kitware.com> a écrit :

> On 03/11/2016 10:48 AM, Charles Huet wrote:
> > Here is a prototype that adds a target for each folder the
> > has the EXCLUDE_FROM_ALL property set.
>
> Is there any reason to limit this to EXCLUDE_FROM_ALL?  Why not
> have a target for every directory with a CMakeLists.txt file?
>
> > I am not satisfied with the way I exclude some build targets,
> > but I could not find the correct way to do it (Install target and such).
>
> See cmGlobalUnixMakefileGenerator3::WriteDirectoryRule2 and
> its call sites for how the Makefile generator decides which
> targets are part of "all" for each directory.  These targets
> in build.ninja should be equivalent to "cd dir; make" in the
> Makefile generator.
>
> > I used C++11, but I don't know if this is OK in CMake, I'll refactor if
> not.
>
> Please use C++98.
>
> Thanks!
> -Brad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160314/e5f48275/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-a-target-for-each-EXCLUDED_FROM_ALL-folder-tha.patch
Type: text/x-patch
Size: 3223 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160314/e5f48275/attachment.bin>


More information about the cmake-developers mailing list