Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use modern cmake to fix compiling on ROS2 #96

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,16 @@ find_package(TinyXML2 REQUIRED)
# Set VERSION from package.xml
ament_package_xml()

include_directories(include ${rclcpp_INCLUDE_DIRS}
${rmw_implementation_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
${urdfdom_headers_INCLUDE_DIRS}
${urdf_INCLUDE_DIRS}
${std_msgs_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME} SHARED
src/model.cpp
src/srdf_writer.cpp
)
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${${PROJECT_NAME}_VERSION})

target_include_directories(${PROJECT_NAME}
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
# Ament dependencies
ament_target_dependencies(${PROJECT_NAME} PUBLIC
TinyXML2
Expand All @@ -47,10 +42,10 @@ ament_target_dependencies(${PROJECT_NAME} PUBLIC
)

install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
JafarAbdi marked this conversation as resolved.
Show resolved Hide resolved
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION include/${PROJECT_NAME}
Expand Down Expand Up @@ -90,8 +85,7 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()
endif()

ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_export_targets(${PROJECT_NAME}Targets HAS_LIBRARY_TARGET)
JafarAbdi marked this conversation as resolved.
Show resolved Hide resolved
ament_export_dependencies(console_bridge)
ament_export_dependencies(urdfdom_headers)
ament_export_dependencies(urdf)
Expand Down