summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-09-07 16:19:30 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-09-07 16:19:30 (GMT)
commit0670797d710aa7db856f0ffc7b0bc402b16c7c15 (patch)
tree5295bb8f31f48669e3ff6a8bbc925c9245b37632 /Modules
parentfff360c60c7e428054306fc0f02126ac7fd34410 (diff)
downloadCMake-0670797d710aa7db856f0ffc7b0bc402b16c7c15.zip
CMake-0670797d710aa7db856f0ffc7b0bc402b16c7c15.tar.gz
CMake-0670797d710aa7db856f0ffc7b0bc402b16c7c15.tar.bz2
FindPython: CMP0012 must be set to NEW
Fixes: #21168
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPython/Support.cmake12
1 files changed, 11 insertions, 1 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 6dd3b8e..42bb9fe 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -9,6 +9,9 @@
# Initial configuration
#
+cmake_policy(PUSH)
+# numbers and boolean constants
+cmake_policy (SET CMP0012 NEW)
# IN_LIST operator
cmake_policy (SET CMP0057 NEW)
@@ -44,7 +47,6 @@ macro (_PYTHON_DISPLAY_FAILURE _PYTHON_MSG)
set (${_PYTHON_PREFIX}_FOUND FALSE)
string (TOUPPER "${_PYTHON_PREFIX}" _${_PYTHON_PREFIX}_UPPER_PREFIX)
set (${_PYTHON_UPPER_PREFIX}_FOUND FALSE)
- return()
endmacro()
@@ -1022,6 +1024,9 @@ endfunction()
if (DEFINED ${_PYTHON_PREFIX}_FIND_VERSION_MAJOR
AND NOT ${_PYTHON_PREFIX}_FIND_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
_python_display_failure ("Could NOT find ${_PYTHON_PREFIX}: Wrong major version specified is \"${${_PYTHON_PREFIX}_FIND_VERSION_MAJOR}\", but expected major version is \"${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR}\"")
+
+ cmake_policy(POP)
+ return()
endif()
@@ -2962,6 +2967,9 @@ endif()
if (${_PYTHON_PREFIX}_VERSION_MAJOR AND
NOT ${_PYTHON_PREFIX}_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
_python_display_failure ("Could NOT find ${_PYTHON_PREFIX}: Found unsuitable major version \"${${_PYTHON_PREFIX}_VERSION_MAJOR}\", but required major version is exact version \"${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR}\"")
+
+ cmake_policy(POP)
+ return()
endif()
unset (_${_PYTHON_PREFIX}_REASON_FAILURE)
@@ -3170,3 +3178,5 @@ if (DEFINED _${_PYTHON_PREFIX}_CMAKE_FIND_FRAMEWORK)
else()
unset (CMAKE_FIND_FRAMEWORK)
endif()
+
+cmake_policy(POP)