diff options
author | Josh Morman <mormjb@gmail.com> | 2020-04-27 10:09:51 -0400 |
---|---|---|
committer | Josh Morman <mormjb@gmail.com> | 2020-06-04 10:05:48 -0400 |
commit | 9356302ff8894aad11202af42df8cf6096b241c5 (patch) | |
tree | 1b4cc87ea49724304cc320c30369443880fecc6b | |
parent | f29e6126e0fce0dff8dd6667fa93e2511c004f13 (diff) |
pybind: check version number, fail < 2.4
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f5cbde171..7e80428c7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ include(GrVersion) #setup version info # Minimum dependency versions for central dependencies: set(GR_BOOST_MIN_VERSION "1.53") -set(GR_PYBIND11_MIN_VERSION "2.4.3") set(GR_CMAKE_MIN_VERSION "3.5.1") set(GR_MAKO_MIN_VERSION "0.4.2") set(GR_PYTHON_MIN_VERSION "3.6.5") @@ -56,6 +55,7 @@ set(CLANG_MIN_VERSION "3.4.0") set(APPLECLANG_MIN_VERSION "500") set(MSVC_MIN_VERSION "1800") set(VOLK_MIN_VERSION "2.1.0") +set(PYBIND11_MIN_VERSION "2.4") # pybind11 sets versions like 2.4.dev4, which compares < 2.4.3 # Enable generation of compile_commands.json for code completion engines set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -346,6 +346,10 @@ GR_PYTHON_CHECK_MODULE( find_package(SWIG) find_package(pybind11 REQUIRED) +IF(${pybind11_VERSION} VERSION_LESS ${PYBIND11_MIN_VERSION}) + message(FATAL_ERROR "pybind11 version ${pybind11_VERSION} < ${PYBIND11_MIN_VERSION}") +ENDIF() + execute_process( COMMAND "${PYTHON_EXECUTABLE}" -c "from __future__ import print_function\ntry:\n import numpy\n import os\n inc_path = numpy.get_include()\n if os.path.exists(os.path.join(inc_path, 'numpy', 'arrayobject.h')):\n print(inc_path, end='')\nexcept:\n pass" |