update hieplm
This commit is contained in:
@@ -4,6 +4,31 @@ project(robot_std_msgs)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# ========================================================
|
||||
# Catkin specific configuration
|
||||
# ========================================================
|
||||
if(DEFINED CATKIN_DEVEL_PREFIX OR DEFINED CATKIN_TOPLEVEL)
|
||||
set(BUILDING_WITH_CATKIN TRUE)
|
||||
message(STATUS "Building robot_std_msgs with Catkin")
|
||||
else()
|
||||
set(BUILDING_WITH_CATKIN FALSE)
|
||||
message(STATUS "Building robot_std_msgs with Standalone CMake")
|
||||
endif()
|
||||
|
||||
if(BUILDING_WITH_CATKIN)
|
||||
find_package(catkin REQUIRED COMPONENTS robot_time)
|
||||
|
||||
## The catkin_package macro generates cmake config files for your package
|
||||
## Note: Dependencies (robot_time, etc.) are not Catkin packages,
|
||||
## they are built as CMake targets in the same workspace and will be available
|
||||
## when this package is built. They are linked via target_link_libraries instead of CATKIN_DEPENDS
|
||||
catkin_package(
|
||||
INCLUDE_DIRS include
|
||||
LIBRARIES robot_std_msgs
|
||||
CATKIN_DEPENDS robot_time
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(robot_std_msgs INTERFACE)
|
||||
|
||||
target_include_directories(robot_std_msgs
|
||||
@@ -15,11 +40,20 @@ target_include_directories(robot_std_msgs
|
||||
target_link_libraries(robot_std_msgs INTERFACE robot_time)
|
||||
|
||||
# --- Cài đặt thư viện vào hệ thống khi chạy make install ---
|
||||
# Export target trong mọi trường hợp để các target khác có thể export và phụ thuộc vào nó
|
||||
install(TARGETS robot_std_msgs
|
||||
EXPORT robot_std_msgs-targets
|
||||
INCLUDES DESTINATION include # Cài đặt include
|
||||
)
|
||||
|
||||
if(NOT BUILDING_WITH_CATKIN)
|
||||
# Install headers for standalone mode
|
||||
install(DIRECTORY include/
|
||||
DESTINATION include
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
)
|
||||
endif()
|
||||
|
||||
# --- Xuất export set robot_std_msgs-targets thành file CMake module ---
|
||||
# --- Tạo file lib/cmake/robot_std_msgs/robot_std_msgs-targets.cmake ---
|
||||
# --- File này chứa cấu hình giúp project khác có thể dùng ---
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
<buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>
|
||||
|
||||
<build_depend>libconsole-bridge-dev</build_depend>
|
||||
|
||||
<run_depend>libconsole-bridge-dev</run_depend>
|
||||
<build_depend>robot_time</build_depend>
|
||||
|
||||
<run_depend>robot_time</run_depend>
|
||||
|
||||
</package>
|
||||
Reference in New Issue
Block a user