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

2010-10-29 Thread Jochen Wilhelmy




 

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


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

2010-10-29 Thread Ryan Pavlik
On Fri, Oct 29, 2010 at 7:48 AM, Jochen Wilhelmy j.wilhe...@arcor.de wrote:




 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



See my CreateLaunchers.cmake script here:
http://github.com/rpavlik/cmake-modules

-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpav...@iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
___
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


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

2010-10-11 Thread Michael Wild

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



PGP.sig
Description: This is a digitally signed message part
___
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

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

2010-10-11 Thread Jochen Wilhelmy

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.

-Jochen
 

I think that you have a misconception with respect to the concept of working 
directory.

In a Unix-style environment, the working directory is determined by the shell command 
line interpreter. The actual value is determined only at execution-time. It is not something 
built-in to the executable.
   
No, I mean this very unix-style working directory. Of course this is 
only a debug setting, i.e. it does not influence the
build result. But if I write a command line tool, e.g. a copy, then I 
have some test files to copy and need some arguments
for the copy tool to tell it which files to copy. Therefore it is 
possible to set the working directory and command line
arguments in an ide (visual studio or xcode). For xcode there is even 
the effect that after cmake runs the current
setting is lost which is not the case for visual studio since these 
settings are stored in a separate file.


-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


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

2010-10-11 Thread Andreas Pakulat
On 11.10.10 10:07:58, 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.
 
 -Jochen
 I think that you have a misconception with respect to the concept of 
 working directory.
 
 In a Unix-style environment, the working directory is determined by the 
 shell command line interpreter. The actual value is determined only at 
 execution-time. It is not something built-in to the executable.
 No, I mean this very unix-style working directory. Of course this is
 only a debug setting, i.e. it does not influence the
 build result. But if I write a command line tool, e.g. a copy, then
 I have some test files to copy and need some arguments
 for the copy tool to tell it which files to copy. Therefore it is
 possible to set the working directory and command line
 arguments in an ide (visual studio or xcode). For xcode there is
 even the effect that after cmake runs the current
 setting is lost which is not the case for visual studio since these
 settings are stored in a separate file.

CMake is not concerned with running your apps, its only concerned with
building the code (or rather generating something which can build the
code). So no, there's no way of setting a working-dir for the targets
you build.

Andreas

-- 
Day of inquiry.  You will be subpoenaed.
___
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


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

2010-10-11 Thread Michael Wild

On 11. Oct, 2010, at 10:07 , 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.
 
 -Jochen
 
 I think that you have a misconception with respect to the concept of 
 working directory.
 
 In a Unix-style environment, the working directory is determined by the 
 shell command line interpreter. The actual value is determined only at 
 execution-time. It is not something built-in to the executable.
   
 No, I mean this very unix-style working directory. Of course this is only a 
 debug setting, i.e. it does not influence the
 build result. But if I write a command line tool, e.g. a copy, then I have 
 some test files to copy and need some arguments
 for the copy tool to tell it which files to copy. Therefore it is possible to 
 set the working directory and command line
 arguments in an ide (visual studio or xcode). For xcode there is even the 
 effect that after cmake runs the current
 setting is lost which is not the case for visual studio since these settings 
 are stored in a separate file.
 
 -Jochen

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).


Michael



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



PGP.sig
Description: This is a digitally signed message part
___
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

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

2010-10-11 Thread Jochen Wilhelmy



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.

-Jochen

 

I think that you have a misconception with respect to the concept of working 
directory.

In a Unix-style environment, the working directory is determined by the shell command 
line interpreter. The actual value is determined only at execution-time. It is not something 
built-in to the executable.

   

No, I mean this very unix-style working directory. Of course this is only a 
debug setting, i.e. it does not influence the
build result. But if I write a command line tool, e.g. a copy, then I have some 
test files to copy and need some arguments
for the copy tool to tell it which files to copy. Therefore it is possible to 
set the working directory and command line
arguments in an ide (visual studio or xcode). For xcode there is even the 
effect that after cmake runs the current
setting is lost which is not the case for visual studio since these settings 
are stored in a separate file.

-Jochen
 

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

___
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


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

2010-10-11 Thread Michael Wild

On 11. Oct, 2010, at 11:20 , 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.
 
 -Jochen
 
 
 I think that you have a misconception with respect to the concept of 
 working directory.
 
 In a Unix-style environment, the working directory is determined by the 
 shell command line interpreter. The actual value is determined only at 
 execution-time. It is not something built-in to the executable.
 
   
 No, I mean this very unix-style working directory. Of course this is only a 
 debug setting, i.e. it does not influence the
 build result. But if I write a command line tool, e.g. a copy, then I have 
 some test files to copy and need some arguments
 for the copy tool to tell it which files to copy. Therefore it is possible 
 to set the working directory and command line
 arguments in an ide (visual studio or xcode). For xcode there is even the 
 effect that after cmake runs the current
 setting is lost which is not the case for visual studio since these 
 settings are stored in a separate file.
 
 -Jochen
 
 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

PGP.sig
Description: This is a digitally signed message part
___
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

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

2010-10-11 Thread Michael Hertling
On 10/11/2010 11:20 AM, 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.

 -Jochen

  
 I think that you have a misconception with respect to the concept of 
 working directory.

 In a Unix-style environment, the working directory is determined by the 
 shell command line interpreter. The actual value is determined only at 
 execution-time. It is not something built-in to the executable.


 No, I mean this very unix-style working directory. Of course this is only a 
 debug setting, i.e. it does not influence the
 build result. But if I write a command line tool, e.g. a copy, then I have 
 some test files to copy and need some arguments
 for the copy tool to tell it which files to copy. Therefore it is possible 
 to set the working directory and command line
 arguments in an ide (visual studio or xcode). For xcode there is even the 
 effect that after cmake runs the current
 setting is lost which is not the case for visual studio since these 
 settings are stored in a separate file.

 -Jochen
  
 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?

You might consider to use ADD_CUSTOM_COMMAND(TARGET ...), e.g.:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(CWD C)
FILE(WRITE ${CMAKE_BINARY_DIR}/main.c 
#include unistd.h
#include stdio.h
int main(void)
{
char cwd[1000];
getcwd(cwd,sizeof cwd);
printf(\CWD: %s\\n\,cwd);
return 0;
}
)
ADD_EXECUTABLE(main main.c)
ADD_CUSTOM_COMMAND(TARGET main
POST_BUILD
COMMAND main
WORKING_DIRECTORY /var/tmp)

This runs the executable main each time after it has been (re)built
from within the working directory /var/tmp - adapt for non-*nices.

Regards,

Michael
___
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


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

2010-10-11 Thread Ryan Pavlik
 You could look at my CreateLaunchers.cmake script, in 
http://github.com/rpavlik/wiimote-head-tracker-gui/tree/master/cmake/  - 
I use this so that I can click the run button in Visual Studio, it 
produces the files needed to set that up properly.  (The only caveat is 
that you can't have visual studio running when you run a cmake that 
would create or update the launcher, because Visual Studio overwrites 
the file we generate when it exits, and it doesn't re-load the file 
during runtime.)


Ryan

On 10/11/2010 10:39 AM, Michael Hertling wrote:

On 10/11/2010 11:20 AM, 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.

-Jochen



I think that you have a misconception with respect to the concept of working 
directory.

In a Unix-style environment, the working directory is determined by the shell command 
line interpreter. The actual value is determined only at execution-time. It is not something 
built-in to the executable.



No, I mean this very unix-style working directory. Of course this is only a 
debug setting, i.e. it does not influence the
build result. But if I write a command line tool, e.g. a copy, then I have some 
test files to copy and need some arguments
for the copy tool to tell it which files to copy. Therefore it is possible to 
set the working directory and command line
arguments in an ide (visual studio or xcode). For xcode there is even the 
effect that after cmake runs the current
setting is lost which is not the case for visual studio since these settings 
are stored in a separate file.

-Jochen


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?

You might consider to use ADD_CUSTOM_COMMAND(TARGET ...), e.g.:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(CWD C)
FILE(WRITE ${CMAKE_BINARY_DIR}/main.c 
#includeunistd.h
#includestdio.h
int main(void)
{
 char cwd[1000];
 getcwd(cwd,sizeof cwd);
 printf(\CWD: %s\\n\,cwd);
 return 0;
}
)
ADD_EXECUTABLE(main main.c)
ADD_CUSTOM_COMMAND(TARGET main
 POST_BUILD
 COMMAND main
 WORKING_DIRECTORY /var/tmp)

This runs the executable main each time after it has been (re)built
from within the working directory /var/tmp - adapt for non-*nices.

Regards,

Michael
___
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



--
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpav...@iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik

___
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


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

2010-10-11 Thread J Decker
On Mon, Oct 11, 2010 at 2:20 AM, Jochen Wilhelmy j.wilhe...@arcor.de 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.

 -Jochen



 I think that you have a misconception with respect to the concept of
 working directory.

 In a Unix-style environment, the working directory is determined by
 the shell command line interpreter. The actual value is determined only 
 at
 execution-time. It is not something built-in to the executable.



 No, I mean this very unix-style working directory. Of course this is only
 a debug setting, i.e. it does not influence the
 build result. But if I write a command line tool, e.g. a copy, then I
 have some test files to copy and need some arguments
 for the copy tool to tell it which files to copy. Therefore it is
 possible to set the working directory and command line
 arguments in an ide (visual studio or xcode). For xcode there is even the
 effect that after cmake runs the current
 setting is lost which is not the case for visual studio since these
 settings are stored in a separate file.

 -Jochen


 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?

That would be a handy feature... but the debugging properties of a
target are saved in .vcxproj.user so they tend to stick around after
setting them... even rebuilding the solution and projects with cmake
the debug settings remain so it's not a huge deal to just set it by
hand... would be nice to be able to specify those, but then again, I'm
glad it doesn't write the .user files so that changes I make there do
stay.


 -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

___
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


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

2010-10-10 Thread Alexander Neundorf
On Saturday 09 October 2010, 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.

Alex
___
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


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

2010-10-10 Thread Jochen Wilhelmy



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.

-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


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

2010-10-10 Thread Andreas Pakulat
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

-- 
Be careful!  Is it classified?
___
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