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 ament_cmake_export_interfaces #22
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,12 @@ add_library(${PROJECT_NAME} SHARED | |
src/get_search_paths.cpp | ||
src/has_resource.cpp) | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE "AMENT_INDEX_CPP_BUILDING_DLL") | ||
target_include_directories(${PROJECT_NAME} PUBLIC include) | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" | ||
"$<INSTALL_INTERFACE:include>") | ||
|
||
ament_export_include_directories(include) | ||
ament_export_interfaces(export_${PROJECT_NAME}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even after reading the documentation for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The argument has to match an |
||
ament_export_libraries(${PROJECT_NAME}) | ||
|
||
if(BUILD_TESTING) | ||
|
@@ -38,6 +41,7 @@ install(DIRECTORY include/ | |
DESTINATION include) | ||
|
||
install(TARGETS ${PROJECT_NAME} | ||
EXPORT export_${PROJECT_NAME} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this necessary, given the code in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This install rule is being "identified" by the name |
||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? Does
$<INSTALL_INTERFACE:include>
even exist at build time of this target?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
BUILD_INTERFACE
is being used to build the library. TheINSTALL_INTERFACE
is being used when downstream packages try to link against this target. See https://cmake.org/cmake/help/v3.5/command/target_include_directories.html