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

cmake: set RPATH of installed mavsdk_server #2441

Merged
merged 1 commit into from
Nov 19, 2024
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
14 changes: 14 additions & 0 deletions src/mavsdk_server/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ list(APPEND MAVSDK_SERVER_SOURCES
grpc_server.cpp
)

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

set(COMPONENTS_LIST ${ENABLED_PLUGINS})
list(APPEND COMPONENTS_LIST core)
foreach(COMPONENT_NAME ${COMPONENTS_LIST})
Expand Down Expand Up @@ -109,8 +111,20 @@ if(NOT IOS AND NOT ANDROID)
EXPORT mavsdk-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

if (BUILD_SHARED_LIBS)
set_target_properties(mavsdk_server_bin PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}"
)

set_target_properties(mavsdk_server
PROPERTIES
INSTALL_RPATH "$ORIGIN"
)
endif()
endif()


# iOS builds mavsdk_server.framework
if(IOS OR (APPLE AND MACOS_FRAMEWORK))
set_target_properties(mavsdk_server PROPERTIES
Expand Down