diff options
author | Brad King <brad.king@kitware.com> | 2020-12-08 15:17:54 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-08 15:18:29 (GMT) |
commit | 6412d17b4f13bb2b8a91b52e4f60717f6782db67 (patch) | |
tree | d6715d056ef0715a1f0a0898df2d0c9eddff79da /Modules | |
parent | 1cb30467a319a33dd6cda88832621670437b6852 (diff) | |
parent | afb0ffcac7852e1c2d7472ee914081e5eaf0cfe0 (diff) | |
download | CMake-6412d17b4f13bb2b8a91b52e4f60717f6782db67.zip CMake-6412d17b4f13bb2b8a91b52e4f60717f6782db67.tar.gz CMake-6412d17b4f13bb2b8a91b52e4f60717f6782db67.tar.bz2 |
Merge topic 'FindPython-python2-soabi-suffix-fix'
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 0e76468..0c775f7 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -456,7 +456,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() @@ -508,7 +512,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() |