Skip to content

Commit

Permalink
Merge pull request #2441 from mavlink/pr-mavsdk-server-install
Browse files Browse the repository at this point in the history
cmake: set RPATH of installed mavsdk_server
  • Loading branch information
julianoes authored Nov 19, 2024
2 parents 1e0a29e + 9ab5b5a commit e840b3a
Showing 1 changed file with 14 additions and 0 deletions.
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

0 comments on commit e840b3a

Please sign in to comment.