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

Update jsoncpp #1395

Merged
merged 2 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
find_package(jsoncpp CONFIG QUIET)

if(NOT TARGET JsonCpp::jsoncpp)
if(NOT TARGET JsonCpp::JsonCpp)
if(JsonCpp_FOUND)
message(STATUS "Found jsoncpp via config file: ${JsonCpp_DIR}")
if(NOT JsonCpp_LIBRARY)
if(TARGET JsonCpp)
set(JsonCpp_LIBRARY JsonCpp)
elseif(TARGET JsonCpp::jsoncpp)
set(JsonCpp_LIBRARY JsonCpp::jsoncpp)
if(TARGET jsoncpp)
set(JsonCpp_LIBRARY jsoncpp)
elseif(TARGET JsonCpp::JsonCpp)
set(JsonCpp_LIBRARY JsonCpp::JsonCpp)
endif()
endif()
else()
Expand All @@ -18,7 +18,7 @@ if(NOT TARGET JsonCpp::jsoncpp)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_JSONCPP QUIET IMPORTED_TARGET GLOBAL jsoncpp)
if(PC_JSONCPP_FOUND)
add_library(JsonCpp::jsoncpp ALIAS PkgConfig::PC_JSONCPP)
add_library(JsonCpp::JsonCpp ALIAS PkgConfig::PC_JSONCPP)
endif()
endif()

Expand All @@ -38,8 +38,8 @@ if(NOT TARGET JsonCpp::jsoncpp)
endif()

if (JsonCpp_FOUND)
add_library(JsonCpp::jsoncpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::jsoncpp PROPERTIES
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
set_target_properties(JsonCpp::JsonCpp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${JsonCpp_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${JsonCpp_LIBRARY}")
if(NOT JsonCpp_LIBRARY)
Expand Down
4 changes: 2 additions & 2 deletions src/cmake/unit_tests.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include_directories(${PROJECT_SOURCE_DIR}/core)
include_directories(${PROJECT_SOURCE_DIR}/third_party/mavlink/include)

find_package(JsonCpp REQUIRED)
find_package(jsoncpp REQUIRED)

add_executable(unit_tests_runner
${UNIT_TEST_SOURCES}
Expand All @@ -20,7 +20,7 @@ target_link_libraries(unit_tests_runner
mavsdk_calibration
mavsdk_telemetry
CURL::libcurl
JsonCpp::jsoncpp
JsonCpp::JsonCpp
gtest
gtest_main
gmock
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/mission/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
find_package(JsonCpp REQUIRED)
find_package(jsoncpp REQUIRED)

add_library(mavsdk_mission
mission.cpp
Expand All @@ -19,7 +19,7 @@ target_link_libraries(mavsdk_mission
PUBLIC
mavsdk
PRIVATE
JsonCpp::jsoncpp
JsonCpp::JsonCpp
)

target_include_directories(mavsdk_mission PUBLIC
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/mission_raw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
find_package(JsonCpp REQUIRED)
find_package(jsoncpp REQUIRED)

add_library(mavsdk_mission_raw
mission_raw.cpp
Expand All @@ -20,7 +20,7 @@ target_link_libraries(mavsdk_mission_raw
PUBLIC
mavsdk
PRIVATE
JsonCpp::jsoncpp
JsonCpp::JsonCpp
)

target_include_directories(mavsdk_mission_raw PUBLIC
Expand Down
3 changes: 1 addition & 2 deletions third_party/jsoncpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ endforeach()
ExternalProject_Add(
jsoncpp
GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp
GIT_TAG 1.8.4
GIT_TAG ed1ab7ac452b0fe51f3b0a8364770774175a060e
PREFIX jsoncpp
PATCH_COMMAND git checkout . && git apply ${PROJECT_SOURCE_DIR}/fixlibname.patch && git apply ${PROJECT_SOURCE_DIR}/fix_werror.patch
CMAKE_ARGS "${CMAKE_ARGS}"
)
14 changes: 0 additions & 14 deletions third_party/jsoncpp/fix_werror.patch

This file was deleted.

74 changes: 0 additions & 74 deletions third_party/jsoncpp/fixlibname.patch

This file was deleted.