diff options
author | Brad King <brad.king@kitware.com> | 2022-04-22 12:58:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-04-22 12:59:09 (GMT) |
commit | 1bd85e8f3f57d4c279dcd2a3ea4c24a0cf3c5f58 (patch) | |
tree | 54736201fe3a5d967355197eb836a21f23d1ea5c /Modules | |
parent | 5e9c3e2f0734097aa7820a212723f8ef1ecb27a3 (diff) | |
parent | 42f7e397894c5132b4706f478e62ce5d648119c1 (diff) | |
download | CMake-1bd85e8f3f57d4c279dcd2a3ea4c24a0cf3c5f58.zip CMake-1bd85e8f3f57d4c279dcd2a3ea4c24a0cf3c5f58.tar.gz CMake-1bd85e8f3f57d4c279dcd2a3ea4c24a0cf3c5f58.tar.bz2 |
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.cmake | 10 | ||||
-rw-r--r-- | Modules/Platform/CrayLinuxEnvironment.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/UnixPaths.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/WindowsPaths.cmake | 1 |
4 files changed, 13 insertions, 0 deletions
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake index 0ded568..59f552a 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 f2aaf3f..b982b3f 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 b9381c3..8a0ad23 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 b9e2f17..de93338 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) |