summaryrefslogtreecommitdiffstats
path: root/Modules/GNUInstallDirs.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-12-14 18:24:28 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-12-14 18:24:28 (GMT)
commit43f83d2ee523a38648322f629559694c71d5bb52 (patch)
tree5d670b4a2f3b444f0a272e6fc63342f5d8e71c57 /Modules/GNUInstallDirs.cmake
parent4ed1769186f0622efced9d89e6593d136c920dd2 (diff)
downloadCMake-43f83d2ee523a38648322f629559694c71d5bb52.zip
CMake-43f83d2ee523a38648322f629559694c71d5bb52.tar.gz
CMake-43f83d2ee523a38648322f629559694c71d5bb52.tar.bz2
GNUInstallDirs: add support for Debian multiarch
This patch makes CMAKE_INSTALL_LIBDIR default to the debian multiarch dir if present, e.g. lib/i386-linux-gnu/ Alex
Diffstat (limited to 'Modules/GNUInstallDirs.cmake')
-rw-r--r--Modules/GNUInstallDirs.cmake30
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()