当前位置:网站首页>ament_ Cmake generates the ros2 library and links it
ament_ Cmake generates the ros2 library and links it
2022-07-26 05:56:00 【Fish flavored ROS】
cmake_minimum_required(VERSION 3.5)
project(arm_controller)
set(BUILD_TEST TRUE)
set(LIB_NAME libarmcore)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(comm_interfaces REQUIRED)
find_package(trajectory_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(spdlog REQUIRED)
include_directories(
include/
)
LINK_DIRECTORIES(
${
CMAKE_CURRENT_SOURCE_DIR}/libs
${
CMAKE_INSTALL_PREFIX}/lib
)
add_library(libarmcore SHARED
#interface
src/config/ArmConfigInterface.cpp
#jaka
# src/arm/ArmJaka.cpp
src/arm/ArmJakaTcp.cpp
src/arm/ArmLittleJakaTcp.cpp
src/arm/ArmTest.cpp
#pose
src/pose/Pose.cpp
#error
src/ArmErrors.cpp
#controller
src/arm/ArmController.cpp
#factory
src/ArmFactory.cpp
#tools
src/tools/YamlTool.cpp
src/tools/StringTool.cpp
src/tools/NetTool.cpp
#tcp
src/tools/tcp/client.cpp
src/tools/tcp/server.cpp
#log
src/ArmLogger.cpp
#python
src/Controller.cpp
)
target_include_directories(libarmcore PUBLIC
$<BUILD_INTERFACE:${
CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
ament_target_dependencies(libarmcore PUBLIC
${
Boost_LIBRARIES}
rclcpp
trajectory_msgs
geometry_msgs
comm_interfaces
)
#ament_export_targets(libarmcore HAS_LIBRARY_TARGET)
#ament_export_dependencies(rclcpp)
install(
DIRECTORY include/
DESTINATION include
)
install(
TARGETS libarmcore
EXPORT libarmcore
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
add_executable(${
PROJECT_NAME}
src/main.cpp
)
target_link_libraries(${
PROJECT_NAME}
libarmcore
jsoncpp
yaml-cpp
spdlog
)
ament_target_dependencies(${
PROJECT_NAME}
rclcpp
trajectory_msgs
geometry_msgs
rclcpp_action
comm_interfaces
)
install(TARGETS
${
PROJECT_NAME}
DESTINATION lib/${
PROJECT_NAME}
)
if (BUILD_TEST )
add_executable(test_${
PROJECT_NAME}
test/test.cpp
)
target_link_libraries(test_${
PROJECT_NAME}
libarmcore
jsoncpp
yaml-cpp
spdlog
)
ament_target_dependencies(test_${
PROJECT_NAME}
rclcpp
trajectory_msgs
geometry_msgs
rclcpp_action
comm_interfaces
)
install(TARGETS
test_${
PROJECT_NAME}
DESTINATION lib/${
PROJECT_NAME})
endif()
ament_package()
边栏推荐
- How can programmers improve mental internal friction?
- Mysql45 talking about infrastructure: how is an SQL query executed?
- Use of feign (Part 2)
- How to view the container name in pod
- Print linked list in reverse order
- 顺序查找,折半查找,分块查找 ~
- leetcode-aboutString
- Can you make a JS to get the verification code?
- Solution to slow download speed of vagrant
- [STM32 series summary] blogger's way to quickly advance STM32 in actual combat (continuous update)
猜你喜欢

Redis persistence AOF

Ros2 preliminary: basic communication with topic

102. (cesium chapter) cesium road streamer

二叉树的前中后序遍历——本质(每个节点都是“根”节点)

Etcd database source code analysis - cluster membership changes log

Solve vagrant's error b:48:in `join ': incompatible character encodings: GBK and UTF-8 (encoding:: Compatib

You'd better not take this kind of project!

Redis持久化-RDB

How can red star Macalline design cloud upgrade the traditional home furnishing industry in ten minutes to produce film and television level interior design effects

CANoe-XML在Test Modules中的应用
随机推荐
程序员如何改善精神内耗?
Acquisition of bidding information
L. Link with Level Editor I dp
对接微信支付(二)统一下单API
JDBC streaming query and cursor query
递归处理——子问题
Can you make a JS to get the verification code?
Mba-day29 arithmetic - preliminary understanding of absolute value
CANoe-XML在Test Modules中的应用
Mongodb tutorial Chapter 08 comparison operators
Unity2D 动画器无法 创建过渡
Qu Weihai, chairman and CEO of Xinyi interactive, adheres to mutual benefit and win-win results, and Qu Weihai promotes enterprise development
Solution to slow download speed of vagrant
leetcode-Array
Another open source artifact, worth collecting and learning!
金仓数据库 KingbaseES SQL 语言参考手册 (6. 表达式)
Redis持久化-RDB
I also found excellent software and hardware projects, all open source
【Oracle SQL】计算同比与环比(列转行进行偏移)
柠檬班自动化学习毕竟