CMake: updated to support latest g2oConfig.cmake (using targets)

This commit is contained in:
matlabbe
2021-03-02 18:17:09 +00:00
parent ea4cc7cb6c
commit 4e4207a6dd
2 changed files with 27 additions and 5 deletions
+8 -1
View File
@@ -412,7 +412,14 @@ IF(WITH_G2O)
FIND_PACKAGE(G2O QUIET)
IF(G2O_FOUND)
MESSAGE(STATUS "Found g2o: ${G2O_INCLUDE_DIRS}")
ENDIF(G2O_FOUND)
ELSE()
FIND_PACKAGE(g2o QUIET)
IF(g2o_FOUND)
SET(G2O_FOUND ${g2o_FOUND})
SET(G2O_CPP11 1)
MESSAGE(STATUS "Found g2o (targets)")
ENDIF(g2o_FOUND)
ENDIF()
ENDIF(WITH_G2O)
IF(WITH_GTSAM)
+19 -4
View File
@@ -351,14 +351,29 @@ IF(WITH_TORO)
ENDIF(WITH_TORO)
IF(G2O_FOUND)
SET(INCLUDE_DIRS
IF(g2o_FOUND)
SET(LIBRARIES
${LIBRARIES}
g2o::core
g2o::solver_cholmod
g2o::solver_eigen
g2o::solver_pcg
g2o::solver_csparse
g2o::csparse_extension
g2o::types_slam2d
g2o::types_slam3d
g2o::types_sba
)
ELSE()
SET(INCLUDE_DIRS
${INCLUDE_DIRS}
${G2O_INCLUDE_DIRS}
)
SET(LIBRARIES
)
SET(LIBRARIES
${LIBRARIES}
${G2O_LIBRARIES}
)
)
ENDIF()
SET(SRC_FILES
${SRC_FILES}
optimizer/g2o/edge_se3_xyzprior.cpp