57 lines
1.6 KiB
Text
57 lines
1.6 KiB
Text
|
cmake_minimum_required(VERSION 3.8)
|
||
|
project(env_interface)
|
||
|
|
||
|
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
||
|
endif()
|
||
|
|
||
|
set(INCLUDE_DEPENDS
|
||
|
rclcpp_lifecycle
|
||
|
)
|
||
|
|
||
|
# find dependencies
|
||
|
find_package(ament_cmake REQUIRED)
|
||
|
foreach(Dependency IN LISTS INCLUDE_DEPENDS)
|
||
|
find_package(${Dependency} REQUIRED)
|
||
|
endforeach()
|
||
|
|
||
|
add_library(${PROJECT_NAME} SHARED
|
||
|
src/env_interface_base.cpp)
|
||
|
|
||
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||
|
$<INSTALL_INTERFACE:include/env_interface>
|
||
|
)
|
||
|
|
||
|
ament_target_dependencies(${PROJECT_NAME} PUBLIC ${INCLUDE_DEPENDS})
|
||
|
|
||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE "ENVIROMENT_INTERFACE_BUILDING_DLL")
|
||
|
|
||
|
if(BUILD_TESTING)
|
||
|
find_package(ament_lint_auto REQUIRED)
|
||
|
# the following line skips the linter which checks for copyrights
|
||
|
# comment the line when a copyright and license is added to all source files
|
||
|
set(ament_cmake_copyright_FOUND TRUE)
|
||
|
# the following line skips cpplint (only works in a git repo)
|
||
|
# comment the line when this package is in a git repo and when
|
||
|
# a copyright and license is added to all source files
|
||
|
set(ament_cmake_cpplint_FOUND TRUE)
|
||
|
ament_lint_auto_find_test_dependencies()
|
||
|
endif()
|
||
|
|
||
|
install(
|
||
|
DIRECTORY include/
|
||
|
DESTINATION include/env_interface
|
||
|
)
|
||
|
install(TARGETS ${PROJECT_NAME}
|
||
|
EXPORT export_${PROJECT_NAME}
|
||
|
ARCHIVE DESTINATION lib
|
||
|
LIBRARY DESTINATION lib
|
||
|
RUNTIME DESTINATION bin
|
||
|
)
|
||
|
|
||
|
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
|
||
|
ament_export_dependencies(${INCLUDE_DEPENDS})
|
||
|
|
||
|
ament_package()
|