Skip to content

Commit

Permalink
Add a dependency on ceres.
Browse files Browse the repository at this point in the history
There is a dependency on ceres for downstream consumers
of sophus, so make sure to add it as an interface depend.
Also add it to the package.xml.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Jun 5, 2024
1 parent 3aaf007 commit b030469
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ if(NOT TARGET fmt::fmt)
find_package(fmt)
endif()

if(NOT TARGET Ceres::ceres)
find_package(Ceres REQUIRED)
endif()

# Define interface library target
add_library(sophus INTERFACE)
Expand Down Expand Up @@ -121,6 +124,9 @@ else()
message(STATUS "Turning basic logging OFF")
endif()

target_link_libraries(sophus INTERFACE Ceres::ceres)
set(Ceres_DEPENDENCY "find_dependency (Ceres ${Ceres_VERSION})")

# Associate target with include directory
target_include_directories(sophus INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
Expand Down
1 change: 1 addition & 0 deletions SophusConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ include (CMakeFindDependencyMacro)

@Eigen3_DEPENDENCY@
@fmt_DEPENDENCY@
@Ceres_DEPENDENCY@

include ("${CMAKE_CURRENT_LIST_DIR}/SophusTargets.cmake")
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

<build_depend>eigen</build_depend>
<build_export_depend>eigen</build_export_depend>
<build_export_depend>libceres-dev</build_export_depend>

<export>
<build_type>cmake</build_type>
Expand Down

0 comments on commit b030469

Please sign in to comment.