Skip to content

Commit

Permalink
Merge pull request #2495 from chenrui333/macos-rpath-issue
Browse files Browse the repository at this point in the history
fix `rpath` issue for `mavsdk_server` macos build
  • Loading branch information
julianoes authored Jan 22, 2025
2 parents e0e4ffb + 6d11efa commit 449a8f1
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 449a8f1

Please sign in to comment.