From c113519b68544b4e2d3a01592a87de1f91595e35 Mon Sep 17 00:00:00 2001 From: motxx Date: Fri, 16 Jun 2017 14:37:23 +0900 Subject: [PATCH] Add rapidjson in dependencies --- cmake/dependencies.cmake | 23 +++++++++++++++++++++++ irohad/common/CMakeLists.txt | 17 +++-------------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 05d94aea42..4e2073f4f0 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -258,3 +258,26 @@ set_target_properties(protobuf PROPERTIES if (NOT PROTOBUF_FOUND OR NOT PROTOBUF_PROTOC_EXECUTABLE) add_dependencies(protobuf google_protobuf protoc) endif () + + +################################ +# rapidjson # +################################ +ExternalProject_Add(miloyip_rapidjson + GIT_REPOSITORY "https://github.com/miloyip/rapidjson" + BUILD_COMMAND "" # remove build step, header only lib + CONFIGURE_COMMAND "" # remove configure step + INSTALL_COMMAND "" # remove install step + TEST_COMMAND "" # remove test step + UPDATE_COMMAND "" # remove update step + ) +ExternalProject_Get_Property(miloyip_rapidjson source_dir) +set(miloyip_rapidjson_SOURCE_DIR "${source_dir}") + +# since it is header only, we changed STATIC to INTERFACE below +add_library(rapidjson INTERFACE IMPORTED) +file(MAKE_DIRECTORY ${rapidjson_SOURCE_DIR}/rapidjson) +set_target_properties(rapidjson PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${rapidjson_SOURCE_DIR}/rapidjson + ) +add_dependencies(rapidjson miloyip_rapidjson) diff --git a/irohad/common/CMakeLists.txt b/irohad/common/CMakeLists.txt index e26772be12..9e1b844b5c 100644 --- a/irohad/common/CMakeLists.txt +++ b/irohad/common/CMakeLists.txt @@ -1,15 +1,4 @@ -add_library(datetime STATIC datetime.cpp) - -add_library(random STATIC random.cpp) - -add_library(exception STATIC - exception.cpp +add_library(config config.cpp) +target_link_libraries(config + rapidjson ) - -add_library(timer STATIC timer.cpp) - -add_library(ip_tools STATIC ip_tools.cpp) -target_link_libraries(ip_tools - logger -) -