From 32cf5db6eabca7d10101f0147b8c74297ece79dd Mon Sep 17 00:00:00 2001 From: Luc Grosheintz Date: Fri, 16 Feb 2024 15:24:16 +0100 Subject: [PATCH] fixup: tests for optional deps. --- cmake/HighFiveOptionalDependencies.cmake | 6 +++--- tests/unit/tests_high_five_easy.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmake/HighFiveOptionalDependencies.cmake b/cmake/HighFiveOptionalDependencies.cmake index 6b4422e71..1b27edd10 100644 --- a/cmake/HighFiveOptionalDependencies.cmake +++ b/cmake/HighFiveOptionalDependencies.cmake @@ -11,7 +11,7 @@ endif() if(NOT TARGET HighFiveEigenDependency) add_library(HighFiveEigenDependency INTERFACE) - if(HIGHFIVE_TEST_EIGEN AND NOT TARGET HighFiveEigenDependency) + if(HIGHFIVE_TEST_EIGEN) find_package(Eigen3 REQUIRED NO_MODULE) target_link_libraries(HighFiveEigenDependency INTERFACE Eigen3::Eigen) target_compile_definitions(HighFiveEigenDependency INTERFACE HIGHFIVE_TEST_EIGEN=1) @@ -20,7 +20,7 @@ endif() if(NOT TARGET HighFiveXTensorDependency) add_library(HighFiveXTensorDependency INTERFACE) - if(HIGHFIVE_TEST_XTENSOR AND NOT TARGET HighFiveXTensorDependency) + if(HIGHFIVE_TEST_XTENSOR) find_package(xtensor REQUIRED) target_link_libraries(HighFiveXTensorDependency INTERFACE xtensor) target_compile_definitions(HighFiveXTensorDependency INTERFACE HIGHFIVE_TEST_XTENSOR=1) @@ -29,7 +29,7 @@ endif() if(NOT TARGET HighFiveOpenCVDependency) add_library(HighFiveOpenCVDependency INTERFACE) - if(HIGHFIVE_TEST_OPENCV AND NOT TARGET HighFiveOpenCVDependency) + if(HIGHFIVE_TEST_OPENCV) find_package(OpenCV REQUIRED) target_include_directories(HighFiveOpenCVDependency SYSTEM INTERFACE ${OpenCV_INCLUDE_DIRS}) target_link_libraries(HighFiveOpenCVDependency INTERFACE ${OpenCV_LIBS}) diff --git a/tests/unit/tests_high_five_easy.cpp b/tests/unit/tests_high_five_easy.cpp index 16e64decc..067b035e3 100644 --- a/tests/unit/tests_high_five_easy.cpp +++ b/tests/unit/tests_high_five_easy.cpp @@ -20,13 +20,19 @@ #include -#include #ifdef HIGHFIVE_TEST_XTENSOR #include #include #endif +#ifdef HIGHFIVE_TEST_EIGEN +#include +#endif + + +#include + #include TEST_CASE("H5Easy_Compression") {