[CMake] How can I place a 64bit library build into /usr/lib64?

Gregor Jasny gjasny at googlemail.com
Mon Jul 29 07:49:56 EDT 2013


Hi Zack,

On 7/28/13 5:20 AM, Zack Perry wrote:
> I have been trying to build libc++ <http://libc++.llvm.org/> on a RHEL 6.4 64bit box. The library comes with a CMakeLists.txt <http://llvm.org/svn/llvm-project/libcxx/trunk/CMakeLists.txt>.
>
> Running the following:
>
> CC=clang CXX=clang++ cmake -G "Unix Makefiles" -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_LIBCXXABI_INCLUDE_PATHS="/usr/include/c++abi/3.3/" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLIB_SUFFIX=64 $HOME/clang3.3/libs/libcxx
>
>
> It can successfully generate a Makefile in the build subdirectory (it's an out-of-source build).
>
> By adding a few CPack related statements, I also can create a RPM using 'make package'.  But, a rpm -qlp libcxx-3-3-0.el6.x86_64.rpm shows that the shared library is installed in /usr/lib, not /usr/lib64, as 64bit libraries on RHEL 6.x should go.

Not sure if this will help when building clang:

If you include("GNUInstallDirs") you'll get a LIBRDIR variable defined 
that will be lib, lib64, or lib/<multiarch-tuple> depending on your 
distribution and architecture.

You could use this variable instead of a generic "lib" in the target 
install parameters.

Thanks,
Gregor



More information about the CMake mailing list