Skip to content

Commit

Permalink
Target includes (#608)
Browse files Browse the repository at this point in the history
* Fix target properties for solver_eigen
* Add target includes for types

see #604
  • Loading branch information
RainerKuemmerle authored Oct 22, 2022
1 parent 5b454cd commit 54c143c
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 2 deletions.
4 changes: 2 additions & 2 deletions g2o/solvers/eigen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ endif()
target_link_libraries(solver_eigen core)

target_include_directories(solver_eigen PUBLIC
"$<BUILD_INTERFACE:${g2o_SOURCE_DIR};${PROJECT_BINARY_DIR}>"
$<INSTALL_INTERFACE:include/g2o/solver_eigen>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/solvers/eigen>
)

install(TARGETS solver_eigen
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ if(G2O_HAVE_OPENGL)
target_link_libraries(types_data freeglut_minimal opengl_helper)
endif()

target_include_directories(types_data PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/data>)

install(TARGETS types_data
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/icp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ if (APPLE)
endif()
target_link_libraries(types_icp types_sba types_slam3d)

target_include_directories(types_icp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/icp>)

install(TARGETS types_icp
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/sba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ if (APPLE)
endif()
target_link_libraries(types_sba core types_slam3d)

target_include_directories(types_sba PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/sba>)

install(TARGETS types_sba
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/sclam2d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if(G2O_HAVE_OPENGL)
target_link_libraries(types_sclam2d opengl_helper)
endif()

target_include_directories(types_sclam2d PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/sclam2d>)

install(TARGETS types_sclam2d
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/sim3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ if (APPLE)
endif()
target_link_libraries(types_sim3 PUBLIC types_sba)

target_include_directories(types_sim3 PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/sim3>)

install(TARGETS types_sim3
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/slam2d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ if(G2O_HAVE_OPENGL)
target_link_libraries(types_slam2d opengl_helper)
endif()

target_include_directories(types_slam2d PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/slam2d>)

install(TARGETS types_slam2d
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/slam2d_addons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ if(G2O_HAVE_OPENGL)
target_link_libraries(types_slam2d_addons opengl_helper)
endif()

target_include_directories(types_slam2d_addons PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/slam2d_addons>)

install(TARGETS types_slam2d_addons
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/slam3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ if(G2O_HAVE_OPENGL)
target_link_libraries(types_slam3d opengl_helper)
endif()

target_include_directories(types_slam3d PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/slam3d>)

install(TARGETS types_slam3d
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down
4 changes: 4 additions & 0 deletions g2o/types/slam3d_addons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ if(G2O_HAVE_OPENGL)
target_link_libraries(types_slam3d_addons opengl_helper)
endif()

target_include_directories(types_slam3d_addons PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/g2o/types/slam3d_addons>)

install(TARGETS types_slam3d_addons
EXPORT ${G2O_TARGETS_EXPORT_NAME}
RUNTIME DESTINATION ${RUNTIME_DESTINATION}
Expand Down

0 comments on commit 54c143c

Please sign in to comment.