diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-03-29 14:54:08 -0700 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-03-30 09:05:18 -0400 |
commit | 553b51e295e6b9e03108fdae26a17679f71992d2 (patch) | |
tree | e1e6a7ebb6d8fb5232713b18c1420422d7066c55 /CMakeLists.txt | |
parent | 557659bdc03b486f637e41c70a4a86a6f0a5d7ff (diff) |
cmake: Make numpy a first-class dependency for Python
Numpy was effectively a dependency, and GRC always required it. This
change simply moves the check for Numpy into the top-level CMake file
and adds a version (for now, 1.13.0). If numpy is not found,
ENABLE_PYTHON now defaults to OFF.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bed494ea5..79e829132a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ set(GR_SWIG_MIN_VERSION "3.0.8") set(GR_CMAKE_MIN_VERSION "3.5.1") set(GR_MAKO_MIN_VERSION "0.4.2") set(GR_PYTHON_MIN_VERSION "3.6.5") +set(GR_NUMPY_MIN_VERSION "1.13.0") set(GCC_MIN_VERSION "4.8.4") set(CLANG_MIN_VERSION "3.4.0") set(APPLECLANG_MIN_VERSION "500") @@ -330,6 +331,11 @@ include(GrBoost) ######################################################################## include(GrPython) GR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) +GR_PYTHON_CHECK_MODULE( + "numpy" + numpy + "LooseVersion(numpy.__version__) >= LooseVersion('${GR_NUMPY_MIN_VERSION}')" + NUMPY_FOUND) find_package(SWIG) if(SWIG_FOUND) @@ -346,6 +352,7 @@ GR_REGISTER_COMPONENT("python-support" ENABLE_PYTHON SWIG_FOUND SWIG_VERSION_CHECK SIX_FOUND + NUMPY_FOUND ) if(${CMAKE_BUILD_TYPE} STREQUAL "Coverage") |