File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,18 @@ find_package(catkin REQUIRED COMPONENTS
1212)
1313find_package (Boost REQUIRED COMPONENTS serialization)
1414find_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+
1527find_package (Eigen3 REQUIRED)
1628find_package (PkgConfig REQUIRED)
1729pkg_check_modules(libglog REQUIRED)
@@ -23,7 +35,7 @@ message(STATUS "CERES_LIBRARIES='${CERES_LIBRARIES}'")
2335catkin_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)
8596target_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)
91104set_target_properties (${PROJECT_NAME}
92105 PROPERTIES
You can’t perform that action at this time.
0 commit comments