1
0

exec_program.rst 939 B

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