File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,29 @@ message(STATUS "xtensor-python v${${PROJECT_NAME}_VERSION}")
32
32
# Dependencies
33
33
# ============
34
34
35
- find_package (xtl REQUIRED )
36
- message (STATUS "Found xtl: ${xtl_INCLUDE_DIRS} /xtl" )
37
- find_package (xtensor REQUIRED )
38
- message (STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS} /xtensor" )
39
- find_package (pybind11 REQUIRED )
40
- message (STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS} /pybind11" )
35
+ set (xtensor_REQUIRED_VERSION 0.21.2 )
36
+ if (TARGET xtensor )
37
+ set (xtensor_VERSION ${XTENSOR_VERSION_MAJOR} .${XTENSOR_VERSION_MINOR}.${XTENSOR_VERSION_PATCH} )
38
+ # Note: This is not SEMVER compatible comparison
39
+ if ( NOT ${xtensor_VERSION} VERSION_GREATER_EQUAL ${xtensor_REQUIRED_VERSION} )
40
+ message (ERROR "Mismatch xtensor versions. Found '${xtensor_VERSION} ' but requires: '${xtensor_REQUIRED_VERSION} '" )
41
+ else ()
42
+ message (STATUS "Found xtensor v${xtensor_VERSION} " )
43
+ endif ()
44
+ else ()
45
+ find_package (xtensor ${xtensor_REQUIRED_VERSION} REQUIRED )
46
+ message (STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS} /xtensor" )
47
+ endif ()
48
+
49
+ # Currently no required version for pybind11
50
+ if (TARGET pybind11 )
51
+ # pybind11 has a variable that indicates its version already, so use that
52
+ message (STATUS "Found pybind11 v${pybind11_VERSION} " )
53
+ else ()
54
+ find_package (pybind11 REQUIRED )
55
+ message (STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS} /pybind11" )
56
+ endif ()
57
+
41
58
find_package (NumPy REQUIRED )
42
59
message (STATUS "Found numpy: ${NUMPY_INCLUDE_DIRS} " )
43
60
You can’t perform that action at this time.
0 commit comments