Hi all.<br><br>I believe the reason is that EXCLUDE_FROM_ALL excludes the target from the default 'all' target (Makefiles), which is represented by the custom target ALL_BUILD in Visual Studio. EXCLUDE_FROM_DEFAULT_BUILD instead works with Visual Studio's "Build Solution" command, which has no direct equivalent in the Makefile world.<br>
<br>This means projects using VS solutions as "just a way to do command-line builds on Windows" probably use ALL_BUILD and are fine with setting just EXCLUDE_FROM_ALL. Projects which expect their developers to actively work in the VS IDE (and thus use "Build Solution" and the like) have to set both EXCLUDE_FROM_* properties.<br>
<br>Petr<br><br><div class="gmail_quote">On Fri, Feb 8, 2013 at 11:14 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The library itself depends on other ones I generated, but it isn't a<br>
dependency itself.<br>
<br>
I did some more research and setting EXCLUDE_FROM_DEFAULT_BUILD<br>
worked... I find it strange that there are 2 properties that<br>
essentially should do the same thing, but cause different behavior<br>
depending on the selected generator:<br>
<br>
<br>
function( _exclude_target target_name )<br>
set_target_properties(<br>
${target_name} PROPERTIES<br>
EXCLUDE_FROM_DEFAULT_BUILD TRUE<br>
EXCLUDE_FROM_ALL TRUE<br>
)<br>
endfunction()<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Feb 8, 2013 at 4:01 PM, David Cole <<a href="mailto:dlrdave@aol.com">dlrdave@aol.com</a>> wrote:<br>
> Does another library that you add later depend on that one? Or an<br>
> executable?<br>
><br>
> If so, then the library will be added because it's required by dependencies,<br>
> despite your request to exclude it from all.<br>
><br>
><br>
><br>
> -----Original Message-----<br>
> From: Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
> To: CMake <<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>><br>
> Sent: Fri, Feb 8, 2013 4:59 pm<br>
> Subject: [CMake] EXCLUDE_FROM_ALL not working?<br>
><br>
> I am calling add_library like so:<br>
><br>
> set( project_name mylib )<br>
> set( files main.cpp main.h )<br>
> set( exclude_flag EXCLUDE_FROM_ALL )<br>
> add_library( "${project_name}" SHARED ${exclude_flag} ${files} )<br>
><br>
> When I generate for Visual Studio 2008, I check the build<br>
> configuration and the mylib project is still setup to build when I<br>
> invoke Build Solution. Why isn't this flag working?<br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br>