summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-18 11:54:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-03-18 11:54:23 (GMT)
commit9abc99e90538d90634a14dd5349b3363f63d39c3 (patch)
tree3a77bb3cc7fa6395bc6ffc927ff5b5376d9f8494 /Modules
parentb145196bf28b484fd004704042fe8b11f772176a (diff)
parentcc7f116cb409236697c4a17e5ad012e7c2790ce5 (diff)
downloadCMake-9abc99e90538d90634a14dd5349b3363f63d39c3.zip
CMake-9abc99e90538d90634a14dd5349b3363f63d39c3.tar.gz
CMake-9abc99e90538d90634a14dd5349b3363f63d39c3.tar.bz2
Merge topic 'FindPython-version-validation-fix' into release-3.17
cc7f116cb4 FindPython: fix regression on version validation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4492
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPython/Support.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 32c5283..ce06458 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -316,7 +316,7 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME)
list (REMOVE_DUPLICATES _values)
elseif (NAME STREQUAL "SOABI")
# clean-up: remove prefix character and suffix
- string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\.(so|pyd))$" "\\1" _values "${_values}")
+ string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}")
endif()
endif()
endif()
@@ -357,7 +357,7 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME)
list (GET _soabi 1 _values)
if (_values)
# clean-up: remove prefix character and suffix
- string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\.(so|pyd))$" "\\1" _values "${_values}")
+ string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}")
endif()
endif()
endif()
@@ -527,8 +527,8 @@ function (_PYTHON_VALIDATE_INTERPRETER)
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
else()
# check that version is OK
- string(REGEX REPLACE "^([0-9]+)\." "\\1" major_version "${version}")
- string(REGEX REPLACE "^([0-9]+)\." "\\1" expected_major_version "${expected_version}")
+ string(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" major_version "${version}")
+ string(REGEX REPLACE "^([0-9]+)\\.?.*$" "\\1" expected_major_version "${expected_version}")
if (NOT major_version VERSION_EQUAL expected_major_version
OR NOT version VERSION_GREATER_EQUAL expected_version)
set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")