summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-08 15:13:43 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-08 15:13:48 (GMT)
commit0834b8b8cb616607d8425a5252e64dcc6592a5e1 (patch)
tree5295bb8f31f48669e3ff6a8bbc925c9245b37632
parentfff360c60c7e428054306fc0f02126ac7fd34410 (diff)
parent0670797d710aa7db856f0ffc7b0bc402b16c7c15 (diff)
downloadCMake-0834b8b8cb616607d8425a5252e64dcc6592a5e1.zip
CMake-0834b8b8cb616607d8425a5252e64dcc6592a5e1.tar.gz
CMake-0834b8b8cb616607d8425a5252e64dcc6592a5e1.tar.bz2
Merge topic 'FindPython-set-CMP0012-NEW' into release-3.18
0670797d71 FindPython: CMP0012 must be set to NEW Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5198
-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)