In my project, with CMake 3.8 for MSVC, in order to change the working directory when debugging MY_TARGET I can put the following:
set_property(TARGET ${MY_TARGET} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "$(SolutionDir)")
In CLion, I get the same effect if I manually change the run/debug configuration working directory to $CMakeCurrentGenerationDir$
.
But is there a way to tell CMake to automatically put $CMakeCurrentGenerationDir$
in the run/debug configuration working directory?