(cmake) use FetchContent cmake module to retrieve jsoncpp third party dependency

This commit is contained in:
Benjamin Sergeant
2020-09-26 14:11:40 -07:00
parent 93167e3917
commit 6077f86af8
11 changed files with 18 additions and 8019 deletions

View File

@ -22,12 +22,6 @@ include_directories(ws .)
include_directories(ws ..)
include_directories(ws ../third_party/cpp-linenoise)
find_package(JsonCpp)
if (NOT JSONCPP_FOUND)
include_directories(../third_party/jsoncpp)
set(JSONCPP_SOURCES ../third_party/jsoncpp/jsoncpp.cpp)
endif()
if (USE_PYTHON)
find_package(Python COMPONENTS Development)
if (NOT Python_FOUND)
@ -56,13 +50,9 @@ target_link_libraries(ws ixcrypto)
target_link_libraries(ws ixcore)
target_link_libraries(ws spdlog)
target_link_libraries(ws jsoncpp_static)
if (USE_PYTHON)
target_link_libraries(ws ${Python_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)