[CMake] how to define current working directory of command line tool

Michael Wild themiwi at gmail.com
Mon Oct 11 01:59:30 EDT 2010


On 11. Oct, 2010, at 24:13 , Andreas Pakulat wrote:

> On 10.10.10 21:41:05, Jochen Wilhelmy wrote:
>>>> Hi!
>>>> 
>>>> Is it possible to define the current working directory of a command line
>>>> tool
>>>> that is built with cmake? since the build is usually out-of-source I have
>>>> to set the current working directory in the ide, e.g visual studio or
>>>> xcode. more convenient would be to set it in cmake.
>>> 
>>> Do you mean in add_custom_command()/add_custom_target() ?
>>> Both have an optional WORKING_DIRECTORY argument.
>> no, i mean add_executable. when I build and start the directory I'd
>> like to set the
>> working directory that the executable is started in.
> 
> add_executable doesn't run any executable, hence setting a working-dir
> doesn't make any sense. What exactly are you trying to achieve?
> 
> Andreas

My guess is he's trying to run the executable from his IDE using the "run" or "debug" button and wants to specify the working directory for that. AFAIK this is not possible...

Michael

--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101011/ab1b7712/attachment.pgp>


More information about the CMake mailing list