We are using a large project that comes with it's own build and configuration system.
We have multiple issues with this external build system and we want to move the building of this project to cmake (as well as our code that depends on it).
All the problems are related to the `build` step and we want to replace it with a simple `add_library` with all sources.
The problem starts due to the fact that the project's configuration process is complicated and ever-changing, and we do not want to maintain a copy of it inside cmake.
Instead, we want to call `execute_process` to get cmake variables needed from the external configuration system and have a simple cmake build steps on top of it.
The thing is we want proper detection of when to rerun the configure step and we want something similar to `add-custom_target`'s DEPENDS variable, only at configure time.
Is this possible by any means? I know of `CMAKE_CONFIGURE_DEPENDS`, but the fact that it is global is problematic and here's why:
There are multiple cmake variables that come from this configuration system - from the language standard version to the list of target sources.
Change in what creates one of them should NOT trigger the configuration system for another variable as this could cause a full rebuild of the project which is undesirable due to long compilation times.
Basically, what I'm asking is - Is there a way to describe "custom commands", with proper dependency management that run at configure time?