[CMake] EXCLUDE_FROM_DEFAULT_BUILD: a solution that works for both interactive and unattended builds
Nagy-Egri MC!tC) Ferenc
csiga.biga at aol.com
Tue May 12 09:52:03 EDT 2015
I am also interested in this. Not because I couldn’t do 2 seperate build directories for CLI and IDE building, but because VS projects are still the best shot at getting parallel builds on Windows. NMake batch support is not implemented, and Ninja has never built any of my projects without errors.
Feladó: Alessio
Elküldve: kedd, 2015. május 12. 13:28
Címzett: cmake at cmake.org
Hi All
(similar questions have been asked before, but none has quite hit the mark)
Is there any way to force MSVC to build custom targets marked with EXCLUDE_FROM_DEFAULT_BUILD?
Using
cmake --build . --target SOME_EXCLUDED_TARGET --config Release
will produce the well known message
Project not selected to build for this solution configuration
I could find the following two ways to get the targets to build, but they all have drawbacks:
Use a BATCH_BUILD variable that will disable the setting of EXCLUDE_FROM_DEFAULT_BUILD on the targets.
Define a set of build configurations on which EXCLUDE_FROM_DEFAULT_BUILD_<config> is not set (e.g. Release_ALL is identical to Release, except it has no build exclusions)
Option 1 has the drawback of producing solutions that do not work well for interactive development
Option 2 is rather cumbersome and would require the users to build separate sets of binaries. I could not quite figure out a way to make the Release_ALL packaging commands reference the Release target binaries.
Has anyone figured out a way to get the full monty, i.e. a way to generate an MSVC solution that works well for both interactive and command line builds?
Thank you so much for any feedback you can provide on this
-alessio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150512/a1247360/attachment.html>
More information about the CMake
mailing list