CMake's execute_process and arbitrary shell scripts

前端 未结 2 1347
悲哀的现实
悲哀的现实 2020-12-06 03:41

CMake\'s execute_process command seems to only let you, well, execute a process - not an arbitrary line you could feed a command shell. The thing is, I want to

2条回答
  •  余生分开走
    2020-12-06 03:51

    1. execute_process command seems to only let you, well, execute a process - not an arbitrary line you could feed a command shell.

    Yes, exactly this is written in documentation for that command:

    All arguments are passed VERBATIM to the child process. No intermediate shell is used, so shell operators such as > are treated as normal arguments.

    1. I want to use pipes

    Different COMMAND within same execute_process invocation are actually piped:

    Runs the given sequence of one or more commands with the standard output of each process piped to the standard input of the next.

    1. file descriptor redirection, etc. - and that does not seem to be possible.

    For complex things just prepare separate shell script and run it using execute_process. You can pass variables from CMake to this script using its parameters, or with prelimiary configure_file.

提交回复
热议问题