On Sun, Dec 20, 2009 at 10:53 AM, Steve Chu <[email protected]> wrote:
> Does EXECUTE_PROCESS support relative path to CMakeLists.txt file?
>
> Suppose we have this demo:
>
> EXECUTE_PROCESS(
>  COMMAND /bin/cat ./xxx
>  # WORKING_DIRECTORY /some/absolute/path
> )
>
> If we do not set WORKING_DIRECTORY to absolute path, this command does not 
> work.
> But I do not want to introduce a fixed absolute path(or ENV) that is
> up to who builds the project.
>
> So does cmake have a feature of relative path? Such as:
> EXECUTE_PROCESS(
>  COMMAND /bin/cat RELATIVE{./xxx}
> )
>
> here RELATIVE means relative to CMakeLists.txt file.

You can use ${CMAKE_CURRENT_SOURCE_DIR} and the path relative to that.

http://www.cmake.org/Wiki/CMake_Useful_Variables

-- 
Philip Lowman
_______________________________________________
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