VS: Updates to CMAKE_CONFIGURE_DEPENDS not recognized by IDE builds
I have a code generator that generates code during the configure step. I add the templates used by the code generater to CMAKE_CONFIGURE_DEPENDS so that the files get regenerated when one of the templates is modified.
However, this only works when I delete and regenerate all the build files. A simple configure/generate does not do the job, and changes to the files do not trigger a configure.
This is very frustrating since I have to either regenerate and rebuild everything, or manually reconfigure when I change something.
I am using Visual Studio 2017 Community Edition, and tested this with CMake 3.7.1 and 3.8.0-rc4. I don't know if this affects any generators other than Visual Studio, or if it works in older versions of Visual Studio.
EDIT: After discussion below we believe the observed behavior is a bug in the VS IDE. It cannot be reproduced via MSBuild command-line builds. Workarounds include:
-
Right-click on
ALL_BUILD
'sCMakeLists.txt
entry and chooseCompile
. This somehow convinces VS to load the new dependencies. -
Or, delete
$platform/$config/ZERO_CHECK/ZERO_CHECK.tlog
.
EDIT 2: An even simpler example can reproduce the problem independent of CMake using just the MSBuild command line: missing-dep-update.zip. I've opened a problem report with VS upstream for this issue.