summaryrefslogtreecommitdiffstats
path: root/Modules/FindPython/Support.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-01 16:00:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-01 16:02:07 (GMT)
commit6dbc12df684e146d15e9d5f9a68972f0a2196e10 (patch)
treeeb8e71ee3a1454cf9d07b93a28f122a9854e9e0e /Modules/FindPython/Support.cmake
parenta1709057ef6fa557d9106bac0da54899952d5cba (diff)
parent68c8201711b93b6db224318404b14e62e04b462d (diff)
downloadCMake-6dbc12df684e146d15e9d5f9a68972f0a2196e10.zip
CMake-6dbc12df684e146d15e9d5f9a68972f0a2196e10.tar.gz
CMake-6dbc12df684e146d15e9d5f9a68972f0a2196e10.tar.bz2
Merge topic 'FindPython-NumPy-fix-dependencies-management'
68c8201711 FindPython: NumPy: fix erroneous dependencies management Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3274
Diffstat (limited to 'Modules/FindPython/Support.cmake')
-rw-r--r--Modules/FindPython/Support.cmake22
1 files changed, 13 insertions, 9 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 0868989..8bd5eb3 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -321,9 +321,9 @@ unset (_${_PYTHON_PREFIX}_CACHED_VARS)
# first step, search for the interpreter
if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
+ list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_EXECUTABLE)
if (${_PYTHON_PREFIX}_FIND_REQUIRED_Interpreter)
list (APPEND _${_PYTHON_PREFIX}_REQUIRED_VARS ${_PYTHON_PREFIX}_EXECUTABLE)
- list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_EXECUTABLE)
endif()
set (_${_PYTHON_PREFIX}_HINTS "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR)
@@ -589,9 +589,9 @@ endif()
# second step, search for compiler (IronPython)
if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
+ list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_COMPILER)
if (${_PYTHON_PREFIX}_FIND_REQUIRED_Compiler)
list (APPEND _${_PYTHON_PREFIX}_REQUIRED_VARS ${_PYTHON_PREFIX}_COMPILER)
- list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_COMPILER)
endif()
# IronPython specific artifacts
@@ -700,15 +700,15 @@ endif()
## Development environment is not compatible with IronPython interpreter
if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
AND NOT ${_PYTHON_PREFIX}_INTERPRETER_ID STREQUAL "IronPython")
+ list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_LIBRARY
+ ${_PYTHON_PREFIX}_LIBRARY_RELEASE
+ ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
+ ${_PYTHON_PREFIX}_LIBRARY_DEBUG
+ ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG
+ ${_PYTHON_PREFIX}_INCLUDE_DIR)
if (${_PYTHON_PREFIX}_FIND_REQUIRED_Development)
list (APPEND _${_PYTHON_PREFIX}_REQUIRED_VARS ${_PYTHON_PREFIX}_LIBRARY
${_PYTHON_PREFIX}_INCLUDE_DIR)
- list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_LIBRARY
- ${_PYTHON_PREFIX}_LIBRARY_RELEASE
- ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
- ${_PYTHON_PREFIX}_LIBRARY_DEBUG
- ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG
- ${_PYTHON_PREFIX}_INCLUDE_DIR)
endif()
# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
@@ -1182,9 +1182,9 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
endif()
if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Interpreter_FOUND)
+ list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
if (${_PYTHON_PREFIX}_FIND_REQUIRED_NumPy)
list (APPEND _${_PYTHON_PREFIX}_REQUIRED_VARS ${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
- list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
endif()
execute_process(
COMMAND "${${_PYTHON_PREFIX}_EXECUTABLE}" -c
@@ -1213,6 +1213,10 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
set(${_PYTHON_PREFIX}_NumPy_VERSION "${_${_PYTHON_PREFIX}_NumPy_VERSION}")
endif()
endif()
+ # final step: set NumPy founded only if Development component is founded as well
+ if (NOT ${_PYTHON_PREFIX}_Development_FOUND)
+ set(${_PYTHON_PREFIX}_NumPy_FOUND FALSE)
+ endif()
endif()
# final validation