Merge topic 'GNUInstallDirs-DebianMultiarch'

43f83d2 GNUInstallDirs: add support for Debian multiarch
This commit is contained in:
David Cole 2012-01-09 14:08:39 -05:00 committed by CMake Topic Stage
commit d4fe0d0304
1 changed files with 18 additions and 12 deletions

View File

@ -11,7 +11,7 @@
# SYSCONFDIR - read-only single-machine data (etc) # SYSCONFDIR - read-only single-machine data (etc)
# SHAREDSTATEDIR - modifiable architecture-independent data (com) # SHAREDSTATEDIR - modifiable architecture-independent data (com)
# LOCALSTATEDIR - modifiable single-machine data (var) # 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) # INCLUDEDIR - C header files (include)
# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) # OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
# DATAROOTDIR - read-only architecture-independent data root (share) # 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 NOT on debian
# - we are on a 64 bits system # - we are on a 64 bits system
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
# Note that the future of multi-arch handling may be even # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
# more complicated than that: http://wiki.debian.org/Multiarch # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
# See http://wiki.debian.org/Multiarch
if(CMAKE_SYSTEM_NAME MATCHES "Linux" if(CMAKE_SYSTEM_NAME MATCHES "Linux"
AND NOT CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING)
AND NOT EXISTS "/etc/debian_version") if (EXISTS "/etc/debian_version") # is this a debian system ?
if(NOT DEFINED CMAKE_SIZEOF_VOID_P) if(CMAKE_LIBRARY_ARCHITECTURE)
message(AUTHOR_WARNING set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " endif()
"Please enable at least one language before including GNUInstallDirs.") else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
else() if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") message(AUTHOR_WARNING
set(_LIBDIR_DEFAULT "lib64") "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() endif()
endif() endif()