diff options
author | Brad King <brad.king@kitware.com> | 2018-11-19 20:37:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-11-19 20:37:05 (GMT) |
commit | 3e1c361afa1c58b3c56a3253f8215dfaac2c0cc4 (patch) | |
tree | bd0aa7372a809e048e7647c96731c5f3063bac96 /Modules | |
parent | d3fa2e7400f4c7ce88c8fe762810bc379879444c (diff) | |
parent | c24f29c6647f70e6597dd35a1fe276279e019ad4 (diff) | |
download | CMake-3e1c361afa1c58b3c56a3253f8215dfaac2c0cc4.zip CMake-3e1c361afa1c58b3c56a3253f8215dfaac2c0cc4.tar.gz CMake-3e1c361afa1c58b3c56a3253f8215dfaac2c0cc4.tar.bz2 |
Merge branch 'FindPython-lib-arch' into release-3.13
Merge-request: !2624
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindPython/Support.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 5b1ed4b..e0ebb90 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -711,6 +711,23 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS if (NOT _${_PYTHON_PREFIX}_CONFIG) continue() endif() + if (DEFINED CMAKE_LIBRARY_ARCHITECTURE) + # check that config tool match library architecture + execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --configdir + RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT + OUTPUT_VARIABLE _${_PYTHON_PREFIX}_CONFIGDIR + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (_${_PYTHON_PREFIX}_RESULT) + unset (_${_PYTHON_PREFIX}_CONFIG CACHE) + continue() + endif() + string(FIND "${_${_PYTHON_PREFIX}_CONFIGDIR}" "${CMAKE_LIBRARY_ARCHITECTURE}" _${_PYTHON_PREFIX}_RESULT) + if (_${_PYTHON_PREFIX}_RESULT EQUAL -1) + unset (_${_PYTHON_PREFIX}_CONFIG CACHE) + continue() + endif() + endif() # retrieve root install directory execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --prefix |