Skip to content

Commit

Permalink
fix rpath issue for mavsdk_server macos build
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Jan 18, 2025
1 parent e0e4ffb commit 6d11efa
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/mavsdk_server/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,24 @@ if(NOT IOS AND NOT ANDROID)
)

if (BUILD_SHARED_LIBS)
set_target_properties(mavsdk_server_bin PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}"
if (APPLE)
set_target_properties(mavsdk_server PROPERTIES
BUILD_WITH_INSTALL_RPATH ON
INSTALL_NAME_DIR "@rpath"
INSTALL_RPATH "@loader_path/../lib"
)

set_target_properties(mavsdk_server
PROPERTIES
INSTALL_RPATH "$ORIGIN"
)
set_target_properties(mavsdk_server_bin PROPERTIES
BUILD_WITH_INSTALL_RPATH ON
INSTALL_RPATH "@loader_path/../lib"
)
else()
set_target_properties(mavsdk_server PROPERTIES
INSTALL_RPATH "$ORIGIN"
)
set_target_properties(mavsdk_server_bin PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}"
)
endif()
endif()
endif()

Expand Down

0 comments on commit 6d11efa

Please sign in to comment.