File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,19 @@ message(STATUS "xtensor-blas v${${PROJECT_NAME}_VERSION}")
4444# Dependencies
4545# ============
4646
47- find_package (xtensor 0.23 REQUIRED)
48- message (STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS} /xtensor" )
47+ set (xtensor_REQUIRED_VERSION 0.23.0)
48+ if (TARGET xtensor)
49+ set (xtensor_VERSION ${XTENSOR_VERSION_MAJOR} .${XTENSOR_VERSION_MINOR} .${XTENSOR_VERSION_PATCH} )
50+ # Note: This is not SEMVER compatible comparison
51+ if ( NOT ${xtensor_VERSION} VERSION_GREATER_EQUAL ${xtensor_REQUIRED_VERSION} )
52+ message (ERROR "Mismatch xtensor versions. Found '${xtensor_VERSION} ' but requires: '${xtensor_REQUIRED_VERSION} '" )
53+ else ()
54+ message (STATUS "Found xtensor v${xtensor_VERSION} " )
55+ endif ()
56+ else ()
57+ find_package (xtensor ${xtensor_REQUIRED_VERSION} REQUIRED)
58+ message (STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS} /xtensor" )
59+ endif ()
4960
5061# Build
5162# =====
You can’t perform that action at this time.
0 commit comments