Skip to content

Commit

Permalink
backend: rename for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Jun 18, 2019
1 parent 43ebce0 commit 4d20e33
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
30 changes: 17 additions & 13 deletions src/backend/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ if(IOS)
endif()

if(IOS)
add_library(backend SHARED ${BACKEND_SOURCES})
add_library(mavsdk_server SHARED ${BACKEND_SOURCES})
else()
add_library(backend ${BACKEND_SOURCES})
add_library(mavsdk_server ${BACKEND_SOURCES})
endif()

target_link_libraries(backend
target_link_libraries(mavsdk_server
PRIVATE
mavsdk_action
mavsdk_calibration
Expand All @@ -54,7 +54,7 @@ target_link_libraries(backend
${COMPONENTS_PROTOGENS}
)

target_include_directories(backend
target_include_directories(mavsdk_server
PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/core>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/plugins>
Expand All @@ -65,7 +65,7 @@ target_include_directories(backend
)

if(IOS)
set_target_properties(backend PROPERTIES
set_target_properties(mavsdk_server PROPERTIES
FRAMEWORK TRUE
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_NAME_DIR @rpath
Expand All @@ -74,29 +74,33 @@ if(IOS)
MACOSX_FRAMEWORK_INFO_PLIST ${PROJECT_SOURCE_DIR}/backend/cmake/MacOSXFrameworkInfo.plist.in
)
else()
add_executable(backend_bin
add_executable(mavsdk_server_bin
mavsdk_server.cpp
)

target_link_libraries(backend_bin
backend
target_link_libraries(mavsdk_server_bin
mavsdk_server
mavsdk
)

install(TARGETS backend_bin
set_target_properties(mavsdk_server_bin PROPERTIES
OUTPUT_NAME mavsdk_server
)

install(TARGETS mavsdk_server_bin
EXPORT mavsdk-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
)

if(BUILD_SHARED_LIBS)
install(TARGETS backend
install(TARGETS mavsdk_server
EXPORT mavsdk-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
)

install(FILES
backend_api.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/mavsdk/backend"
)
)
endif()
endif()
2 changes: 1 addition & 1 deletion src/backend/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ target_include_directories(unit_tests_backend
)

target_link_libraries(unit_tests_backend
backend
mavsdk_server
mavsdk_action
mavsdk_camera
mavsdk_info
Expand Down

0 comments on commit 4d20e33

Please sign in to comment.