diff options
author | Brad King <brad.king@kitware.com> | 2020-12-07 15:38:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-07 15:38:23 (GMT) |
commit | 41ec2a4fac7d0ad7a3939ee0af479db838e943ee (patch) | |
tree | 61f9a161cf07d28bb10bc9323199e7d202832b0a | |
parent | 035a0c497a23efb4856ff82e1af183c1f808dd39 (diff) | |
parent | afb0ffcac7852e1c2d7472ee914081e5eaf0cfe0 (diff) | |
download | CMake-41ec2a4fac7d0ad7a3939ee0af479db838e943ee.zip CMake-41ec2a4fac7d0ad7a3939ee0af479db838e943ee.tar.gz CMake-41ec2a4fac7d0ad7a3939ee0af479db838e943ee.tar.bz2 |
Merge branch 'FindPython-python2-soabi-suffix-fix' into release-3.18
Merge-request: !5574
-rw-r--r-- | Modules/FindPython/Support.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index c8225c4..3732463 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -452,7 +452,11 @@ 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}") + if (_values MATCHES "^(\\.${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.so|\\.pyd)$") + set(_values "") + else() + string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}") + endif() endif() endif() endif() @@ -504,7 +508,11 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME) endforeach() if (_values) # clean-up: remove prefix character and suffix - string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}") + if (_values MATCHES "^(\\.${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.so|\\.pyd)$") + set(_values "") + else() + string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}") + endif() endif() endif() else() |