summaryrefslogtreecommitdiffstats
path: root/Modules/FindPython
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)
commit3c7774e2070da016cadfd3488e44f69c9238856b (patch)
tree7166fa9eda6eb5079b0b01e4ee16b6c37bd8e95c /Modules/FindPython
parent5a8eec41fc6c26f45526fedef18035fa09167758 (diff)
parentcc7f116cb409236697c4a17e5ad012e7c2790ce5 (diff)
downloadCMake-3c7774e2070da016cadfd3488e44f69c9238856b.zip
CMake-3c7774e2070da016cadfd3488e44f69c9238856b.tar.gz
CMake-3c7774e2070da016cadfd3488e44f69c9238856b.tar.bz2
Merge topic 'FindPython-version-validation-fix'
cc7f116cb4 FindPython: fix regression on version validation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4492
Diffstat (limited to 'Modules/FindPython')
-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 77b6562..a40d7f7 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -314,7 +314,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()
@@ -355,7 +355,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()
@@ -525,8 +525,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}\"")