[CMake] Re: ADD_SUBDIRECTORY and EXCLUDE_FROM_ALL

DA atdbds at yahoo.com
Sun Jan 27 19:51:46 EST 2008


Hi,

I figured this out on my own. Apparently if the CMakeLists.txt file in the 
mentioned sub-directoy contains a INSTALL rule, the EXCLUDE_FROM_ALL 
parameter does not apply. If I add the "OPTIONAL" directive to the INSTALL 
target, then all works as advertised.

The question I now have is that should it matter if the CMakeLists.txt of the 
subdirectory I include contains an INSTALL target ? Somehow to me it does not 
make sense. When I added EXCLUDE_FROM_ALL, I expected that directory to be 
excluded regardless of the target I built: "make all" or "make install". 
Otherwise, it would be nice if the documentation for ADD_SUBDIRECTORY stated 
this little fact...

Thanks.

On Sunday 27 January 2008 13:51:30 you wrote:
> Hello,
>
> The documentation for ADD_SUBDIRECTORY suggests states the following:
>
> If the EXCLUDE_FROM_ALL argument is provided then this subdirectory will
> not be included in build by default. Users will have to explicitly start a
> build in the generated output directory. This is useful for having cmake
> create a build system for a set of examples in a project. One would want
> cmake to generate a single build system for all the examples, but one may
> not want the targets to show up in the main build system.
>
> And I have a add_subdirectory entry that includes the EXCLUDE_FROM_ALL
> directive:
>
> ADD_DIRECTORY (designer EXCLUDE_FROM_ALL)
>
> but the directive is ignored and the sub-directory always get built by
> default. I am using cmake 2.4.7.  Does anyone else experience this problem
> ? Is this a known issue already addressed in a recent fix ?
>
> Thanks,
> DA




More information about the CMake mailing list