From 8de3983b4cd6d25fb056419c34cfcb7e050fdba6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 2 Jun 2022 09:58:32 -0400 Subject: GNUInstallDirs: Do not treat /opt/homebrew as under /opt Fixes: #23579 --- Modules/GNUInstallDirs.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() -- cgit v0.12