Browse Source

Merge topic 'GNUInstallDirs-conda-fix'

7896991af0 GNUInstallDirs: Prefer system lib64 over conda lib when ambiguous

Acked-by: Kitware Robot <[email protected]>
Merge-request: !6773
Brad King 4 years ago
parent
commit
6f05012126
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Modules/GNUInstallDirs.cmake

+ 3 - 1
Modules/GNUInstallDirs.cmake

@@ -255,7 +255,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()