On 04/11/2014 11:32 AM, Jörg Kreuzberger wrote:
After reading serveral threads i ended in this solution

- create a batch/shell script for the command i want to start. This ensures 
path modifications are local. Creation is done via a configure_file step


I would run a cmake script with ${CMAKE_COMMAND} -P.
The script can use set(ENV{VAR}) and execute_process().
This has the advantage of being more portable than bash or batch scripts.

You can pass parameters to the script with -D (have to be listed before -P).

One of those parameters can be a generator expression that will expand to the location of the actual target to be executed. e.g. $<TARGET_FILE:tgt> [1] will be replaced with the full path of the target.

Nils

[1] http://www.cmake.org/cmake/help/git-master/manual/cmake-generator-expressions.7.html#informational-expressions
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Reply via email to