exec_program.rst 904 B

123456789101112131415161718192021222324
  1. exec_program
  2. ------------
  3. Deprecated. Use the execute_process() command instead.
  4. Run an executable program during the processing of the CMakeList.txt
  5. file.
  6. ::
  7. exec_program(Executable [directory in which to run]
  8. [ARGS <arguments to executable>]
  9. [OUTPUT_VARIABLE <var>]
  10. [RETURN_VALUE <var>])
  11. The executable is run in the optionally specified directory. The
  12. executable can include arguments if it is double quoted, but it is
  13. better to use the optional ARGS argument to specify arguments to the
  14. program. This is because cmake will then be able to escape spaces in
  15. the executable path. An optional argument OUTPUT_VARIABLE specifies a
  16. variable in which to store the output. To capture the return value of
  17. the execution, provide a RETURN_VALUE. If OUTPUT_VARIABLE is
  18. specified, then no output will go to the stdout/stderr of the console
  19. running cmake.