On 13/01/14 15:34, Brad King wrote:
> This hunk:
> 
> -if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
> 
> removes the guard that avoids doing all the default-computing
> logic when there is already a value.  In this hunk:
> 
> +set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code 
> libraries (${_LIBDIR_DEFAULT})" FORCE)
> 
> one should not FORCE the cache entry.  Otherwise there is no way
> for the local users to change the setting for their build trees.
> 
> Both of the above are incorrect and seem unrelated to the proposed
> change.


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.

But I also just realized that the variable is "CACHE PATH" for some
reason I thought it was "CACHE INTERNAL", that means that the user can
change it, and therefore the force is not a good idea.

How do you suggest to handle this?



> In this hunk:
> 
> +    if (${CMAKE_INSTALL_PREFIX} MATCHES "^/usr/?$")
> 
> the left side should be quoted or just the plain variable name
> to ensure it works when the prefix value is an empty string.

Fixed in the topic.



Thanks,
 Daniele

-- 

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

Reply via email to