[CMake] CMAKE_INSTALL_LIBDIR - full path or relative?

Michael Wild themiwi at gmail.com
Mon Feb 20 16:15:39 EST 2012


On 02/20/2012 09:59 PM, Orion Poplawski wrote:
> For quite a while, Fedora packages will call cmake with
> -DCMAKE_INSTALL_LIBDIR set to /usr/lib or /usr/lib64 as appropriate. 
> Some projects that use this convention include plplot, lasi
> 
> The relatively new cmake module GNUInstallDirs sets CMAKE_INSTALL_LIBDIR
> to lib or lib64.  Other projects like tkimg appear to use this convention.
> 
> A bug has been filed in Fedora due to this:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=795542
> 
> Is this indeed the preferred convention for CMAKE_INSTALL_LIBDIR?  Shall
> I file bugs against plplot, lasi and others to change the usage?
> 

Hi Orion

Whenever an installation directory is not an absolute path, CMake
prefixes it with the value of CMAKE_INSTALL_PREFIX. This is for
convenience and make it easier to be consistent. AFAIK this behaviour is
similar to what autoconf does.

So, as long as your CMAKE_INSTALL_PREFIX and CMAKE_INSTALL_LIBDIR are
consistent, you should be fine. Normally I consider setting projects
which set any of the CMAKE_INSTALL_*DIR (or whatever they are called) to
an absolute path to be a nuisance for the user because it is not enough
to set one variable (CMAKE_INSTALL_PREFIX) in order to change the
installation prefix. But that is IMHO a matter of taste and you can
argue both ways.

My 2c...

Michael


More information about the CMake mailing list