I have a build setup that involves doing something like:
execute_process(
COMMAND python do_some_stuff.py --output moar_build.cmake
OUTPUT_FILE moar_build.cmake)
include(moar_build.cmake)
Basically, I have this complicated python script that sets up logic that generates a CMake file to then be included into the build.
I can’t make this an add_custom_command
because I can’t then add moar_build.cmake
into the build itself, since that doesn’t get run until the build stage, so this is too late.
But it appears that execute_process
doesn’t have a DEPENDS
like add_custom_command
does, so if do_some_stuff.py
changes, then it doesn’t get rerun (I would have to manually reconfigure).
Is there any other way to get something like this to work? That is, I need to run a program during the configuration phase of cmake in order to then include the generated cmake file as part of the build, but actually have changes to that program cause reconfiguration?