Hiep sua ten file
This commit is contained in:
35
robot_map_msgs/CMakeLists.txt
Normal file
35
robot_map_msgs/CMakeLists.txt
Normal file
@@ -0,0 +1,35 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(robot_map_msgs)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Thư viện header-only
|
||||
add_library(robot_map_msgs INTERFACE)
|
||||
|
||||
# Include path tới thư mục chứa file header
|
||||
target_include_directories(robot_map_msgs
|
||||
INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
# Liên kết với robot_std_msgs nếu bạn có file Header.h trong include/robot_std_msgs/
|
||||
target_link_libraries(robot_map_msgs INTERFACE robot_std_msgs)
|
||||
|
||||
# --- Cài đặt thư viện vào hệ thống khi chạy make install ---
|
||||
install(TARGETS robot_map_msgs
|
||||
EXPORT robot_map_msgs-targets
|
||||
INCLUDES DESTINATION include # Cài đặt include
|
||||
)
|
||||
|
||||
# --- Xuất export set costmap_2dTargets thành file CMake module ---
|
||||
# --- Tạo file lib/cmake/robot_map_msgs/costmap_2dTargets.cmake ---
|
||||
# --- File này chứa cấu hình giúp project khác có thể dùng ---
|
||||
# --- Find_package(robot_map_msgs REQUIRED) ---
|
||||
# --- Target_link_libraries(my_app PRIVATE robot_map_msgs::robot_map_msgs) ---
|
||||
install(EXPORT robot_map_msgs-targets
|
||||
FILE robot_map_msgs-targets.cmake
|
||||
NAMESPACE robot_map_msgs::
|
||||
DESTINATION lib/cmake/robot_map_msgs
|
||||
)
|
||||
Reference in New Issue
Block a user