Skip to content

Commit

Permalink
Remove ament macros
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Aug 21, 2023
1 parent 6c13277 commit 7766376
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
38 changes: 17 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
cmake_minimum_required(VERSION 3.22)
project(rsl VERSION 0.2.1 LANGUAGES CXX DESCRIPTION "ROS Support Library")

include(GNUInstallDirs)

set(CMAKE_CXX_EXTENSIONS OFF)

find_package(ament_cmake_ros REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(fmt REQUIRED)
find_package(rclcpp REQUIRED)
Expand All @@ -20,10 +21,7 @@ add_library(rsl
)
add_library(rsl::rsl ALIAS rsl)
target_compile_features(rsl PUBLIC cxx_std_17)
target_include_directories(rsl PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/rsl>
)
target_include_directories(rsl PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
target_link_libraries(rsl PUBLIC
Eigen3::Eigen
fmt::fmt
Expand All @@ -34,31 +32,29 @@ target_link_libraries(rsl PUBLIC

add_subdirectory(docs)

if(BUILD_TESTING)
add_subdirectory(tests)
endif()

install(
DIRECTORY include/
DESTINATION include/rsl
)
install(
TARGETS rsl
EXPORT export_rsl
TARGETS rsl EXPORT rsl-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
INCLUDES DESTINATION include/rsl
)

ament_export_targets(export_rsl HAS_LIBRARY_TARGET)
ament_export_dependencies(
Eigen3
fmt
rclcpp
tcb_span
tl_expected
install(
EXPORT rsl-targets
NAMESPACE rsl::
DESTINATION ${CMAKE_INSTALL_DATADIR}
)
install(
FILES ${PROJECT_SOURCE_DIR}/cmake/rsl-config.cmake
DESTINATION ${CMAKE_INSTALL_DATADIR}
)
ament_package()

if(BUILD_TESTING)
add_subdirectory(tests)
endif()

add_custom_target(tidy COMMAND run-clang-tidy -p ${CMAKE_BINARY_DIR})
7 changes: 7 additions & 0 deletions cmake/rsl-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
find_dependency(Eigen3)
find_dependency(fmt)
find_dependency(rclcpp)
find_dependency(tcb_span)
find_dependency(tl_expected)

include(${CMAKE_CURRENT_LIST_DIR}/rsl-targets.cmake)

0 comments on commit 7766376

Please sign in to comment.