Project not built when I specify exclude_from_default_build in CMake
I build an executable A. I have set up another target A_remote that uses a custom launcher for remote debugging with Visual Studio. What I'm trying to achieve is that before the A_remote target is run, another target
is run that deploys files to the remote computer. So I add a custom target run_deploy that runs a batch file, and make A_remote depend on it. As run_deploy also copies image files which aren't part of the VS solution, I want it to always run before launching
However, when I build the entire solution, I don't want VS to build anything related to remote debugging, which is why I use EXCLUDE_FROM_DEFAULT_BUILD. But when I do that, and build A_remote, VS tells me
The documentation https://cmake.org/cmake/help/latest/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.html says "Exclude target from Build Solution." This might have been the intention, but the way it is implemented seems to do more
Anyways, how can I achieve that run_deploy is always built when I build A_remote, but not when I build the solution or ALL_BUILD? Is that even possible? Is there a workaround?