diff options
author | David Cole <david.cole@kitware.com> | 2012-01-09 19:08:39 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-01-09 19:08:39 (GMT) |
commit | d4fe0d0304ef20506c3c864319e6e8e5a13db276 (patch) | |
tree | 3cd16726f6f01f400f39d9f1f815988bbd545e3a /Modules | |
parent | 99a9205b4b1371a6801a6f4ef154fbdd0c8a84d7 (diff) | |
parent | 43f83d2ee523a38648322f629559694c71d5bb52 (diff) | |
download | CMake-d4fe0d0304ef20506c3c864319e6e8e5a13db276.zip CMake-d4fe0d0304ef20506c3c864319e6e8e5a13db276.tar.gz CMake-d4fe0d0304ef20506c3c864319e6e8e5a13db276.tar.bz2 |
Merge topic 'GNUInstallDirs-DebianMultiarch'
43f83d2 GNUInstallDirs: add support for Debian multiarch
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/GNUInstallDirs.cmake | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index a114dcb..0302e4b 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -11,7 +11,7 @@ # SYSCONFDIR - read-only single-machine data (etc) # SHAREDSTATEDIR - modifiable architecture-independent data (com) # LOCALSTATEDIR - modifiable single-machine data (var) -# LIBDIR - object code libraries (lib or lib64) +# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian) # INCLUDEDIR - C header files (include) # OLDINCLUDEDIR - C header files for non-gcc (/usr/include) # DATAROOTDIR - read-only architecture-independent data root (share) @@ -75,18 +75,24 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR) # - we are NOT on debian # - we are on a 64 bits system # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf - # Note that the future of multi-arch handling may be even - # more complicated than that: http://wiki.debian.org/Multiarch + # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if + # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu" + # See http://wiki.debian.org/Multiarch if(CMAKE_SYSTEM_NAME MATCHES "Linux" - AND NOT CMAKE_CROSSCOMPILING - AND NOT EXISTS "/etc/debian_version") - if(NOT DEFINED CMAKE_SIZEOF_VOID_P) - message(AUTHOR_WARNING - "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " - "Please enable at least one language before including GNUInstallDirs.") - else() - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - set(_LIBDIR_DEFAULT "lib64") + AND NOT CMAKE_CROSSCOMPILING) + if (EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE) + set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}") + endif() + else() # not debian, rely on CMAKE_SIZEOF_VOID_P: + if(NOT DEFINED CMAKE_SIZEOF_VOID_P) + message(AUTHOR_WARNING + "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " + "Please enable at least one language before including GNUInstallDirs.") + else() + if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") + set(_LIBDIR_DEFAULT "lib64") + endif() endif() endif() endif() |