Skip to content

Commit

Permalink
guards for dependency targets
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Dec 20, 2023
1 parent 719d75e commit cebcc73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmake/HighFiveOptionalDependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
if(HIGHFIVE_USE_BOOST)
if(HIGHFIVE_USE_BOOST AND 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).
endif()

if(HIGHFIVE_USE_EIGEN)
if(HIGHFIVE_USE_EIGEN AND NOT TARGET HighFiveEigenDependency)
add_library(HighFiveEigenDependency INTERFACE)
find_package(Eigen3 REQUIRED NO_MODULE)
target_link_libraries(HighFiveEigenDependency INTERFACE Eigen3::Eigen)
endif()

if(HIGHFIVE_USE_XTENSOR)
if(HIGHFIVE_USE_XTENSOR AND NOT TARGET HighFiveXTensorDependency)
add_library(HighFiveXTensorDependency INTERFACE)
find_package(xtensor REQUIRED)
target_link_libraries(HighFiveXTensorDependency INTERFACE xtensor)
endif()

if(HIGHFIVE_USE_OPENCV)
if(HIGHFIVE_USE_OPENCV AND NOT TARGET HighFiveOpenCVDependency)
add_library(HighFiveOpenCVDependency INTERFACE)
find_package(OpenCV REQUIRED)
target_include_directories(HighFiveOpenCVDependency SYSTEM INTERFACE ${OpenCV_INCLUDE_DIRS})
Expand Down

0 comments on commit cebcc73

Please sign in to comment.