Hi there 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 A_remote.
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 1>------ Skipped Build: Project: run_deploy, Configuration: Debug x64 ------ 1>Project not selected to build for this solution configuration Here's a sample CMakeLists.txt. cmake_minimum_required(VERSION 3.11.0 FATAL_ERROR) file(WRITE main.cpp "int main(){return 0;}\n") file(WRITE deploy.bat "echo Deploying!\n") add_executable(A main.cpp) add_executable(A_remote main.cpp) add_custom_target(run_deploy "${CMAKE_SOURCE_DIR}/deploy.bat") set_target_properties(run_deploy PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1) add_dependencies(A_remote run_deploy) 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 than that. 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? Cheers, Andreas Follow this link to read our Privacy Statement<https://www.stryker.com/content/stryker/gb/en/legal/global-policy-statement.html/>
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake