Skip to content

Commit fadfd93

Browse files
committed
Try fixing ceres include issue
1 parent 0f74d66 commit fadfd93

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

fuse_core/CMakeLists.txt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ find_package(catkin REQUIRED COMPONENTS
1212
)
1313
find_package(Boost REQUIRED COMPONENTS serialization)
1414
find_package(Ceres REQUIRED)
15+
16+
17+
# Optional: print the imported target include dirs for sanity
18+
if(TARGET Ceres::ceres)
19+
get_target_property(CERES_INCLUDEDIRS Ceres::ceres INTERFACE_INCLUDE_DIRECTORIES)
20+
message(STATUS "Ceres::ceres INTERFACE include dirs: '${CERES_INCLUDEDIRS}'")
21+
else()
22+
message(WARNING "Ceres::ceres imported target not found; CERES_INCLUDEDIRS will be empty.")
23+
set(CERES_INCLUDEDIRS "")
24+
endif()
25+
26+
1527
find_package(Eigen3 REQUIRED)
1628
find_package(PkgConfig REQUIRED)
1729
pkg_check_modules(libglog REQUIRED)
@@ -23,7 +35,7 @@ message(STATUS "CERES_LIBRARIES='${CERES_LIBRARIES}'")
2335
catkin_package(
2436
INCLUDE_DIRS
2537
include
26-
${CERES_INCLUDE_DIRS}
38+
${CERES_INCLUDEDIRS}
2739
LIBRARIES
2840
${PROJECT_NAME}
2941
CATKIN_DEPENDS
@@ -78,15 +90,16 @@ target_include_directories(${PROJECT_NAME}
7890
SYSTEM PUBLIC
7991
${Boost_INCLUDE_DIRS}
8092
${catkin_INCLUDE_DIRS}
81-
${CERES_INCLUDE_DIRS}
8293
${EIGEN3_INCLUDE_DIRS}
8394
${GLOG_INCLUDE_DIRS}
8495
)
8596
target_link_libraries(${PROJECT_NAME}
86-
${Boost_LIBRARIES}
87-
${catkin_LIBRARIES}
88-
${CERES_LIBRARIES}
89-
${GLOG_LIBRARIES}
97+
PUBLIC
98+
Ceres::ceres
99+
${catkin_INCLUDE_DIRS}
100+
PRIVATE
101+
${Boost_LIBRARIES}
102+
${GLOG_LIBRARIES}
90103
)
91104
set_target_properties(${PROJECT_NAME}
92105
PROPERTIES

0 commit comments

Comments
 (0)