diff options
author | Brad King <brad.king@kitware.com> | 2020-12-08 15:17:54 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-08 10:18:28 -0500 |
commit | 61cd587ef3dce2019984a8b8ea726f09a0c8c751 (patch) | |
tree | 5db5db890f699533b9b440ec3d45aaf9decd49d7 /Modules | |
parent | d00d5ac0cdf14c9622c1db01e37958dc075bd67e (diff) | |
parent | afb0ffcac7852e1c2d7472ee914081e5eaf0cfe0 (diff) | |
download | cmake-61cd587ef3dce2019984a8b8ea726f09a0c8c751.tar.gz |
Merge topic 'FindPython-python2-soabi-suffix-fix' into release-3.19
afb0ffcac7 FindPython2: avoid doubling the extension in CPython2 SOABI
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5574
Diffstat (limited to 'Modules')
-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 028ce082ec..79b1d18434 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -453,7 +453,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() @@ -505,7 +509,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() |