summaryrefslogtreecommitdiffstats
path: root/Modules/FindPython
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2024-12-02 16:37:18 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2024-12-02 16:37:18 (GMT)
commitff65c5fca05ad11c564b2e193205f44b65376b6d (patch)
tree29e94f48a04d585a623bb2fd3d35385f89e2bcff /Modules/FindPython
parent27647acc6ca9c7e207478ec548ec7e12c4fbef8c (diff)
downloadCMake-ff65c5fca05ad11c564b2e193205f44b65376b6d.zip
CMake-ff65c5fca05ad11c564b2e193205f44b65376b6d.tar.gz
CMake-ff65c5fca05ad11c564b2e193205f44b65376b6d.tar.bz2
FindPython: Ensure SABIModule is found in all cases
Fixes: #26493
Diffstat (limited to 'Modules/FindPython')
-rw-r--r--Modules/FindPython/Support.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index e0bdbc5..c741ec1 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -3464,14 +3464,15 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
endif()
# finalize library version information
- _python_get_version (SABI_LIBRARY PREFIX _${_PYTHON_PREFIX}_)
# ABI library does not have the full version information
- if (${_PYTHON_PREFIX}_Interpreter_FOUND OR _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
- # update from interpreter or library
+ if (${_PYTHON_PREFIX}_Interpreter_FOUND AND NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
+ # update from interpreter
set (_${_PYTHON_PREFIX}_VERSION ${${_PYTHON_PREFIX}_VERSION})
set (_${_PYTHON_PREFIX}_VERSION_MAJOR ${${_PYTHON_PREFIX}_VERSION_MAJOR})
set (_${_PYTHON_PREFIX}_VERSION_MINOR ${${_PYTHON_PREFIX}_VERSION_MINOR})
set (_${_PYTHON_PREFIX}_VERSION_PATCH ${${_PYTHON_PREFIX}_VERSION_PATCH})
+ elseif(NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
+ _python_get_version (SABI_LIBRARY PREFIX _${_PYTHON_PREFIX}_)
endif()
set (${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE "${_${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE}")