[cmake-developers] RFC/Review Request: Topic GNUInstallDirs_debian-multiarch-fix

Brad King brad.king at kitware.com
Mon Jan 13 09:57:07 EST 2014


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




More information about the cmake-developers mailing list