77 lines
2 KiB
CMake
77 lines
2 KiB
CMake
cmake_minimum_required(VERSION 3.8)
|
|
project(env_manager)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
|
endif()
|
|
|
|
set(INCLUDE_DEPENDS
|
|
rclcpp
|
|
rclcpp_lifecycle
|
|
env_manager_interfaces
|
|
pluginlib
|
|
env_interface
|
|
)
|
|
|
|
# find dependencies
|
|
find_package(ament_cmake REQUIRED)
|
|
foreach(Dep IN ITEMS ${INCLUDE_DEPENDS})
|
|
find_package(${Dep} REQUIRED)
|
|
endforeach()
|
|
# uncomment the following section in order to fill in
|
|
# further dependencies manually.
|
|
# find_package(<dependency> REQUIRED)
|
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} SHARED
|
|
src/env_manager.cpp
|
|
)
|
|
target_include_directories(${PROJECT_NAME} PRIVATE include)
|
|
ament_target_dependencies(${PROJECT_NAME} ${INCLUDE_DEPENDS})
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE "ENVIRONMENT_MANAGER_BUILDING_DLL")
|
|
|
|
add_executable(run_env_manager src/run_env_manager.cpp)
|
|
target_include_directories(run_env_manager PRIVATE include)
|
|
target_link_libraries(run_env_manager ${PROJECT_NAME})
|
|
ament_target_dependencies(run_env_manager ${INCLUDE_DEPENDS})
|
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
RUNTIME DESTINATION bin
|
|
LIBRARY DESTINATION lib
|
|
ARCHIVE DESTINATION lib
|
|
)
|
|
|
|
install(TARGETS run_env_manager
|
|
RUNTIME DESTINATION lib/${PROJECT_NAME}
|
|
)
|
|
|
|
install(DIRECTORY include/
|
|
DESTINATION include
|
|
)
|
|
|
|
|
|
|
|
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()
|
|
|
|
ament_export_libraries(
|
|
${PROJECT_NAME}
|
|
)
|
|
ament_export_include_directories(
|
|
include
|
|
)
|
|
ament_export_dependencies(
|
|
${INCLUDE_DEPENDS}
|
|
)
|
|
|
|
ament_package()
|