Skip to content

Commit

Permalink
Add rapidjson in dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
motxx committed Jun 16, 2017
1 parent 7274b76 commit c113519
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
23 changes: 23 additions & 0 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
17 changes: 3 additions & 14 deletions irohad/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
)

0 comments on commit c113519

Please sign in to comment.