diff options
author | Brad King <brad.king@kitware.com> | 2022-03-30 15:45:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-03-30 15:51:01 (GMT) |
commit | 624ec3692f91788d84f9dc2b08573286bdef2cc9 (patch) | |
tree | 74847719bd2f85cf3fb42b5c3bedb084bde289f0 | |
parent | 00677703d00f94702ef94d8dd07387c8405a3caf (diff) | |
download | CMake-624ec3692f91788d84f9dc2b08573286bdef2cc9.zip CMake-624ec3692f91788d84f9dc2b08573286bdef2cc9.tar.gz CMake-624ec3692f91788d84f9dc2b08573286bdef2cc9.tar.bz2 |
GNUInstallDirs: Revert "Apply Debian multiarch LIBDIR to more prefixes"
Revert commit dd9584b352 (GNUInstallDirs: Apply Debian multiarch LIBDIR
to more prefixes, 2021-11-19, v3.23.0-rc1~323^2). There are separate
problems with activating multiarch `LIBDIR` for each prefix it added:
* Prefix `/` is often used to stage an installation with `DESTDIR`
for inclusion in a tarball package or similar.
* Prefix `/usr/local` is the default `CMAKE_INSTALL_PREFIX`, causing
the multiarch `LIBDIR` to be cached after the first configuration,
even if the prefix changes later.
Revert the change for now, except for the documentation update.
Further discussion will be needed to select a way to enable
multiarch `LIBDIR` for `/` and `/usr/local`.
Fixes: #23365
Issue: #19698
-rw-r--r-- | Modules/GNUInstallDirs.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/Root-Debian-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/UsrLocal-Debian-stderr.txt | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index 4e7f87b..bd72901 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -55,7 +55,7 @@ where ``<dir>`` is one of: object code libraries (``lib`` or ``lib64``) On Debian, this may be ``lib/<multiarch-tuple>`` when - :variable:`CMAKE_INSTALL_PREFIX` is ``/``, ``/usr``, or ``/usr/local``. + :variable:`CMAKE_INSTALL_PREFIX` is ``/usr``. ``INCLUDEDIR`` C header files (``include``) ``OLDINCLUDEDIR`` @@ -273,9 +273,7 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set if(__system_type_for_install STREQUAL "debian") if(CMAKE_LIBRARY_ARCHITECTURE) - if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/" - OR "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$" - OR "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/local/?$") + if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$") set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}") endif() if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX diff --git a/Tests/RunCMake/GNUInstallDirs/Root-Debian-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Root-Debian-stderr.txt index 2019459..25f80d3 100644 --- a/Tests/RunCMake/GNUInstallDirs/Root-Debian-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/Root-Debian-stderr.txt @@ -4,7 +4,7 @@ CMAKE_INSTALL_DATAROOTDIR='usr/share' CMAKE_INSTALL_DOCDIR='usr/share/doc/Root' CMAKE_INSTALL_INCLUDEDIR='usr/include' CMAKE_INSTALL_INFODIR='usr/share/info' -CMAKE_INSTALL_LIBDIR='usr/lib/arch' +CMAKE_INSTALL_LIBDIR='usr/lib' CMAKE_INSTALL_LIBEXECDIR='usr/libexec' CMAKE_INSTALL_LOCALEDIR='usr/share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' @@ -19,7 +19,7 @@ CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/share' CMAKE_INSTALL_FULL_DOCDIR='/usr/share/doc/Root' CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/include' CMAKE_INSTALL_FULL_INFODIR='/usr/share/info' -CMAKE_INSTALL_FULL_LIBDIR='/usr/lib/arch' +CMAKE_INSTALL_FULL_LIBDIR='/usr/lib' CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var' diff --git a/Tests/RunCMake/GNUInstallDirs/UsrLocal-Debian-stderr.txt b/Tests/RunCMake/GNUInstallDirs/UsrLocal-Debian-stderr.txt index 0830138..30795c8 100644 --- a/Tests/RunCMake/GNUInstallDirs/UsrLocal-Debian-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/UsrLocal-Debian-stderr.txt @@ -4,7 +4,7 @@ CMAKE_INSTALL_DATAROOTDIR='share' CMAKE_INSTALL_DOCDIR='share/doc/UsrLocal' CMAKE_INSTALL_INCLUDEDIR='include' CMAKE_INSTALL_INFODIR='share/info' -CMAKE_INSTALL_LIBDIR='lib/arch' +CMAKE_INSTALL_LIBDIR='lib' CMAKE_INSTALL_LIBEXECDIR='libexec' CMAKE_INSTALL_LOCALEDIR='share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' @@ -19,7 +19,7 @@ CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/local/share' CMAKE_INSTALL_FULL_DOCDIR='/usr/local/share/doc/UsrLocal' CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/local/include' CMAKE_INSTALL_FULL_INFODIR='/usr/local/share/info' -CMAKE_INSTALL_FULL_LIBDIR='/usr/local/lib/arch' +CMAKE_INSTALL_FULL_LIBDIR='/usr/local/lib' CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/local/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/local/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/usr/local/var' |