diff --git a/CMakeLists.txt b/CMakeLists.txt index 608d9ce..ac2857d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,6 +231,14 @@ else() ${TF3_LIBRARY} ) + # .so phải nằm ở root build dir như mission_adapters/recovery_core — PluginLoaderHelper chỉ tìm + # theo PNKX_NAV_CORE_LIBRARY_PATH / build dir / devel/lib, không quét thư mục con của build tree. + set_target_properties(action_core PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} + BUILD_RPATH "${CMAKE_BINARY_DIR}" + INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" + ) + endif() @@ -297,6 +305,14 @@ function(add_action_core_plugin target source) ${CMAKE_DL_LIBS} ${TF3_LIBRARY} ) + + # Handler nạp qua Boost.DLL theo `library_path` trong YAML — .so phải ra root build dir, + # nếu không PluginLoaderHelper báo "Library not found for symbol" dù build xanh. + set_target_properties(${target} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} + BUILD_RPATH "${CMAKE_BINARY_DIR}" + INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" + ) endif() set(ACTION_CORE_PLUGIN_TARGETS