summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-04-22 12:58:59 +0000
committerKitware Robot <kwrobot@kitware.com>2022-04-22 08:59:09 -0400
commit1bd85e8f3f57d4c279dcd2a3ea4c24a0cf3c5f58 (patch)
tree54736201fe3a5d967355197eb836a21f23d1ea5c /Modules
parent5e9c3e2f0734097aa7820a212723f8ef1ecb27a3 (diff)
parent42f7e397894c5132b4706f478e62ce5d648119c1 (diff)
downloadcmake-1bd85e8f3f57d4c279dcd2a3ea4c24a0cf3c5f58.tar.gz
Merge topic 'NO_CMAKE_INSTALL_PREFIX'
42f7e39789 Find: Support per call disabling of CMAKE_INSTALL_PREFIX Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7163
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeSystemSpecificInformation.cmake10
-rw-r--r--Modules/Platform/CrayLinuxEnvironment.cmake1
-rw-r--r--Modules/Platform/UnixPaths.cmake1
-rw-r--r--Modules/Platform/WindowsPaths.cmake1
4 files changed, 13 insertions, 0 deletions
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index 0ded568835..59f552ab42 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -17,6 +17,16 @@ set(CYGWIN )
set(MSYS )
set(WIN32 )
+function(_cmake_record_install_prefix )
+ set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_VALUE "${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE)
+ set(count 0)
+ foreach(value IN LISTS CMAKE_SYSTEM_PREFIX_PATH)
+ if(value STREQUAL CMAKE_INSTALL_PREFIX)
+ math(EXPR count "${count}+1")
+ endif()
+ endforeach()
+ set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_COUNT "${count}" PARENT_SCOPE)
+endfunction()
# include Generic system information
include(CMakeGenericSystem)
diff --git a/Modules/Platform/CrayLinuxEnvironment.cmake b/Modules/Platform/CrayLinuxEnvironment.cmake
index f2aaf3f710..b982b3f3cf 100644
--- a/Modules/Platform/CrayLinuxEnvironment.cmake
+++ b/Modules/Platform/CrayLinuxEnvironment.cmake
@@ -68,6 +68,7 @@ if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
)
endif()
endif()
+_cmake_record_install_prefix()
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
$ENV{SYSROOT_DIR}/usr/include/X11
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index b9381c3d7d..8a0ad23905 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -44,6 +44,7 @@ if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
)
endif()
endif()
+_cmake_record_install_prefix()
# Non "standard" but common install prefixes
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index b9e2f17979..de93338cf9 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -67,6 +67,7 @@ if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
)
endif()
endif()
+_cmake_record_install_prefix()
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
# MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)