On 01/13/2014 09:47 AM, Daniele E. Domenichelli wrote: > The problem comes when you change the CMAKE_INSTALL_PREFIX: > > When you run cmake (with no -DCMAKE_INSTALL_PREFIX=... argument), > CMAKE_INSTALL_PREFIX is set to /usr/local, and the CMAKE_INSTALL_LIBDIR > is set to lib. > > If later you want to change it to CMAKE_INSTALL_PREFIX to /usr, without > the removing the if(), the code is not called, and without the "FORCE", > the cached value is not updated.
Store an empty string in the cache but with help text that says what the default will be. When the cached value is set to non-empty then use it because we know the user must have set it to something. Otherwise compute the default and set it as a normal variable. -Brad -- 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
