diff options
author | Brad King <brad.king@kitware.com> | 2022-06-07 14:53:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-06-07 14:53:22 (GMT) |
commit | 4a7bb7b2550905efc20424490b293934f91e072d (patch) | |
tree | 9cde4eb6e94100ed8c9bf5d9e3ec9eb5b6234efa | |
parent | cf34dfeee9fb74cade92eb26522efc71510aed79 (diff) | |
parent | 8de50bae84aadbff8251b768ce108ed6b27e62d0 (diff) | |
download | CMake-4a7bb7b2550905efc20424490b293934f91e072d.zip CMake-4a7bb7b2550905efc20424490b293934f91e072d.tar.gz CMake-4a7bb7b2550905efc20424490b293934f91e072d.tar.bz2 |
Merge topic 'FindPython-interpreter-search-strategy'
8de50bae84 FindPython*: enhance interpreter lookup
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7330
-rw-r--r-- | Modules/FindPython/Support.cmake | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index cbb6c1c..8e98500 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -1248,9 +1248,18 @@ endif() # Python and Anaconda distributions: define which architectures can be used if (CMAKE_SIZEOF_VOID_P) - # In this case, search only for 64bit or 32bit math (EXPR _${_PYTHON_PREFIX}_ARCH "${CMAKE_SIZEOF_VOID_P} * 8") - set (_${_PYTHON_PREFIX}_ARCH2 ${_${_PYTHON_PREFIX}_ARCH}) + if ("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS + OR "Development.Embed" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) + # In this case, search only for 64bit or 32bit + set (_${_PYTHON_PREFIX}_ARCH2 ${_${_PYTHON_PREFIX}_ARCH}) + else() + if (_${_PYTHON_PREFIX}_ARCH EQUAL "32") + set (_${_PYTHON_PREFIX}_ARCH2 64) + else() + set (_${_PYTHON_PREFIX}_ARCH2 32) + endif() + endif() else() # architecture unknown, search for both 64bit and 32bit set (_${_PYTHON_PREFIX}_ARCH 64) |