Does CMake offer a method to set the working directory for a given build system to use when running/debugging the project?

后端 未结 3 1717
既然无缘
既然无缘 2020-12-05 13:18

I have a project with the following structure:

project_name/CMakeLists.txt
project_name/src
project_name/resources
...
project_name-build/configuration_name/         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 14:03

    Since CMake 3.8, there is the VS_DEBUGGER_WORKING_DIRECTORY target property, which allows you to set the debugger working directory for a target in Visual Studio.

    Usage example:

    set_property(TARGET MyTarget PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
    

提交回复
热议问题