diff options
author | Brad King <brad.king@kitware.com> | 2018-11-20 14:25:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-11-20 14:25:48 (GMT) |
commit | fc366d25946f7434527658475835d1e587cea4ea (patch) | |
tree | d98def113598994a42ce336ee6d0a2ffd69cf05f /Modules | |
parent | 4b94f3420c78e1bb7aa1324973e3ec76ba765c27 (diff) | |
parent | c24f29c6647f70e6597dd35a1fe276279e019ad4 (diff) | |
download | CMake-fc366d25946f7434527658475835d1e587cea4ea.zip CMake-fc366d25946f7434527658475835d1e587cea4ea.tar.gz CMake-fc366d25946f7434527658475835d1e587cea4ea.tar.bz2 |
Merge topic 'FindPython-lib-arch'
c24f29c664 FindPython: Ensure config tool matches library architecture
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Eric Noulard <eric.noulard@gmail.com>
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 |