Skip to content

Commit

Permalink
export targets in a addition to include directories / libraries (ros2#10
Browse files Browse the repository at this point in the history
)

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
  • Loading branch information
dirk-thomas authored Apr 23, 2020
1 parent 0310b51 commit e2373a7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions urdf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ endif()

install(FILES ${generated_compat_header} DESTINATION include/${PROJECT_NAME})

include_directories(
include
${urdfdom_INCLUDE_DIRS}
${urdfdom_headers_INCLUDE_DIRS}
${TinyXML_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME} src/model.cpp)
target_link_libraries(${PROJECT_NAME} ${TinyXML_LIBRARIES} ${urdfdom_LIBRARIES})
target_include_directories(${PROJECT_NAME}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
ament_target_dependencies(${PROJECT_NAME}
urdfdom
urdfdom_headers
TinyXML)

if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE "URDF_BUILDING_DLL")
Expand All @@ -44,7 +45,7 @@ if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif()

install(TARGETS ${PROJECT_NAME}
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
Expand All @@ -67,6 +68,7 @@ if(BUILD_TESTING)
endif()

ament_export_libraries(${PROJECT_NAME})
ament_export_targets(${PROJECT_NAME})
ament_export_include_directories(include)
ament_export_dependencies(tinyxml_vendor)
ament_export_dependencies(TinyXML)
Expand Down

0 comments on commit e2373a7

Please sign in to comment.