Skip to content

Commit

Permalink
[g2o] Update to 20230806_git (#42600)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwang118 authored Dec 12, 2024
1 parent 0e49ef4 commit 1bf729f
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 41 deletions.
32 changes: 0 additions & 32 deletions ports/g2o/csparse.diff

This file was deleted.

12 changes: 12 additions & 0 deletions ports/g2o/fix-absolute.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3b6ab5..f050970 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -496,7 +496,6 @@ set(G2O_PROJECT_CONFIG "${G2O_GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
set(G2O_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
set(G2O_CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
set(G2O_NAMESPACE "${PROJECT_NAME}::")
-set(G2O_SRC_DIR "${PROJECT_SOURCE_DIR}")
set(G2O_VERSION 1.0.0)

include(CMakePackageConfigHelpers)
7 changes: 4 additions & 3 deletions ports/g2o/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
string(REPLACE "-" "" GIT_TAG "${VERSION}_git")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO RainerKuemmerle/g2o
REF fcba4eaca6f20d9a5792404cc8ef303aeb8ba5d2
SHA512 41e5a6d40db10d66182653d56f937f29264bf4f9412dfa651be949caeb055741c9d9ba75a122180892aafe7d45b334d50470284121148c0561e1d49f6ba5e20a
REF "${GIT_TAG}"
SHA512 626b4d286b564ca6714957d0caf41cf5387ecbc7100299c1a1134fa4a11a340f6e6e0796fa5ff16229032a1e1e384bc03e7d2c118be39d6d51a20d9f2774a98d
HEAD_REF master
PATCHES
csparse.diff
fix-absolute.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_LGPL_SHARED_LIBS)
Expand Down
3 changes: 1 addition & 2 deletions ports/g2o/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "g2o",
"version-date": "2020-02-07",
"port-version": 6,
"version-date": "2023-08-06",
"description": "g2o: A General Framework for Graph Optimization",
"homepage": "https://openslam.org/g2o.html",
"dependencies": [
Expand Down
57 changes: 57 additions & 0 deletions ports/rtabmap/fix-find-g2o.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5957a50..829a268 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -473,30 +473,7 @@ IF(WITH_DC1394)
ENDIF(WITH_DC1394)

IF(WITH_G2O)
- FIND_PACKAGE(g2o NO_MODULE)
- IF(g2o_FOUND)
- MESSAGE(STATUS "Found g2o (targets)")
- SET(G2O_FOUND ${g2o_FOUND})
- get_target_property(G2O_INCLUDES g2o::core INTERFACE_INCLUDE_DIRECTORIES)
- MESSAGE(STATUS "g2o include dir: ${G2O_INCLUDES}")
- FIND_FILE(G2O_FACTORY_FILE g2o/core/factory.h
- PATHS ${G2O_INCLUDES}
- NO_DEFAULT_PATH)
- FILE(READ ${G2O_FACTORY_FILE} TMPTXT)
- STRING(FIND "${TMPTXT}" "shared_ptr" matchres)
- IF(${matchres} EQUAL -1)
- MESSAGE(STATUS "Old g2o factory version detected without shared ptr (factory file: ${G2O_FACTORY_FILE}).")
- SET(G2O_CPP11 2)
- ELSE()
- MESSAGE(STATUS "Latest g2o factory version detected with shared ptr (factory file: ${G2O_FACTORY_FILE}).")
- SET(G2O_CPP11 1)
- ENDIF()
- ELSE()
- FIND_PACKAGE(G2O QUIET)
- IF(G2O_FOUND)
- MESSAGE(STATUS "Found g2o: ${G2O_INCLUDE_DIRS}")
- ENDIF(G2O_FOUND)
- ENDIF()
+ find_package(g2o CONFIG REQUIRED)
ENDIF(WITH_G2O)

IF(WITH_GTSAM)
diff --git a/corelib/src/CMakeLists.txt b/corelib/src/CMakeLists.txt
index c85acc1..d071f79 100644
--- a/corelib/src/CMakeLists.txt
+++ b/corelib/src/CMakeLists.txt
@@ -392,12 +392,10 @@ ENDIF(WITH_TORO)
IF(G2O_FOUND)
IF(g2o_FOUND)
SET(LIBRARIES ${LIBRARIES}
- g2o::core
- g2o::solver_eigen
- g2o::solver_pcg
- g2o::types_slam2d
- g2o::types_slam3d
- g2o::types_sba)
+ g2o::core
+ g2o::stuff
+ g2o::types_icp
+ g2o::types_sba)
IF(TARGET g2o::solver_csparse)
SET(LIBRARIES ${LIBRARIES}
g2o::solver_csparse
1 change: 1 addition & 0 deletions ports/rtabmap/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ vcpkg_from_github(
multi-definition.patch
rtabmap-res-tool.patch
gklib.patch
fix-find-g2o.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion ports/rtabmap/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rtabmap",
"version": "0.21.4.1",
"port-version": 2,
"port-version": 3,
"description": "Real-Time Appearance-Based Mapping",
"homepage": "https://introlab.github.io/rtabmap/",
"license": null,
Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2993,8 +2993,8 @@
"port-version": 2
},
"g2o": {
"baseline": "2020-02-07",
"port-version": 6
"baseline": "2023-08-06",
"port-version": 0
},
"g3log": {
"baseline": "2.4",
Expand Down Expand Up @@ -8050,7 +8050,7 @@
},
"rtabmap": {
"baseline": "0.21.4.1",
"port-version": 2
"port-version": 3
},
"rtabmap-res-tool": {
"baseline": "0.21.4.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/g2o.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "be30b61ad0d13087804bc474abea6673ba269a20",
"version-date": "2023-08-06",
"port-version": 0
},
{
"git-tree": "dcf90e398d2940de9be1685b435cc4314f348125",
"version-date": "2020-02-07",
Expand Down
5 changes: 5 additions & 0 deletions versions/r-/rtabmap.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9bab9b050ad5e8db991955d2905f95cc5ce4a1ff",
"version": "0.21.4.1",
"port-version": 3
},
{
"git-tree": "1161d6eb7dacc4aa2cff53381126c89c87f30fe0",
"version": "0.21.4.1",
Expand Down

0 comments on commit 1bf729f

Please sign in to comment.