Davidius
Davidius

Reputation: 170

Multiple input files to CMake execute_process

I want to execute a command in CMake with execute_process(). I have multiple input files in a variable. How can I get all files into the INPUT_FILE section?

using

execute_process(
    COMMAND
        ${Python3_EXECUTABLE}
        ${CMAKE_SOURCE_DIR}/tools/generator.py
        ${input_files}
    INPUT_FILE ${CMAKE_SOURCE_DIR}/tools/generator.py
    INPUT_FILE ${input_files}
    OUTPUT_FILE ${output_files})

gives the following message:

CMake Error at /cmake/codegen.cmake:112 (execute_process):
    execute_process given unknown argument
    "second_file.name"

Upvotes: 2

Views: 370

Answers (1)

Davidius
Davidius

Reputation: 170

INPUT_FILE and OUTPUT_FILE are not ment to contain one file used or changed by the command. The file listed there are standard input and output to the process.

The file given in OUTPUT_FILE is in fact the logging file for standard output. INPUT_FILE is input a user would give over the console after the execution of the command has been triggered.

Upvotes: 1

Related Questions