summaryrefslogtreecommitdiffstats
path: root/Modules/FindPython/Support.cmake
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-06-25 12:45:29 (GMT)
committerBrad King <brad.king@kitware.com>2022-06-27 17:16:29 (GMT)
commitece3bedbf2cdc4857f19e2fceafa98a3f8002b4a (patch)
treeaf598733f02817680c8f8effb17bd5d0b0b6df7f /Modules/FindPython/Support.cmake
parent8c562ece28b7a13ddb734b8c51710ebafe9ac570 (diff)
downloadCMake-ece3bedbf2cdc4857f19e2fceafa98a3f8002b4a.zip
CMake-ece3bedbf2cdc4857f19e2fceafa98a3f8002b4a.tar.gz
CMake-ece3bedbf2cdc4857f19e2fceafa98a3f8002b4a.tar.bz2
FindPython: fix error on multiple queries with different COMPONENTS
Ensure that multiple queries with different COMPONENTS specified in different sub-directories are fully supported.
Diffstat (limited to 'Modules/FindPython/Support.cmake')
-rw-r--r--Modules/FindPython/Support.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 8e98500..c4fae6b 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -2861,7 +2861,8 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
endif()
unset (_${_PYTHON_PREFIX}_INCLUDE_HINTS)
- if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE)
+ if ("LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS
+ AND _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
# Use the library's install prefix as a hint
if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE MATCHES "^(.+/Frameworks/Python.framework/Versions/[0-9.]+)")
list (APPEND _${_PYTHON_PREFIX}_INCLUDE_HINTS "${CMAKE_MATCH_1}")
@@ -2945,7 +2946,8 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
if (_${_PYTHON_PREFIX}_INCLUDE_DIR)
# retrieve version from header file
_python_get_version (INCLUDE PREFIX _${_PYTHON_PREFIX}_INC_)
- if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE)
+ if ("LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS
+ AND _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
if ("${_${_PYTHON_PREFIX}_INC_VERSION_MAJOR}.${_${_PYTHON_PREFIX}_INC_VERSION_MINOR}"
VERSION_EQUAL _${_PYTHON_PREFIX}_VERSION)
# update versioning