-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
With #213 it is straightforward to use a complete cpp library within another package. But how can I use a custom_validator file from a different package?
Is there a smarter way to include the file from here to another library than
find_package(control_toolbox)
# get include dirs from control_toolbox for the custom validators
get_target_property(TB_INCLUDE_DIRS control_toolbox::rate_limiter_parameters INTERFACE_INCLUDE_DIRECTORIES)
generate_parameter_library(diff_drive_controller_parameters
src/diff_drive_controller_parameter.yaml
${TB_INCLUDE_DIRS}/control_toolbox/custom_validators.hpp
)
@AugusteBourgois any suggestions?
Changing the macro here to avoid a COPY but just use the correct include path control_toolbox/custom_validators.hpp
?
generate_parameter_library/generate_parameter_library/cmake/generate_parameter_library.cmake
Lines 42 to 54 in 891c291
if(${ARGC} EQUAL 3) | |
cmake_path(SET IN_VALIDATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}) | |
cmake_path(APPEND IN_VALIDATE_HEADER ${ARGV2}) | |
cmake_path(GET IN_VALIDATE_HEADER FILENAME VALIDATE_HEADER_FILENAME) | |
cmake_path(SET VALIDATE_HEADER ${LIB_INCLUDE_DIR}) | |
cmake_path(APPEND VALIDATE_HEADER ${VALIDATE_HEADER_FILENAME}) | |
# Copy the header file into the include directory | |
file(COPY ${IN_VALIDATE_HEADER} DESTINATION ${LIB_INCLUDE_DIR}) | |
# necessary so that #include <param_file.hpp> can be used in the local package (deprecated) | |
file(COPY ${IN_VALIDATE_HEADER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include) | |
endif() |
Metadata
Metadata
Assignees
Labels
No labels