I switched my project from Visual Studio to CMake + VS Code. I am fairly a beginner to CMake.
The project consists of 4 subdirectories: 1) script, 2) grid 3) app and 4) 64Bit. The first 3 directories each have CMakeLists.txt
files. There is also a top-level CMakeLists.txt file.
The 64Bit
directory is for distribution and contains other DLLs and many other files so that the executable can run.
I can generate DLLs and the EXE in the project/build
directory and then copy them to project/64Bit
directory using a command similar to the following:
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:${PROJECT_NAME}> ${CMAKE_SOURCE_DIR}/64Bit/${PROJECT_NAME}.exe)
My problem is, when I use “Launch the selected target in the terminal window” button in VS Code, then it attempts to launch project/build/app/Release/app.exe
whereas I want it to launch project/64Bit/app.exe
file.
Is there a way I can change the launch target either from CMakeLists.txt files or using the GUI of the CMake extension? I am also thinking that this issue will cause me Debugging problems later on.
Thanks in advance!