Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix rpath issue for mavsdk_server macos build #2495

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading