Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions fuse_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,29 @@ find_package(catkin REQUIRED COMPONENTS
)
find_package(Boost REQUIRED COMPONENTS serialization)
find_package(Ceres REQUIRED)

if(TARGET Ceres::ceres)
get_target_property(CERES_INCLUDEDIRS Ceres::ceres INTERFACE_INCLUDE_DIRECTORIES)

if("${CERES_INCLUDEDIRS}" STREQUAL "CERES_INCLUDEDIRS-NOTFOUND")
message(STATUS "Ceres::ceres INTERFACE_INCLUDE_DIRS not found; CERES_INCLUDEDIRS will be empty")
set(CERES_INCLUDEDIRS, "")
else()
message(STATUS "Ceres::ceres INTERFACE_INCLUDE_DIRS: '${CERES_INCLUDEDIRS}'")
endif()
else()
message(WARNING "Ceres::ceres imported target not found; CERES_INCLUDEDIRS will be empty.")
set(CERES_INCLUDEDIRS "")
endif()

find_package(Eigen3 REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(libglog REQUIRED)

catkin_package(
INCLUDE_DIRS
include
${CERES_INCLUDEDIRS}
LIBRARIES
${PROJECT_NAME}
CATKIN_DEPENDS
Expand Down Expand Up @@ -73,15 +89,17 @@ target_include_directories(${PROJECT_NAME}
SYSTEM PUBLIC
${Boost_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
${CERES_INCLUDEDIRS}
${EIGEN3_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME}
${Boost_LIBRARIES}
${catkin_LIBRARIES}
${CERES_LIBRARIES}
${GLOG_LIBRARIES}
PUBLIC
Ceres::ceres
${catkin_LIBRARIES}
PRIVATE
${Boost_LIBRARIES}
${GLOG_LIBRARIES}
)
set_target_properties(${PROJECT_NAME}
PROPERTIES
Expand Down
Loading