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

Support exporting parameter libraries #28

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions generate_parameter_library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ cmake_minimum_required(VERSION 3.22)
project(generate_parameter_library NONE)

# find dependencies
find_package(ament_cmake_core REQUIRED)

ament_package(
CONFIG_EXTRAS "generate_parameter_library-extras.cmake"
)
find_package(ament_cmake REQUIRED)

install(
DIRECTORY cmake
Expand All @@ -20,3 +16,7 @@ if(BUILD_TESTING)
set(ament_cmake_uncrustify_FOUND TRUE) # Conflicts with clang-format
ament_lint_auto_find_test_dependencies()
endif()

ament_package(
CONFIG_EXTRAS "generate_parameter_library-extras.cmake"
)
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function(generate_parameter_library LIB_NAME YAML_FILE)
endif()

# Optional 3rd parameter for the user defined validation header
if (${ARGC} EQUAL 3)
if(${ARGC} EQUAL 3)
set(VALIDATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV2})
endif()

Expand All @@ -54,11 +54,18 @@ function(generate_parameter_library LIB_NAME YAML_FILE)
)

add_library(${LIB_NAME} ${PARAM_HEADER_FILE})
target_include_directories(${LIB_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}/include)
target_include_directories(${LIB_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}/include>
$<INSTALL_INTERFACE:include/>
)
set_target_properties(${LIB_NAME} PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(${LIB_NAME}
rclcpp::rclcpp
rclcpp_lifecycle::rclcpp_lifecycle
fmt::fmt
)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}/include/
DESTINATION include/
)
endfunction()
2 changes: 1 addition & 1 deletion generate_parameter_library/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<license>BSD-3-Clause</license>
<author email="paul.gesel@picknik.ai">Paul Gesel</author>

<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>
<buildtool_depend>ament_cmake</buildtool_depend>

<exec_depend>generate_parameter_library_py</exec_depend>

Expand Down