update
This commit is contained in:
parent
32c034225f
commit
fb03bdf2e8
|
|
@ -23,14 +23,36 @@ install(TARGETS robot_protocol_msgs
|
||||||
INCLUDES DESTINATION include # Cài đặt include
|
INCLUDES DESTINATION include # Cài đặt include
|
||||||
)
|
)
|
||||||
|
|
||||||
# --- Xuất export set robot_costmap_2dTargets thành file CMake module ---
|
# --- Cài đặt headers ---
|
||||||
# --- Tạo file lib/cmake/robot_protocol_msgs/robot_costmap_2dTargets.cmake ---
|
install(DIRECTORY include/
|
||||||
|
DESTINATION include
|
||||||
|
FILES_MATCHING PATTERN "*.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
# --- Xuất export set robot_protocol_msgs-targets thành file CMake module ---
|
||||||
|
# --- Tạo file lib/cmake/robot_protocol_msgs/robot_protocol_msgs-targets.cmake ---
|
||||||
# --- File này chứa cấu hình giúp project khác có thể dùng ---
|
# --- File này chứa cấu hình giúp project khác có thể dùng ---
|
||||||
# --- Find_package(robot_protocol_msgs REQUIRED) ---
|
# --- Find_package(robot_protocol_msgs REQUIRED) ---
|
||||||
# --- Target_link_libraries(my_app PRIVATE robot_protocol_msgs::robot_protocol_msgs) ---
|
# --- Target_link_libraries(my_app PRIVATE robot_protocol_msgs::robot_protocol_msgs) ---
|
||||||
install(EXPORT robot_protocol_msgs-targets
|
install(EXPORT robot_protocol_msgs-targets
|
||||||
FILE robot_protocol_msgs-targets.cmake
|
FILE robot_protocol_msgs-targets.cmake
|
||||||
NAMESPACE robot_protocol_msgs::
|
# NAMESPACE robot_protocol_msgs::
|
||||||
|
DESTINATION lib/cmake/robot_protocol_msgs
|
||||||
|
)
|
||||||
|
|
||||||
|
# ========================================================
|
||||||
|
# Install CMake Config File for find_package()
|
||||||
|
# ========================================================
|
||||||
|
# Generate config file from template
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/robot_protocol_msgsConfig.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/robot_protocol_msgsConfig.cmake
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
# Install config file
|
||||||
|
install(FILES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/robot_protocol_msgsConfig.cmake
|
||||||
DESTINATION lib/cmake/robot_protocol_msgs
|
DESTINATION lib/cmake/robot_protocol_msgs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
20
robot_protocol_msgs/robot_protocol_msgsConfig.cmake.in
Normal file
20
robot_protocol_msgs/robot_protocol_msgsConfig.cmake.in
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
# robot_protocol_msgsConfig.cmake
|
||||||
|
# CMake configuration file for robot_protocol_msgs package
|
||||||
|
|
||||||
|
# Get the directory containing this file
|
||||||
|
get_filename_component(robot_protocol_msgs_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
|
||||||
|
# Include the targets file
|
||||||
|
include("${robot_protocol_msgs_CMAKE_DIR}/robot_protocol_msgs-targets.cmake")
|
||||||
|
|
||||||
|
# Set variables for compatibility
|
||||||
|
set(robot_protocol_msgs_FOUND TRUE)
|
||||||
|
set(robot_protocol_msgs_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include")
|
||||||
|
set(robot_protocol_msgs_LIBRARIES robot_protocol_msgs)
|
||||||
|
|
||||||
|
# Check if all required components are available
|
||||||
|
if(NOT TARGET robot_protocol_msgs)
|
||||||
|
set(robot_protocol_msgs_FOUND FALSE)
|
||||||
|
message(FATAL_ERROR "robot_protocol_msgs target not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user