Skip to content

Commit

Permalink
makes rapidjson dependency managed at cmake level, which will make it…
Browse files Browse the repository at this point in the history
… more portable on different servers (contrary to boost, likely uninstalled)
  • Loading branch information
Benjamin Linard committed Feb 8, 2024
1 parent 3e2d844 commit 7f9fda0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
5 changes: 3 additions & 2 deletions epik/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ if (NOT DEFINED ENABLE_AVX512)
set(ENABLE_AVX512 OFF)
endif()

find_package(RapidJSON REQUIRED)
#find_package(RapidJSON REQUIRED)

find_package(Boost REQUIRED COMPONENTS filesystem)

if(ENABLE_OMP)
Expand Down Expand Up @@ -44,7 +45,7 @@ else()
message(STATUS "EPIK: Vectorization DISABLED")
endif()

message(STATUS "RapidJSON: " ${RAPIDJSON_INCLUDE_DIRS})
message(STATUS "RapidJSON: " ${RAPIDJSON_INCLUDE_DIRS} ${RapidJSON_INCLUDE_DIR})
# RapidJSON cmake scripts are different between versions
set(RapidJSON_INCLUDES ${RAPIDJSON_INCLUDE_DIRS} ${RapidJSON_INCLUDE_DIR})

Expand Down
22 changes: 22 additions & 0 deletions epik/rapidjson.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
include(ExternalProject)

# Download RapidJSON
ExternalProject_Add(
rapidjson
PREFIX "rapidjson"
GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git"
GIT_TAG f54b0e47a08782a6131cc3d60f94d038fa6e0a51
TIMEOUT 10
CMAKE_ARGS
-DRAPIDJSON_BUILD_TESTS=OFF
-DRAPIDJSON_BUILD_DOC=OFF
-DRAPIDJSON_BUILD_EXAMPLES=OFF
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
UPDATE_COMMAND ""
)

# Prepare RapidJSON (RapidJSON is a header-only library)
ExternalProject_Get_Property(rapidjson source_dir)
set(RAPIDJSON_INCLUDE_DIRS ${source_dir}/include)

0 comments on commit 7f9fda0

Please sign in to comment.