summaryrefslogtreecommitdiffstats
path: root/Modules/FindPythonLibs.cmake
diff options
context:
space:
mode:
authorJuan Ramos <juan.ramos@kitware.com>2024-03-29 20:51:59 (GMT)
committerJuan Ramos <juan.ramos@kitware.com>2024-03-29 20:51:59 (GMT)
commit3cd64287fefd536561c155a0fbb1f549ab066d0e (patch)
treef8ad4a5d09c90dae7be0dec761f298fb330bfac8 /Modules/FindPythonLibs.cmake
parent2e3692bde08c071fdb00f201eaa6dc0116de436b (diff)
downloadCMake-3cd64287fefd536561c155a0fbb1f549ab066d0e.zip
CMake-3cd64287fefd536561c155a0fbb1f549ab066d0e.tar.gz
CMake-3cd64287fefd536561c155a0fbb1f549ab066d0e.tar.bz2
Modules: Fix CMP0159 warnings in modules when tracing
Closes: #25829
Diffstat (limited to 'Modules/FindPythonLibs.cmake')
-rw-r--r--Modules/FindPythonLibs.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index b13d96b..112adae 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -48,6 +48,9 @@ get the currently active Python version by default with a consistent version
of PYTHON_LIBRARIES.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
cmake_policy(GET CMP0148 _FindPythonLibs_CMP0148)
if(_FindPythonLibs_CMP0148 STREQUAL "NEW")
message(FATAL_ERROR "The FindPythonLibs module has been removed by policy CMP0148.")
@@ -55,6 +58,7 @@ endif()
if(_FindPythonLibs_testing)
set(_FindPythonLibs_included TRUE)
+ cmake_policy(POP)
return()
endif()
@@ -410,3 +414,5 @@ extern \"C\" {
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
endfunction()
+
+cmake_policy(POP)