diff --git a/CMakeLists.txt b/CMakeLists.txt index 83042bc..dd5db07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # --- Dependencies --- # Tìm các thư viện cần thiết -# find_package(tf3 REQUIRED) # Nếu dùng tf3 +# find_package(tf3 REQUIRED) # Nếu dùng tf3 find_package(Eigen3 REQUIRED) # Thư viện Eigen cho toán học find_package(Boost REQUIRED COMPONENTS system thread filesystem) # Boost: system, thread, filesystem find_package(GTest REQUIRED) # Google Test cho unit test @@ -122,6 +122,7 @@ add_library(plugins ) target_link_libraries(plugins + PRIVATE costmap_2d ${Boost_LIBRARIES} yaml-cpp @@ -133,6 +134,21 @@ set_target_properties(plugins PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} ) +install(TARGETS plugins + EXPORT plugins-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 +) + +install(EXPORT plugins-targets + FILE plugins-targets.cmake + NAMESPACE costmap_2d:: + DESTINATION lib/cmake/plugins +) + + # --- Option để bật/tắt test --- option(BUILD_COSTMAP_TESTS "Build costmap_2d test executables" ON)