diff options
author | Eric NOULARD <eric.noulard@gmail.com> | 2011-03-28 19:10:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-03-31 18:45:48 (GMT) |
commit | 126c993d031f6f7be4970a67621da92f580d4e5a (patch) | |
tree | ebdeff27da3746c082d55b02ad8ca440de1ead84 /Tests/CPackComponentsForAll/CMakeLists.txt | |
parent | 148b528f9d7d991dc01f277624df4a8aa41feccc (diff) | |
download | CMake-126c993d031f6f7be4970a67621da92f580d4e5a.zip CMake-126c993d031f6f7be4970a67621da92f580d4e5a.tar.gz CMake-126c993d031f6f7be4970a67621da92f580d4e5a.tar.bz2 |
Fix #11964 Handle lib64 library on Linux
The AMD64 ABI document http://www.x86-64.org/documentation/abi.pdf
does specify that 64bits binary libraries should end up in <prefix>/lib64
and 32bits ones in <prefix>/lib. All but debian based distros do so,
and some like OpenSUSE even enforce the rule when packaging with RPM
and refuse to build the RPM if this is not the case.
After some discussion (see the bug notes) we cannot do that behind
the scene and the current fix supposes that the user shall use
the CMAKE_INSTALL_LIBDIR variables content in its INSTALL rules if
he wants to put the lib in the right place. CMAKE_INSTALL_LIBDIR
shall have the appropriate value depending on the Linux distribution
found and 32/64bitness of the host.
The cross-compiling case (even 32bits compile on a 64bits host)
is not handled.
Diffstat (limited to 'Tests/CPackComponentsForAll/CMakeLists.txt')
-rw-r--r-- | Tests/CPackComponentsForAll/CMakeLists.txt | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index ce12b3b..5449d09 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -10,13 +10,8 @@ cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR) project(CPackComponentsForAll) -set(LIBDEST "lib") -include(${CMAKE_SOURCE_DIR}/SystemSpecificInformations.cmake) -if(DISTRO_ID MATCHES "SUSE") - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(LIBDEST "lib64") - endif("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) -endif(DISTRO_ID MATCHES "SUSE") +# Use GNUInstallDirs in order to enforce lib64 if needed +include(GNUInstallDirs) # Create the mylib library add_library(mylib mylib.cpp) @@ -35,7 +30,7 @@ target_link_libraries(mylibapp2 mylib) # be used to create the installation components. install(TARGETS mylib ARCHIVE - DESTINATION ${LIBDEST} + DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) install(TARGETS mylibapp RUNTIME |