Skip to content

Commit

Permalink
Fix dependencies when building core as shared libs
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Jun 4, 2019
1 parent 4c8b1c1 commit bbe891e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
16 changes: 9 additions & 7 deletions DronecodeSDKConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
include(CMakeFindDependencyMacro)

if(${CMAKE_VERSION} VERSION_LESS "3.9.0")
find_package(CURL REQUIRED CONFIG)
else()
find_dependency(CURL REQUIRED CONFIG)
endif()
if(NOT ${BUILD_SHARED_LIBS})
if(${CMAKE_VERSION} VERSION_LESS "3.9.0")
find_package(CURL REQUIRED CONFIG)
else()
find_dependency(CURL REQUIRED CONFIG)
endif()

find_dependency(json11)
find_dependency(tinyxml2)
find_dependency(json11)
find_dependency(tinyxml2)
endif()

get_filename_component(DRONECODESDK_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${DRONECODESDK_CMAKE_DIR}/DronecodeSDKTargets.cmake")
1 change: 1 addition & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ add_library(dronecode_sdk
)

target_link_libraries(dronecode_sdk
PRIVATE
tinyxml2::tinyxml2
CURL::libcurl
${CMAKE_THREAD_LIBS_INIT}
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ add_library(dronecode_sdk_camera
)

target_link_libraries(dronecode_sdk_camera
PUBLIC
dronecode_sdk
PRIVATE
tinyxml2::tinyxml2
CURL::libcurl
)
Expand Down

0 comments on commit bbe891e

Please sign in to comment.