One thing I’ve taken for granted with using CMake is this. After cleaning a build directory and CMake is executed manually the first time, when make/ninja are executed, CMake is executed again automatically. This used to be the case for me. Now all of the sudden the second CMake execution isn’t happening. Admittedly, I have no idea why CMake was being executed twice, as I said, I’ve just taken it for granted that it does.
The issue is this: I have a large project where some CMakeLists.txt scripts are referencing CPACK version variables. But, there is a “chicken and egg” issue on a couple of sub-projects that require the second CMake execution in order for some CPACK variables to be set.
I know when CMakeLists.txt files are changed in a project and, in a incremental build, CMake is automatically executed with make/ninja execution.
- Is the second automatic CMake execution normal?
- If it is normal what triggers it?
- What would cause the second execution not to occur?