As of cmake 4.0.0 there is a generic way to specify this target property. DEBUGGER_WORKING_DIRECTORY was added which can be set as a target property for executables. This value can be picked up by tooling (IDEs for example) via the cmake file API.