[CMake] CMAKE_INSTALL_LIBDIR - full path or relative?

Hendrik Sattler post at hendrik-sattler.de
Wed Feb 22 12:16:32 EST 2012


Am Montag, 20. Februar 2012, 22:15:39 schrieb Michael Wild:
> 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.

And using an absolute path may give you problems with cpack as the 
CMAKE_INSTALL_*DIR variables are usually used directly in install() 
directives.

HS


More information about the CMake mailing list