[cmake-developers] Ninja and add_subdirectory EXCLUDE_FROM_ALL

Charles Huet charles.huet at gmail.com
Fri Mar 11 10:48:59 EST 2016


Here is a prototype that adds a target for each folder the has the
EXCLUDE_FROM_ALL property set.

Please review it and I'll get it in acceptable shape.

I used the folder name as target for now, this is not final but it was easy
for prototyping.
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).

I used C++11, but I don't know if this is OK in CMake, I'll refactor if not.

Best

Le jeu. 10 mars 2016 à 15:28, Brad King <brad.king at kitware.com> a écrit :

> On 03/10/2016 02:58 AM, Charles Huet wrote:
> > Maybe even adding such a target for each 'project', which regroups all
> the
> > targets of a project would make sense, as these are grouped as 'projects'
> [snip]
> > To avoid name collisions these could be suffixed with something like
> '_dir',
> > '_project' or such.
> >
> > Do you think this would be a good enough solution ?
>
> I think such targets makes sense and does not disallow full subproject
> generation in the future.  To avoid name collisions we should use a
> prefix or suffix with a "/" in its name since that is not allowed by
> CMake for the actual target names.
>
> Thanks,
> -Brad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160311/176b6c85/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: 3217 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160311/176b6c85/attachment.bin>


More information about the cmake-developers mailing list