<div dir="ltr">Hi All<div><br></div><div>(similar questions have been asked before, but none has quite hit the mark)<br><div><br></div><div>Is there any way to force MSVC to build custom targets marked with <span style="font-size:12.8000001907349px">EXCLUDE_FROM_DEFAULT_BUILD?</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Using</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">      cmake --build . --target SOME_EXCLUDED_TARGET --config Release</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">will produce the well known message</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">     Project not selected to build for this solution configuration</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">I could find the following two ways to get the targets to build, but they all have drawbacks:</span></div><div><ol><li><span style="font-size:12.8000001907349px">Use a BATCH_BUILD variable that will disable the setting of </span><span style="font-size:12.8000001907349px">EXCLUDE_FROM_DEFAULT_BUILD on the targets.</span><br></li><li><span style="font-size:12.8000001907349px">Define a set of build configurations on which </span><span style="font-size:12.8000001907349px">EXCLUDE_FROM_DEFAULT_BUILD_<config> is not set (e.g. Release_ALL is identical to Release, except it has no build exclusions)</span><br></li></ol></div><div>Option 1 has the drawback of producing solutions that do not work well for interactive development<br></div><div><br></div><div>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.</div><div><br></div><div>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?</div><div><br></div><div>Thank you so much for any feedback you can provide on this</div><div>-alessio</div></div></div>