[CMake] EXECUTE_PROCESS and relative path

Steve Chu stvchu at gmail.com
Sun Dec 20 10:53:31 EST 2009


Hi, all,

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.

Best Regards,

Steve Chu
http://stvchu.org


More information about the CMake mailing list