From c519079eaaf88d992ba41bf5e4c2813e3f1a184b Mon Sep 17 00:00:00 2001 From: DanTan Date: Sun, 6 Aug 2023 02:55:20 +1000 Subject: [PATCH] updated cmake for jsoncpp --- CMakeLists.txt | 2 -- src/CMakeLists.txt | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b941518..4303553 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,10 +14,8 @@ add_executable(rate_tests test/Rate_Tests.cpp) add_subdirectory(src) target_link_libraries(client_tests riot-cpp) -target_link_libraries(client_tests jsoncpp) target_link_libraries(client_tests Catch2::Catch2WithMain) target_link_libraries(rate_tests riot-cpp) -target_link_libraries(rate_tests jsoncpp) target_link_libraries(rate_tests Catch2::Catch2WithMain) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3e02fac..c6b3d75 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,9 +6,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() if (WIN32) list(APPEND jsoncpp_LIBRARIES "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/jsoncpp.lib") + message(win32) endif() if (MACOSX) list(APPEND jsoncpp_LIBRARIES "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/jsoncpp.lib") + message(macosx) endif() find_package(CURL REQUIRED) @@ -17,10 +19,6 @@ find_package(jsoncpp CONFIG REQUIRED) add_library(riot-cpp STATIC client/client.cpp query/query.cpp handling/structures/request_history.cpp handling/handlers.cpp logging/logger.cpp) target_include_directories(riot-cpp PRIVATE ${CURL_INCLUDE_DIRS}) -if (EXISTS ${jsoncpp_INCLUDE_DIRS}/jsoncpp) - target_include_directories(riot-cpp PRIVATE ${jsoncpp_INCLUDE_DIRS}/jsoncpp) -else() - target_include_directories(riot-cpp PRIVATE ${jsoncpp_INCLUDE_DIRS}) -endif() + target_link_libraries(riot-cpp ${CURL_LIBRARIES}) -target_link_libraries(riot-cpp ${jsoncpp_LIBRARIES}) +target_link_libraries(riot-cpp JsonCpp::JsonCpp)