[CMake] Setting Working Directory for Debugging in MS VC++ via CMake

Steve Johns steve.johns at verizon.net
Wed Aug 2 16:14:58 EDT 2006


Recently, in an MS VC++ 7.1 (.NET 2003) build prepared using CMake, I've had 
a problem with the application finding a config file that it needs to read 
at startup.  Even though I placed the file in the app's startup dir (i.e. 
'blahblah/Debug', when debugging ) the app was not finding the file.  This 
despite the fact that when the app was run outside the IDE (e.g. simply from 
a command window) it always found the file (in the startup dir) without a 
problem.

Ultimately it was found that manually setting the 'Working Directory' 
property (in the property pane) for the ALL_BUILD target to 'blahblah/Debug' 
would enable the config file to be found.

Note:  setting the 'Working Directory' property for the single project that 
creates the application executable DID NOT work.

So, now my question is:

What can I do in CMake, or in CMakeLists.txt files, to set that (debugging) 
'Working Directory' property for the ALL_BUILD target automatically as part 
of the CMake build process?

Thanks kindly to anyone who can shed some light on this for me ...




More information about the CMake mailing list