This commit is contained in:
HiepLM 2026-01-05 10:52:57 +07:00
parent 7f05ee86a0
commit a471130273
4 changed files with 20 additions and 38 deletions

View File

@ -146,9 +146,9 @@ if (NOT TARGET move_base)
endif()
# C API for .NET/C# integration
# if (NOT TARGET navigation_c_api)
# add_subdirectory(${CMAKE_SOURCE_DIR}/src/APIs/c_api)
# endif()
if (NOT TARGET navigation_c_api)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/APIs/c_api)
endif()
message(STATUS "========================================")
message(STATUS "All packages configured successfully")

View File

@ -173,6 +173,10 @@ target_include_directories(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME}
PUBLIC
${YAML_CPP_TARGET}
robot_xmlrpcpp
robot_time
PRIVATE
dl # Required for dladdr() function used in plugin_loader_helper.cpp
)
# Check if we're using static library and warn user
@ -186,29 +190,6 @@ if(YAML_CPP_TARGET MATCHES "\\.a$" OR YAML_CPP_TARGET MATCHES "libyaml-cpp\\.a")
)
endif()
# console_bridge: use library variable if available, otherwise try target
if(console_bridge_LIBRARIES)
target_link_libraries(${PROJECT_NAME} PUBLIC ${console_bridge_LIBRARIES})
elseif(TARGET console_bridge::console_bridge)
target_link_libraries(${PROJECT_NAME} PUBLIC console_bridge::console_bridge)
else()
# Fallback: link directly
target_link_libraries(${PROJECT_NAME} PUBLIC console_bridge)
endif()
if(BUILDING_WITH_CATKIN)
target_link_libraries(${PROJECT_NAME}
PUBLIC
${catkin_LIBRARIES}
)
else()
# Standalone mode: link internal dependencies
target_link_libraries(${PROJECT_NAME}
PUBLIC
robot_xmlrpcpp
robot_time
)
endif()
## Add cmake target dependencies
if(BUILDING_WITH_CATKIN)
@ -229,13 +210,14 @@ target_compile_definitions(${PROJECT_NAME}
# Installation (Standalone CMake only)
# ========================================================
if(NOT BUILDING_WITH_CATKIN)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
# Export target trong mi trưng hp đ các target khác có th export và ph thuc vào nó
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
if(NOT BUILDING_WITH_CATKIN)
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.h")
@ -259,6 +241,11 @@ if(NOT BUILDING_WITH_CATKIN)
${CMAKE_CURRENT_BINARY_DIR}/robot_cppConfig.cmake
DESTINATION lib/cmake/${PROJECT_NAME}
)
else()
# Khi build vi Catkin, vn cn export đ các target khác có th export
install(EXPORT ${PROJECT_NAME}-targets
# NAMESPACE robot::
DESTINATION lib/cmake/${PROJECT_NAME})
endif()
# ========================================================

View File

@ -12,11 +12,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Find dependencies
find_package(console_bridge REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread)
find_package(robot_xmlrpcpp QUIET)
if(NOT robot_xmlrpcpp_FOUND)
# Try alternative package name
find_package(XmlRpcCpp QUIET)
endif()
# Libraries
add_library(conversions src/conversions.cpp)

@ -1 +1 @@
Subproject commit bb14979b8a80b743a4dd41b43b5474d4c1a2fc3f
Subproject commit a93304418d9e20c841dd8bf0ea9c9755eb57601f