Gentoo Archives: gentoo-devhelp

From: Nikos Chantziaras <realnc@×××××.com>
To: gentoo-devhelp@l.g.o
Subject: [gentoo-devhelp] Re: Where should libraries be installed with cmake?
Date: Sat, 14 Jun 2014 15:39:56
Message-Id: lnhqbe$2j8$1@ger.gmane.org
In Reply to: Re: [gentoo-devhelp] Where should libraries be installed with cmake? by justin
1 On 14/06/14 14:35, justin wrote:
2 > On 13/06/14 23:58, Nikos Chantziaras wrote:
3 >> I'm creating a cmake file for a project. According to the cmake docs,
4 >> this is how I should install libraries:
5 >>
6 >> install(TARGETS MyLibrary DESTINATION lib)
7 >>
8 >> This installs the library files into ${CMAKE_INSTALL_PREFIX}/lib. With a
9 >> "/usr" prefix, that's simply "/usr/lib".
10 >>
11 >> But this doesn't look correct to me. What about "/usr/lib/lib64"? And I
12 >> can't just use "lib64", since that means the library will end up in the
13 >> wrong place on 32-bit systems.
14 >>
15 >> How do I handle this? The cmake documentation provides zero help on
16 >> this. With autoconf, this wasn't a problem, since there are variables
17 >> for the various install paths. cmake seems to give me nothing of the sort?
18 >>
19 >>
20 >
21 > Hi,
22 >
23 > the cmake-utils.eclass defines following two variables which help you
24 >
25 > LIB_SUFFIX library path suffix
26 > CMAKE_INSTALL_LIBDIR Output directory for libraries
27 >
28 > It seems later is defined recent cmake too.
29
30 It seems the cmake docs are somewhat out of date. I just did a grep for
31 CMAKE_INSTALL_LIBDIR in the cmake-2.8.12.2 sources, and indeed the
32 variable is there.
33
34 Thanks!