diff --git a/CMakeLists.txt b/CMakeLists.txt index e1bd077..312ccd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,13 +45,18 @@ else() find_package(xtensor ${xtensor_REQUIRED_VERSION} REQUIRED) message(STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS}/xtensor") endif() - -# Currently no required version for pybind11 + +# Running find_package(PythonInterp) to retrieve the Python version +# which is not exported by Pybind11's cmake. +# Cf. https://github.com/pybind/pybind11/issues/2268 +find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED) + +set(pybind11_REQUIRED_VERSION 2.6.1) if(TARGET pybind11 OR TARGET pybind11::headers) # pybind11 has a variable that indicates its version already, so use that message(STATUS "Found pybind11 v${pybind11_VERSION}") else() - find_package(pybind11 REQUIRED) + find_package(pybind11 ${pybind11_REQUIRED_VERSION} REQUIRED) message(STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS}/pybind11") endif() diff --git a/environment-dev.yml b/environment-dev.yml index d9fbd45..9eca6e7 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -6,9 +6,9 @@ dependencies: - cmake - ninja # Host dependencies - - xtensor=0.24.0 + - xtensor>=0.24,<0.25 - numpy - - pybind11=2.4.3 + - pybind11>=2.6.1,<3 # Test dependencies - pytest