diff --git a/CMake/FindJsonCpp.cmake b/CMake/FindJsonCpp.cmake new file mode 100644 index 00000000..cdc6eabc --- /dev/null +++ b/CMake/FindJsonCpp.cmake @@ -0,0 +1,19 @@ +# Find package structure taken from libcurl + +include(FindPackageHandleStandardArgs) + +find_path(JSONCPP_INCLUDE_DIRS json/json.h) +find_library(JSONCPP_LIBRARY jsoncpp) + +find_package_handle_standard_args(JSONCPP + FOUND_VAR + JSONCPP_FOUND + REQUIRED_VARS + JSONCPP_LIBRARY + JSONCPP_INCLUDE_DIRS + FAIL_MESSAGE + "Could NOT find jsoncpp" +) + +set(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIRS}) +set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84ff3269..10b3301f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,6 +182,7 @@ if (USE_TLS AND USE_OPEN_SSL) endif() if (USE_TLS AND USE_MBED_TLS) + # FIXME I'm not too sure that this USE_VENDORED_THIRD_PARTY thing works if (USE_VENDORED_THIRD_PARTY) set (ENABLE_PROGRAMS OFF) add_subdirectory(third_party/mbedtls) diff --git a/DOCKER_VERSION b/DOCKER_VERSION index 0f4a1d6e..4e61aeef 100644 --- a/DOCKER_VERSION +++ b/DOCKER_VERSION @@ -1 +1 @@ -7.4.3 +7.4.4 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f6d560ba..7a9eaab4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## [7.4.4] - 2019-12-03 + +- (ws) #125 / cmake detects an already installed jsoncpp and will try to use this one if present + ## [7.4.3] - 2019-12-03 - (http client) use std::unordered_map instead of std::map for HttpParameters and HttpFormDataParameters class aliases diff --git a/ixcobra/CMakeLists.txt b/ixcobra/CMakeLists.txt index 48d2df22..72dfdecf 100644 --- a/ixcobra/CMakeLists.txt +++ b/ixcobra/CMakeLists.txt @@ -24,7 +24,6 @@ set(IXCOBRA_INCLUDE_DIRS . .. ../ixcore - ../ixcrypto - ../third_party) + ../ixcrypto) target_include_directories( ixcobra PUBLIC ${IXCOBRA_INCLUDE_DIRS} ) diff --git a/ixcobra/ixcobra/IXCobraConnection.cpp b/ixcobra/ixcobra/IXCobraConnection.cpp index e59afbfa..9d96992f 100644 --- a/ixcobra/ixcobra/IXCobraConnection.cpp +++ b/ixcobra/ixcobra/IXCobraConnection.cpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace ix diff --git a/ixcobra/ixcobra/IXCobraConnection.h b/ixcobra/ixcobra/IXCobraConnection.h index 076ce769..4deb2fc9 100644 --- a/ixcobra/ixcobra/IXCobraConnection.h +++ b/ixcobra/ixcobra/IXCobraConnection.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include diff --git a/ixcobra/ixcobra/IXCobraMetricsPublisher.h b/ixcobra/ixcobra/IXCobraMetricsPublisher.h index 9311b26a..b8a813ba 100644 --- a/ixcobra/ixcobra/IXCobraMetricsPublisher.h +++ b/ixcobra/ixcobra/IXCobraMetricsPublisher.h @@ -9,7 +9,7 @@ #include "IXCobraMetricsThreadedPublisher.h" #include #include -#include +#include #include #include diff --git a/ixcobra/ixcobra/IXCobraMetricsThreadedPublisher.cpp b/ixcobra/ixcobra/IXCobraMetricsThreadedPublisher.cpp index 17e859c6..1cf539e5 100644 --- a/ixcobra/ixcobra/IXCobraMetricsThreadedPublisher.cpp +++ b/ixcobra/ixcobra/IXCobraMetricsThreadedPublisher.cpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace ix diff --git a/ixcobra/ixcobra/IXCobraMetricsThreadedPublisher.h b/ixcobra/ixcobra/IXCobraMetricsThreadedPublisher.h index 8f2a127f..20bf44bb 100644 --- a/ixcobra/ixcobra/IXCobraMetricsThreadedPublisher.h +++ b/ixcobra/ixcobra/IXCobraMetricsThreadedPublisher.h @@ -9,7 +9,7 @@ #include "IXCobraConnection.h" #include #include -#include +#include #include #include #include diff --git a/ixsentry/CMakeLists.txt b/ixsentry/CMakeLists.txt index d513fb0a..86893860 100644 --- a/ixsentry/CMakeLists.txt +++ b/ixsentry/CMakeLists.txt @@ -19,7 +19,6 @@ add_library(ixsentry STATIC set(IXSENTRY_INCLUDE_DIRS . .. - ../ixcore - ../third_party) + ../ixcore) target_include_directories( ixsentry PUBLIC ${IXSENTRY_INCLUDE_DIRS} ) diff --git a/ixsentry/ixsentry/IXSentryClient.cpp b/ixsentry/ixsentry/IXSentryClient.cpp index c14041a4..197ba8ec 100644 --- a/ixsentry/ixsentry/IXSentryClient.cpp +++ b/ixsentry/ixsentry/IXSentryClient.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/ixsentry/ixsentry/IXSentryClient.h b/ixsentry/ixsentry/IXSentryClient.h index a0a25a80..39209ba5 100644 --- a/ixsentry/ixsentry/IXSentryClient.h +++ b/ixsentry/ixsentry/IXSentryClient.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include diff --git a/ixwebsocket/IXWebSocketVersion.h b/ixwebsocket/IXWebSocketVersion.h index c33d0aae..8309752f 100644 --- a/ixwebsocket/IXWebSocketVersion.h +++ b/ixwebsocket/IXWebSocketVersion.h @@ -6,4 +6,4 @@ #pragma once -#define IX_WEBSOCKET_VERSION "7.4.3" +#define IX_WEBSOCKET_VERSION "7.4.4" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9b471c94..ce4277ac 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,13 +23,20 @@ include_directories( ../ws ) +find_package(JsonCpp) +if (NOT JSONCPP_FOUND) + include_directories(../third_party/jsoncpp) + set(JSONCPP_SOURCES ../third_party/jsoncpp/jsoncpp.cpp) +endif() + # Shared sources set (SOURCES + ${JSONCPP_SOURCES} + test_runner.cpp IXTest.cpp IXGetFreePort.cpp ../third_party/msgpack11/msgpack11.cpp - ../third_party/jsoncpp/jsoncpp.cpp IXSocketTest.cpp IXSocketConnectTest.cpp @@ -79,6 +86,11 @@ if (APPLE AND USE_TLS) target_link_libraries(ixwebsocket_unittest "-framework foundation" "-framework security") endif() +if (JSONCPP_FOUND) + target_include_directories(ixwebsocket_unittest PUBLIC ${JSONCPP_INCLUDE_DIRS}) + target_link_libraries(ixwebsocket_unittest ${JSONCPP_LIBRARIES}) +endif() + target_link_libraries(ixwebsocket_unittest ixsnake) target_link_libraries(ixwebsocket_unittest ixcobra) target_link_libraries(ixwebsocket_unittest ixwebsocket) diff --git a/ws/CMakeLists.txt b/ws/CMakeLists.txt index 313a5115..6ec3551e 100644 --- a/ws/CMakeLists.txt +++ b/ws/CMakeLists.txt @@ -29,10 +29,16 @@ if (UNIX) set( STATSD_CLIENT_SOURCES ../third_party/statsd-client-cpp/src/statsd_client.cpp) endif() +find_package(JsonCpp) +if (NOT JSONCPP_FOUND) + include_directories(../third_party/jsoncpp) + set(JSONCPP_SOURCES ../third_party/jsoncpp/jsoncpp.cpp) +endif() + add_executable(ws ../third_party/msgpack11/msgpack11.cpp - ../third_party/jsoncpp/jsoncpp.cpp ${STATSD_CLIENT_SOURCES} + ${JSONCPP_SOURCES} ws_http_client.cpp ws_ping_pong.cpp @@ -74,4 +80,9 @@ if(NOT APPLE AND NOT USE_MBED_TLS) target_link_libraries(ws ${OPENSSL_LIBRARIES}) endif() +if (JSONCPP_FOUND) + target_include_directories(ws PUBLIC ${JSONCPP_INCLUDE_DIRS}) + target_link_libraries(ws ${JSONCPP_LIBRARIES}) +endif() + install(TARGETS ws RUNTIME DESTINATION bin)