Hi all, At work we recently switched from source globbing to explicit source listing, which should in theory remove the need for manually having to run CMake. It turns out, however, that for Visual Studio generators, this is not really the case.
As far as I understand, the logic behind automatic project regeneration is controlled by the ZERO_CHECK target on which all other targets depend and which reruns CMake when necessary. However, this reconfiguration is triggered from inside a running msbuild, which then in turn is not stopped or restarted and does not pick up the updated project files, causing the running build to be out-of-date. This is known behavior, see, e.g., http://cmake.3232098.n2.nabble.com/MSBuild-and-automatic-project-file-regenation-td7166716.html and arguably a problem with msbuild rather than with CMake. There are currently two use cases in which one runs into problems: - When using "cmake --build . ". - When building from the VS IDE. I would like to propose a small change that would at least improve things already for the first use case. The idea is to change the actual (native) build command (which builds a single target) and replace it by sequentially running two almost identical msbuild commands: first targeting ZERO_CHECK and then targeting whatever target the user requested, picking up any changes to the project files. I am attaching a patch to illustrate what this could look like. If there is interest in this patch, I will gladly clean it up a bit. Thanks. Regards, Yves
0001-When-building-using-cmake-build-which-natively-uses-.patch
Description: Binary data
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers