File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -491,15 +491,9 @@ endif(MSVC)
491491set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } ${g2o_CXX_FLAGS} " )
492492set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS } ${g2o_C_FLAGS} " )
493493
494- # Find Eigen3. If it defines the target, this is used. If not,
495- # fall back to the using the module form.
494+ # Find Eigen3
496495# See https://eigen.tuxfamily.org/dox/TopicCMakeGuide.html for details
497- find_package (Eigen3 3.3 REQUIRED )
498- if (TARGET Eigen3::Eigen)
499- set (G2O_EIGEN3_EIGEN_TARGET Eigen3::Eigen)
500- else ()
501- include_directories (${EIGEN3_INCLUDE_DIR} )
502- endif ()
496+ find_package (Eigen3 REQUIRED NO_MODULE )
503497
504498# Generate config.h
505499set (G2O_OPENGL_FOUND ${OPENGL_FOUND} )
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ target_include_directories(benchmark_jacobian_timing PUBLIC
44 "$<BUILD_INTERFACE :${g2o_SOURCE_DIR } ;${g2o_BINARY_DIR } >"
55)
66
7- target_link_libraries (benchmark_jacobian_timing benchmark::benchmark ${G2O_EIGEN3_EIGEN_TARGET} )
7+ target_link_libraries (benchmark_jacobian_timing benchmark::benchmark Eigen3::Eigen )
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ set_target_properties(core PROPERTIES OUTPUT_NAME ${LIB_PREFIX}core)
5050set_target_properties (core PROPERTIES
5151 VERSION ${G2O_LIB_VERSION}
5252 SOVERSION ${G2O_LIB_SOVERSION} )
53- target_link_libraries (core PUBLIC stuff ${G2O_EIGEN3_EIGEN_TARGET} )
53+ target_link_libraries (core PUBLIC stuff Eigen3::Eigen )
5454target_link_libraries (core PUBLIC g2o_ceres_ad )
5555target_compile_features (core PUBLIC cxx_std_17 )
5656
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ target_include_directories(csparse_extension PUBLIC
1919 ${CSPARSE_INCLUDE_DIR}
2020 $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR } >
2121 $<INSTALL_INTERFACE :include /g2o /solvers /csparse >)
22- target_link_libraries (csparse_extension PUBLIC stuff ${CSPARSE_LIBRARY} ${G2O_EIGEN3_EIGEN_TARGET} )
22+ target_link_libraries (csparse_extension PUBLIC stuff ${CSPARSE_LIBRARY} Eigen3::Eigen )
2323
2424add_library (solver_csparse ${G2O_LIB_TYPE}
2525 solver_csparse.cpp
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ set_target_properties(stuff PROPERTIES
2828 VERSION ${G2O_LIB_VERSION}
2929 SOVERSION ${G2O_LIB_SOVERSION} )
3030target_compile_features (stuff PUBLIC cxx_std_17 )
31- target_link_libraries (stuff PUBLIC ${G2O_EIGEN3_EIGEN_TARGET} )
31+ target_link_libraries (stuff PUBLIC Eigen3::Eigen )
3232
3333if (APPLE )
3434 set_target_properties (stuff PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX } /${CMAKE_INSTALL_LIBDIR} " )
@@ -67,7 +67,7 @@ if(OPENGL_FOUND AND G2O_HAVE_OPENGL)
6767 $<INSTALL_INTERFACE :include /g2o /stuff >
6868 )
6969
70- target_link_libraries (opengl_helper PUBLIC ${G2O_OPENGL_TARGET} ${G2O_EIGEN3_EIGEN_TARGET} )
70+ target_link_libraries (opengl_helper PUBLIC ${G2O_OPENGL_TARGET} Eigen3::Eigen )
7171 target_compile_features (opengl_helper PUBLIC cxx_std_17 )
7272 set_target_properties (opengl_helper PROPERTIES OUTPUT_NAME "${LIB_PREFIX} opengl_helper" )
7373 set_target_properties (opengl_helper PROPERTIES
You can’t perform that action at this time.
0 commit comments