Are you trying to run the executable with ADD_TEST? In that case the working 
directory is always CMAKE_CURRENT_BINARY_DIR. If you need to change it, create 
a wrapper script (you can do so using the CMake language in order to not depend 
on any other interpreter).

no, just add_executable and then starting the target in debug mode inside the 
ide. but maybe add_test is the solution to my
problem, i have to look at it. is this for starting an executable with some 
command line arguments?

-Jochen

It is for adding a single unit test which can then be run using CTest.

Michael

Perhaps adding unit tests for testing my command line tool is the right way, but really practical would be to have a target property to set the default debugging working directory for a target. In visual studio this is right click on a target, then properties. Then on the left side Configuration Properties->Debugging and on the right side Working Directory. This is used when you launch the target from inside the IDE. I always have to set it by hand. Even worse on macos: there I have to set it every time cmake has run. Therefore I still would request this feature (e.g. set_target_properties(MyTarget PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) )

-Jochen

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to