fix file cmake
This commit is contained in:
parent
12000dabcc
commit
f2e09018ce
|
|
@ -11,15 +11,6 @@ find_package(GTest REQUIRED)
|
||||||
# Finding Eigen3
|
# Finding Eigen3
|
||||||
find_package(Eigen3 REQUIRED)
|
find_package(Eigen3 REQUIRED)
|
||||||
|
|
||||||
if (NOT TARGET tf3)
|
|
||||||
add_subdirectory(/home/duongtd/robotics_core/tf3 ${CMAKE_BINARY_DIR}/tf3_build)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT TARGET geometry_msgs)
|
|
||||||
add_subdirectory(/home/duongtd/robotics_core/common_msgs/geometry_msgs ${CMAKE_BINARY_DIR}/geometry_msgs_build)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# Include directories
|
# Include directories
|
||||||
include_directories(
|
include_directories(
|
||||||
include
|
include
|
||||||
|
|
@ -36,8 +27,10 @@ install(DIRECTORY include/${PROJECT_NAME}/
|
||||||
add_library(tf3_geometry_msgs INTERFACE
|
add_library(tf3_geometry_msgs INTERFACE
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(tf3_geometry_msgs INTERFACE
|
target_include_directories(tf3_geometry_msgs
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
INTERFACE
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
|
|
||||||
# Liên kết với std_msgs nếu bạn có file Header.h trong include/std_msgs/
|
# Liên kết với std_msgs nếu bạn có file Header.h trong include/std_msgs/
|
||||||
|
|
@ -46,6 +39,26 @@ target_link_libraries(tf3_geometry_msgs INTERFACE
|
||||||
data_convert
|
data_convert
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# --- Cài đặt thư viện vào hệ thống khi chạy make install ---
|
||||||
|
install(TARGETS tf3_geometry_msgs
|
||||||
|
EXPORT tf3_geometry_msgs-targets
|
||||||
|
ARCHIVE DESTINATION lib # Thư viện tĩnh .a
|
||||||
|
LIBRARY DESTINATION lib # Thư viện động .so
|
||||||
|
RUNTIME DESTINATION bin # File thực thi (nếu có)
|
||||||
|
INCLUDES DESTINATION include # Cài đặt include
|
||||||
|
)
|
||||||
|
|
||||||
|
# --- Xuất export set tf3_geometry_msgs-targets thành file CMake module ---
|
||||||
|
# --- Tạo file lib/cmake/tf3_geometry_msgs/tf3_geometry_msgs-targets.cmake ---
|
||||||
|
# --- File này chứa cấu hình giúp project khác có thể dùng ---
|
||||||
|
# --- Find_package(tf3_geometry_msgs REQUIRED) ---
|
||||||
|
# --- Target_link_libraries(my_app PRIVATE tf3_geometry_msgs::tf3_geometry_msgs) ---
|
||||||
|
install(EXPORT tf3_geometry_msgs-targets
|
||||||
|
FILE tf3_geometry_msgs-targets.cmake
|
||||||
|
NAMESPACE tf3_geometry_msgs::
|
||||||
|
DESTINATION lib/cmake/tf3_geometry_msgs
|
||||||
|
)
|
||||||
|
|
||||||
# # Test: tomsg_frommsg
|
# # Test: tomsg_frommsg
|
||||||
add_executable(test_tomsg_frommsg test/test_tomsg_frommsg.cpp)
|
add_executable(test_tomsg_frommsg test/test_tomsg_frommsg.cpp)
|
||||||
target_link_libraries(test_tomsg_frommsg
|
target_link_libraries(test_tomsg_frommsg
|
||||||
|
|
|
||||||
|
|
@ -12,17 +12,6 @@ find_package(GTest REQUIRED)
|
||||||
# Finding Eigen3
|
# Finding Eigen3
|
||||||
find_package(Eigen3 REQUIRED)
|
find_package(Eigen3 REQUIRED)
|
||||||
|
|
||||||
if (NOT TARGET tf3)
|
|
||||||
add_subdirectory(/home/duongtd/robotics_core/tf3 ${CMAKE_BINARY_DIR}/tf3_build)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT TARGET sensor_msgs)
|
|
||||||
add_subdirectory(/home/duongtd/robotics_core/common_msgs/sensor_msgs ${CMAKE_BINARY_DIR}/sensor_msgs_build)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT TARGET geometry_msgs)
|
|
||||||
add_subdirectory(/home/duongtd/robotics_core/common_msgs/geometry_msgs ${CMAKE_BINARY_DIR}/geometry_msgs_build)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Include directories
|
# Include directories
|
||||||
include_directories(
|
include_directories(
|
||||||
|
|
@ -35,8 +24,10 @@ include_directories(
|
||||||
add_library(tf3_sensor_msgs INTERFACE
|
add_library(tf3_sensor_msgs INTERFACE
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(tf3_sensor_msgs INTERFACE
|
target_include_directories(tf3_sensor_msgs
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
INTERFACE
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(tf3_sensor_msgs INTERFACE
|
target_link_libraries(tf3_sensor_msgs INTERFACE
|
||||||
|
|
@ -44,6 +35,25 @@ target_link_libraries(tf3_sensor_msgs INTERFACE
|
||||||
data_convert
|
data_convert
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# --- Cài đặt thư viện vào hệ thống khi chạy make install ---
|
||||||
|
install(TARGETS tf3_sensor_msgs
|
||||||
|
EXPORT tf3_sensor_msgs-targets
|
||||||
|
ARCHIVE DESTINATION lib # Thư viện tĩnh .a
|
||||||
|
LIBRARY DESTINATION lib # Thư viện động .so
|
||||||
|
RUNTIME DESTINATION bin # File thực thi (nếu có)
|
||||||
|
INCLUDES DESTINATION include # Cài đặt include
|
||||||
|
)
|
||||||
|
|
||||||
|
# --- Xuất export set tf3_sensor_msgs-targets thành file CMake module ---
|
||||||
|
# --- Tạo file lib/cmake/tf3_sensor_msgs/tf3_sensor_msgs-targets.cmake ---
|
||||||
|
# --- File này chứa cấu hình giúp project khác có thể dùng ---
|
||||||
|
# --- Find_package(tf3_sensor_msgs REQUIRED) ---
|
||||||
|
# --- Target_link_libraries(my_app PRIVATE tf3_sensor_msgs::tf3_sensor_msgs) ---
|
||||||
|
install(EXPORT tf3_sensor_msgs-targets
|
||||||
|
FILE tf3_sensor_msgs-targets.cmake
|
||||||
|
NAMESPACE tf3_sensor_msgs::
|
||||||
|
DESTINATION lib/cmake/tf3_sensor_msgs
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(test_tf2_sensor_msgs test/test_tf2_sensor_msgs.cpp)
|
add_executable(test_tf2_sensor_msgs test/test_tf2_sensor_msgs.cpp)
|
||||||
target_include_directories(test_tf2_sensor_msgs PUBLIC
|
target_include_directories(test_tf2_sensor_msgs PUBLIC
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user