Skip to content

Commit

Permalink
[g2o] Fix suitesparse lookup and export (#37748)
Browse files Browse the repository at this point in the history
Ported from #37651.
  • Loading branch information
dg0yt committed Mar 27, 2024
1 parent 3f9e739 commit d0b3e8e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
32 changes: 32 additions & 0 deletions ports/g2o/csparse.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/cmake_modules/FindCSparse.cmake b/cmake_modules/FindCSparse.cmake
index 5af693d..8be574f 100644
--- a/cmake_modules/FindCSparse.cmake
+++ b/cmake_modules/FindCSparse.cmake
@@ -15,6 +15,8 @@ find_path(CSPARSE_INCLUDE_DIR NAMES cs.h
)

find_library(CSPARSE_LIBRARY NAMES cxsparse libcxsparse
+ cxsparsed libcxsparsed
+ NAMES_PER_DIR
PATHS
/usr/lib
/usr/local/lib
diff --git a/g2o/solvers/csparse/CMakeLists.txt b/g2o/solvers/csparse/CMakeLists.txt
index 60d1269..e6b80fc 100644
--- a/g2o/solvers/csparse/CMakeLists.txt
+++ b/g2o/solvers/csparse/CMakeLists.txt
@@ -2,13 +2,13 @@ if(NOT G2O_USE_CSPARSE)
return()
endif()

-include_directories(${CSPARSE_INCLUDE_DIR})

add_library(csparse_extension ${G2O_LGPL_LIB_TYPE}
csparse_helper.cpp csparse_helper.h
csparse_extension.cpp csparse_extension.h
g2o_csparse_extension_api.h
)
+target_include_directories(csparse_extension PUBLIC ${CSPARSE_INCLUDE_DIR})
set_target_properties(csparse_extension PROPERTIES OUTPUT_NAME ${LIB_PREFIX}csparse_extension)
if (APPLE)
set_target_properties(csparse_extension PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
2 changes: 2 additions & 0 deletions ports/g2o/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ vcpkg_from_github(
REF fcba4eaca6f20d9a5792404cc8ef303aeb8ba5d2
SHA512 41e5a6d40db10d66182653d56f937f29264bf4f9412dfa651be949caeb055741c9d9ba75a122180892aafe7d45b334d50470284121148c0561e1d49f6ba5e20a
HEAD_REF master
PATCHES
csparse.diff
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_LGPL_SHARED_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion ports/g2o/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "g2o",
"version-date": "2020-02-07",
"port-version": 4,
"port-version": 5,
"description": "g2o: A General Framework for Graph Optimization",
"homepage": "https://openslam.org/g2o.html",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2886,7 +2886,7 @@
},
"g2o": {
"baseline": "2020-02-07",
"port-version": 4
"port-version": 5
},
"g3log": {
"baseline": "2.4",
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": "dd362c97bd5a71ae6c3abad13da61b6323e8746f",
"version-date": "2020-02-07",
"port-version": 5
},
{
"git-tree": "fb61dcf5596f2a9212644c4ac8736831b7448ba5",
"version-date": "2020-02-07",
Expand Down

0 comments on commit d0b3e8e

Please sign in to comment.