Skip to content

Commit

Permalink
updated cmake for jsoncpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-Tan committed Aug 5, 2023
1 parent 569eb0b commit c519079
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

10 changes: 4 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit c519079

Please sign in to comment.