[CMake] EXCLUDE_FROM_ALL not working?

Robert Dailey rcdailey.lists at gmail.com
Fri Feb 8 17:14:53 EST 2013


The library itself depends on other ones I generated, but it isn't a
dependency itself.

I did some more research and setting EXCLUDE_FROM_DEFAULT_BUILD
worked... I find it strange that there are 2 properties that
essentially should do the same thing, but cause different behavior
depending on the selected generator:


function( _exclude_target target_name )
    set_target_properties(
        ${target_name} PROPERTIES
        EXCLUDE_FROM_DEFAULT_BUILD TRUE
        EXCLUDE_FROM_ALL TRUE
    )
endfunction()

On Fri, Feb 8, 2013 at 4:01 PM, David Cole <dlrdave at aol.com> wrote:
> Does another library that you add later depend on that one? Or an
> executable?
>
> If so, then the library will be added because it's required by dependencies,
> despite your request to exclude it from all.
>
>
>
> -----Original Message-----
> From: Robert Dailey <rcdailey.lists at gmail.com>
> To: CMake <cmake at cmake.org>
> Sent: Fri, Feb 8, 2013 4:59 pm
> Subject: [CMake] EXCLUDE_FROM_ALL not working?
>
> I am calling add_library like so:
>
> set( project_name mylib )
> set( files main.cpp main.h )
> set( exclude_flag EXCLUDE_FROM_ALL )
> add_library( "${project_name}" SHARED ${exclude_flag} ${files} )
>
> When I generate for Visual Studio 2008, I check the build
> configuration and the mylib project is still setup to build when I
> invoke Build Solution. Why isn't this flag working?
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list