summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-06-03 13:41:22 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-06-03 13:41:37 (GMT)
commitac2952792a34c338ea431dad019c60ab2a4375e8 (patch)
tree1abd7fe59d2fe48ee6a00c12f8fec2c28ee064fa /Modules
parent4efe43ea6fd1971898e986d47d8e357c551a36ae (diff)
parent8de3983b4cd6d25fb056419c34cfcb7e050fdba6 (diff)
downloadCMake-ac2952792a34c338ea431dad019c60ab2a4375e8.zip
CMake-ac2952792a34c338ea431dad019c60ab2a4375e8.tar.gz
CMake-ac2952792a34c338ea431dad019c60ab2a4375e8.tar.bz2
Merge topic 'GNUInstallDirs-opt-homebrew'
8de3983b4c GNUInstallDirs: Do not treat /opt/homebrew as under /opt Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7318
Diffstat (limited to 'Modules')
-rw-r--r--Modules/GNUInstallDirs.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index bd72901..9796854 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -112,6 +112,8 @@ The following values of :variable:`CMAKE_INSTALL_PREFIX` are special:
For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc/opt/...``.
This is defined by the `Filesystem Hierarchy Standard`_.
+ This behavior does not apply to paths under ``/opt/homebrew/...``.
+
.. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
Macros
@@ -400,7 +402,7 @@ macro(GNUInstallDirs_get_absolute_install_dir absvar var)
else()
set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
- elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/.*")
+ elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/" AND NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/homebrew/")
if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
set(${absvar} "/${${var}}${CMAKE_INSTALL_PREFIX}")
else()