This commit is contained in:
2026-01-05 10:52:41 +07:00
parent bb14979b8a
commit a93304418d

View File

@@ -104,7 +104,7 @@ endif()
# Installation (Standalone CMake only) # Installation (Standalone CMake only)
# ======================================================== # ========================================================
if(NOT BUILDING_WITH_CATKIN) # 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_xmlrpcpp install(TARGETS robot_xmlrpcpp
EXPORT robot_xmlrpcpp-targets EXPORT robot_xmlrpcpp-targets
ARCHIVE DESTINATION lib # Thư viện tĩnh .a ARCHIVE DESTINATION lib # Thư viện tĩnh .a
@@ -113,6 +113,7 @@ if(NOT BUILDING_WITH_CATKIN)
INCLUDES DESTINATION include # Cài đặt include INCLUDES DESTINATION include # Cài đặt include
) )
if(NOT BUILDING_WITH_CATKIN)
install( install(
DIRECTORY include/ DIRECTORY include/
DESTINATION include/ DESTINATION include/
@@ -124,4 +125,11 @@ if(NOT BUILDING_WITH_CATKIN)
NAMESPACE robot_xmlrpcpp:: NAMESPACE robot_xmlrpcpp::
DESTINATION lib/cmake/robot_xmlrpcpp DESTINATION lib/cmake/robot_xmlrpcpp
) )
else()
# Khi build với Catkin, vẫn cần export để các target khác có thể export
install(EXPORT robot_xmlrpcpp-targets
FILE robot_xmlrpcpp-targets.cmake
NAMESPACE robot_xmlrpcpp::
DESTINATION lib/cmake/robot_xmlrpcpp
)
endif() endif()