-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CMake to run tests for optional dependencies. (#965)
- Loading branch information
Showing
9 changed files
with
75 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,48 @@ | ||
if(HIGHFIVE_TEST_BOOST AND NOT TARGET HighFiveBoostDependency) | ||
if(NOT TARGET HighFiveBoostDependency) | ||
add_library(HighFiveBoostDependency INTERFACE) | ||
find_package(Boost REQUIRED) | ||
target_link_libraries(HighFiveBoostDependency INTERFACE Boost::headers) | ||
# TODO check if we need Boost::disable_autolinking to cause: | ||
# -DBOOST_ALL_NO_LIB (does something on MSVC). | ||
if(HIGHFIVE_TEST_BOOST) | ||
find_package(Boost REQUIRED) | ||
target_link_libraries(HighFiveBoostDependency INTERFACE Boost::headers) | ||
# TODO check if we need Boost::disable_autolinking to cause: | ||
# -DBOOST_ALL_NO_LIB (does something on MSVC). | ||
target_compile_definitions(HighFiveBoostDependency INTERFACE HIGHFIVE_TEST_BOOST=1) | ||
endif() | ||
endif() | ||
|
||
if(HIGHFIVE_TEST_EIGEN AND NOT TARGET HighFiveEigenDependency) | ||
if(NOT TARGET HighFiveEigenDependency) | ||
add_library(HighFiveEigenDependency INTERFACE) | ||
find_package(Eigen3 REQUIRED NO_MODULE) | ||
target_link_libraries(HighFiveEigenDependency INTERFACE Eigen3::Eigen) | ||
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) | ||
endif() | ||
endif() | ||
|
||
if(HIGHFIVE_TEST_XTENSOR AND NOT TARGET HighFiveXTensorDependency) | ||
if(NOT TARGET HighFiveXTensorDependency) | ||
add_library(HighFiveXTensorDependency INTERFACE) | ||
find_package(xtensor REQUIRED) | ||
target_link_libraries(HighFiveXTensorDependency INTERFACE xtensor) | ||
if(HIGHFIVE_TEST_XTENSOR) | ||
find_package(xtensor REQUIRED) | ||
target_link_libraries(HighFiveXTensorDependency INTERFACE xtensor) | ||
target_compile_definitions(HighFiveXTensorDependency INTERFACE HIGHFIVE_TEST_XTENSOR=1) | ||
endif() | ||
endif() | ||
|
||
if(HIGHFIVE_TEST_OPENCV AND NOT TARGET HighFiveOpenCVDependency) | ||
if(NOT TARGET HighFiveOpenCVDependency) | ||
add_library(HighFiveOpenCVDependency INTERFACE) | ||
find_package(OpenCV REQUIRED) | ||
target_include_directories(HighFiveOpenCVDependency SYSTEM INTERFACE ${OpenCV_INCLUDE_DIRS}) | ||
target_link_libraries(HighFiveOpenCVDependency INTERFACE ${OpenCV_LIBS}) | ||
target_compile_definitions(HighFiveOpenCVDependency INTERFACE H5_USE_OPENCV) | ||
if(HIGHFIVE_TEST_OPENCV) | ||
find_package(OpenCV REQUIRED) | ||
target_include_directories(HighFiveOpenCVDependency SYSTEM INTERFACE ${OpenCV_INCLUDE_DIRS}) | ||
target_link_libraries(HighFiveOpenCVDependency INTERFACE ${OpenCV_LIBS}) | ||
target_compile_definitions(HighFiveOpenCVDependency INTERFACE HIGHFIVE_TEST_OPENCV=1) | ||
endif() | ||
endif() | ||
|
||
if(NOT TARGET HighFiveOptionalDependencies) | ||
add_library(HighFiveOptionalDependencies INTERFACE) | ||
target_link_libraries(HighFiveOptionalDependencies INTERFACE | ||
HighFiveBoostDependency | ||
HighFiveEigenDependency | ||
HighFiveXTensorDependency | ||
HighFiveOpenCVDependency | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters