summaryrefslogtreecommitdiff
path: root/Modules/GNUInstallDirs.cmake
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2021-11-29 13:47:16 -0500
committerBrad King <brad.king@kitware.com>2021-11-30 10:51:33 -0500
commit7896991af029d66c9e1692ce18027fafaa0e9bd8 (patch)
treed6c3e2e6b54dfbce052a48ecdaf2cacff1d78be5 /Modules/GNUInstallDirs.cmake
parentff8c3acc0fbe037931680fc74b1a2d3f0af58c79 (diff)
downloadcmake-7896991af029d66c9e1692ce18027fafaa0e9bd8.tar.gz
GNUInstallDirs: Prefer system lib64 over conda lib when ambiguous
Update logic added by commit ecaca8c129 (GNUInstallDirs now aware of conda lib directory requirements, 2021-09-08, v3.22.0-rc1~142^2). When it is ambiguous if we are doing a conda install or a system install prefer using the system library directory. Fixes: #22962
Diffstat (limited to 'Modules/GNUInstallDirs.cmake')
-rw-r--r--Modules/GNUInstallDirs.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 6ca424ad5d..01bd63716c 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -253,7 +253,9 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set
elseif(DEFINED ENV{CONDA_PREFIX})
set(conda_prefix "$ENV{CONDA_PREFIX}")
cmake_path(ABSOLUTE_PATH conda_prefix NORMALIZE)
- if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix)
+ if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix AND
+ NOT ("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$" OR
+ "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/local/?$"))
set(__system_type_for_install "conda")
endif()
endif()