[CMake] What changes to the cache file, if any, will trigger a rerun of CMake?
Hi all, I tried to figure this out by browsing the docs and the mailing lists, but failed. What changes to the cache file (CMakeCache.txt) will trigger a rerun of CMake. AFAIK changes to CMAKE_LANG_COMPILER will do this, but are there other situations? My reason for asking this is that I was wondering whether it is possible to force a re-run of CMake when one or more OPTION variables are changed in the cache *during* a CMake run. Best regards, Marcel Loose. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] What changes to the cache file, if any, will trigger a rerun of CMake?
On Wed, Sep 23, 2009 at 03:02:31PM +0200, Marcel Loose wrote: What changes to the cache file (CMakeCache.txt) will trigger a rerun of CMake. AFAIK changes to CMAKE_LANG_COMPILER will do this, but are there other situations? Don't all changes to the cache trigger a CMake rebuild? My reason for asking this is that I was wondering whether it is possible to force a re-run of CMake when one or more OPTION variables are changed in the cache *during* a CMake run. This sounds a little scary but I think I've seen CMake do this when I edit a CMakeLists in the middle of a build on Linux. Other build systems might have different ideas about when to check whether the CMake-generated files are out of date, so this might only work on some platforms. tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] What changes to the cache file, if any , will trigger a rerun of CMake?
On Wednesday 23 September 2009 17:45:39 Tyler Roscoe wrote: On Wed, Sep 23, 2009 at 03:02:31PM +0200, Marcel Loose wrote: What changes to the cache file (CMakeCache.txt) will trigger a rerun of CMake. AFAIK changes to CMAKE_LANG_COMPILER will do this, but are there other situations? Don't all changes to the cache trigger a CMake rebuild? My reason for asking this is that I was wondering whether it is possible to force a re-run of CMake when one or more OPTION variables are changed in the cache *during* a CMake run. This sounds a little scary but I think I've seen CMake do this when I edit a CMakeLists in the middle of a build on Linux. Other build systems might have different ideas about when to check whether the CMake-generated files are out of date, so this might only work on some platforms. tyler Well, I created a macro (inspired by the KDE macro in kdelibs, macro_optional_add_subdirectory) that will only do add_subdirectory() if the directory actually exists (useful to do partial builds of large projects). Inside the conditional part of that macro is the option() command to define a new build option. So, in that case, a new option is added to the cache *during* a CMake run. I wasn't sure if these changes would always trigger a re-run of CMake, cause my (few) experiments were a bit inconclusive. But, if each change to CMakeCache.txt triggers a CMake re-run, then I should be safe. Best regards, Marcel Loose. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] What changes to the cache file, if any, will trigger a rerun?of CMake?
On Wed, Sep 23, 2009 at 10:28:04PM +0200, Marcel Loose wrote: Well, I created a macro (inspired by the KDE macro in kdelibs, macro_optional_add_subdirectory) that will only do add_subdirectory() if the directory actually exists (useful to do partial builds of large projects). Inside the conditional part of that macro is the option() command to define a new build option. So, in that case, a new option is added to the cache *during* a CMake run. I wasn't sure if these changes would always trigger a re-run of CMake, cause my (few) experiments were a bit inconclusive. But, if each change to CMakeCache.txt triggers a CMake re-run, then I should be safe. As with any advice you get from me, you should double-check it before you use it :). I'm not guaranteeing that changing the cache during a build will trigger a CMake rebuild. Note also that doing a multi-thread compile (make -j) may cause your CMake rebuild to happen at inconsistent times. tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake