Skip to content

Commit

Permalink
export dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
felixf4xu committed Sep 13, 2023
1 parent a919157 commit a8aaaf5
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ At least **C++14** is required.
Besides [Catkin](https://catkin-tools.readthedocs.io/en/latest/index.html), the dependencies are
* `Boost` (from 1.58)
* `eigen3`
* [`mrt_cmake_modules`](https://github.com/KIT-MRT/mrt_cmake_modules), a CMake helper library
* `pugixml` (for lanelet2_io)
* `boost-python, python2 or python3` (for lanelet2_python)
* `geographiclib` (for lanelet2_projection)
Expand Down
8 changes: 6 additions & 2 deletions lanelet2_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ target_include_directories(${PROJECT_NAME}
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

find_package(Boost REQUIRED COMPONENTS polygon)
find_package(Eigen3 REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen)
target_link_libraries(${PROJECT_NAME} PUBLIC
Eigen3::Eigen
Boost::polygon
)

#############
## Install ##
Expand Down Expand Up @@ -71,4 +75,4 @@ if(BUILD_TESTING)
endforeach()
endif()

ament_package()
ament_package(CONFIG_EXTRAS "cmake/ConfigExtras.cmake")
1 change: 1 addition & 0 deletions lanelet2_core/cmake/ConfigExtras.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find_package(Boost REQUIRED COMPONENTS polygon)
1 change: 0 additions & 1 deletion lanelet2_examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ find_package(lanelet2_traffic_rules REQUIRED)
foreach(SUBFOLDER IN LISTS SUBFOLDERS)
if(IS_DIRECTORY ${SUBFOLDER})
get_filename_component(SUBFOLDER_NAME ${SUBFOLDER} NAME)
message("Subfolder: ${SUBFOLDER_NAME}")
add_executable(${SUBFOLDER_NAME}
src/${SUBFOLDER_NAME}/main.cpp
)
Expand Down
3 changes: 2 additions & 1 deletion lanelet2_io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ install(
)
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(lanelet2_core)
ament_export_dependencies(pugixml)

#############
## Testing ##
Expand All @@ -80,4 +81,4 @@ if(BUILD_TESTING)
endforeach()
endif()

ament_package()
ament_package(CONFIG_EXTRAS "cmake/ConfigExtras.cmake")
2 changes: 2 additions & 0 deletions lanelet2_io/cmake/ConfigExtras.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
find_package(Boost REQUIRED COMPONENTS filesystem serialization)

6 changes: 2 additions & 4 deletions lanelet2_projection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ project(lanelet2_projection)
## Find packages ##
###################
find_package(ament_cmake REQUIRED)
find_package(PkgConfig)
find_path(GeographicLib INCLUDE_DIR GeographicLib/config.h
PATH_SUFFIXES GeographicLib
)
find_package(GeographicLib REQUIRED)

############################
## Read source code files ##
Expand Down Expand Up @@ -52,6 +49,7 @@ install(
RUNTIME DESTINATION bin
)
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(GeographicLib)

#############
## Testing ##
Expand Down

0 comments on commit a8aaaf5

Please sign in to comment.