diff --git a/CMakeLists.txt b/CMakeLists.txt index 433b76e8..1bc5f1cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 "$" diff --git a/SophusConfig.cmake.in b/SophusConfig.cmake.in index e8283eda..8256bf94 100644 --- a/SophusConfig.cmake.in +++ b/SophusConfig.cmake.in @@ -4,5 +4,6 @@ include (CMakeFindDependencyMacro) @Eigen3_DEPENDENCY@ @fmt_DEPENDENCY@ +@Ceres_DEPENDENCY@ include ("${CMAKE_CURRENT_LIST_DIR}/SophusTargets.cmake") diff --git a/package.xml b/package.xml index 1242b5fe..6e62299b 100644 --- a/package.xml +++ b/package.xml @@ -36,6 +36,7 @@ eigen eigen + libceres-dev cmake