From b27603b6a80546b72945de539146cbd33eeeb921 Mon Sep 17 00:00:00 2001 From: Tim Clephas Date: Tue, 18 Aug 2026 08:51:01 +0200 Subject: [PATCH 1/3] Patch support for Eigen5 Until https://github.com/strasdat/Sophus/pull/558 Signed-off-by: Tim Clephas --- beluga/CMakeLists.txt | 4 +++- beluga/cmake/Config.cmake.in | 2 +- beluga/cmake/LoadSophusTarget.cmake | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 beluga/cmake/LoadSophusTarget.cmake diff --git a/beluga/CMakeLists.txt b/beluga/CMakeLists.txt index 5c08a64223..e2cbcc537a 100644 --- a/beluga/CMakeLists.txt +++ b/beluga/CMakeLists.txt @@ -49,7 +49,7 @@ endif() find_package(Eigen3 REQUIRED NO_MODULE) find_package(HDF5 COMPONENTS CXX) find_package(range-v3 REQUIRED) -find_package(Sophus REQUIRED) +include(cmake/LoadSophusTarget.cmake) # Find package with Eigen5 support find_package(TBB REQUIRED) set(_deps @@ -118,6 +118,8 @@ install( NAMESPACE ${PROJECT_NAME}:: DESTINATION ${INSTALL_CMAKEDIR}) +install(FILES cmake/LoadSophusTarget.cmake DESTINATION ${INSTALL_CMAKEDIR}) + include(CMakePackageConfigHelpers) configure_package_config_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in diff --git a/beluga/cmake/Config.cmake.in b/beluga/cmake/Config.cmake.in index 8d7b0e44fe..619fdd4472 100644 --- a/beluga/cmake/Config.cmake.in +++ b/beluga/cmake/Config.cmake.in @@ -4,7 +4,7 @@ include(CMakeFindDependencyMacro) find_dependency(Eigen3 REQUIRED NO_MODULE) find_dependency(range-v3 REQUIRED) find_dependency(HDF5 COMPONENTS CXX REQUIRED) -find_dependency(Sophus REQUIRED) +include("${CMAKE_CURRENT_LIST_DIR}/LoadSophusTarget.cmake") # Find package with Eigen5 support find_dependency(TBB REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") diff --git a/beluga/cmake/LoadSophusTarget.cmake b/beluga/cmake/LoadSophusTarget.cmake new file mode 100644 index 0000000000..1d1506d544 --- /dev/null +++ b/beluga/cmake/LoadSophusTarget.cmake @@ -0,0 +1,23 @@ +# Copyright 2026 Ekumen, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file can be removed after https://github.com/strasdat/Sophus/pull/558 + +if(NOT TARGET Sophus::Sophus) + find_path( + Sophus_CMAKE_DIR + NAMES SophusTargets.cmake + PATH_SUFFIXES share/sophus/cmake REQUIRED) + include("${Sophus_CMAKE_DIR}/SophusTargets.cmake") +endif() From 13a138c633f27054efaac610b2c2da1118efeb20 Mon Sep 17 00:00:00 2001 From: Tim Clephas Date: Tue, 18 Aug 2026 09:36:01 +0200 Subject: [PATCH 2/3] Backward compatibility for older sophus Signed-off-by: Tim Clephas --- beluga/cmake/LoadSophusTarget.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/beluga/cmake/LoadSophusTarget.cmake b/beluga/cmake/LoadSophusTarget.cmake index 1d1506d544..4444b3a7ec 100644 --- a/beluga/cmake/LoadSophusTarget.cmake +++ b/beluga/cmake/LoadSophusTarget.cmake @@ -19,5 +19,6 @@ if(NOT TARGET Sophus::Sophus) Sophus_CMAKE_DIR NAMES SophusTargets.cmake PATH_SUFFIXES share/sophus/cmake REQUIRED) + find_package(fmt REQUIRED) include("${Sophus_CMAKE_DIR}/SophusTargets.cmake") endif() From 6b1b6a2b9ddb36f7c777b86a2eb403434c5e892c Mon Sep 17 00:00:00 2001 From: Tim Clephas Date: Tue, 18 Aug 2026 13:23:18 +0200 Subject: [PATCH 3/3] fixup! Backward compatibility for older sophus Signed-off-by: Tim Clephas --- beluga/CMakeLists.txt | 2 +- beluga/cmake/LoadSophusTarget.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/beluga/CMakeLists.txt b/beluga/CMakeLists.txt index e2cbcc537a..f2b65b51da 100644 --- a/beluga/CMakeLists.txt +++ b/beluga/CMakeLists.txt @@ -49,7 +49,7 @@ endif() find_package(Eigen3 REQUIRED NO_MODULE) find_package(HDF5 COMPONENTS CXX) find_package(range-v3 REQUIRED) -include(cmake/LoadSophusTarget.cmake) # Find package with Eigen5 support +include(cmake/LoadSophusTarget.cmake) # Find package with Eigen5 support find_package(TBB REQUIRED) set(_deps diff --git a/beluga/cmake/LoadSophusTarget.cmake b/beluga/cmake/LoadSophusTarget.cmake index 4444b3a7ec..178d0b0bb8 100644 --- a/beluga/cmake/LoadSophusTarget.cmake +++ b/beluga/cmake/LoadSophusTarget.cmake @@ -19,6 +19,7 @@ if(NOT TARGET Sophus::Sophus) Sophus_CMAKE_DIR NAMES SophusTargets.cmake PATH_SUFFIXES share/sophus/cmake REQUIRED) + find_package(Ceres REQUIRED) find_package(fmt REQUIRED) include("${Sophus_CMAKE_DIR}/SophusTargets.cmake") endif()