When building a project with CMake, it first checks if it needs reconfiguration. This normally only happens when you change a CMakeLists.txt file. My CMake files contain code generation:
execute_process(
COMMAND generate_code.sh input.file output.cpp
)
add_library(lib STATIC output.cpp)
Now, when i change input.file
, i want it to reconfigure. I would like to mark input.file
as a "configuration dependency". How does this work? Or is there another way to have source files generated?
I know i can do this with configure_file()
but this needs to copy the file and this seems like a workaround to me.