cmake_minimum_required(VERSION 3.10)
项目名称project(ros_cpp_node)
编译选项add_compile_options(-std=c++17)
搜索系统包,一般ros的包都在这里添加find_package(
rclcpp REQUIRED
)
include_directories(
include
${rclcpp_INCLUDE_DIRS}
)
aux_source_directory(${PROJECT_SOURCE_DIR} SOURCE)
设置可执行文件名,并指定源文件add_executable(ros_cpp_node
${SOURCE}
)
target_link_libraries(ros_cpp_node
${rclcpp_LIBRARIES}
)