From 7f9fda00a2715e7ce8c649e4c25de9131fc885df Mon Sep 17 00:00:00 2001 From: Benjamin Linard Date: Thu, 8 Feb 2024 11:11:07 +0100 Subject: [PATCH] makes rapidjson dependency managed at cmake level, which will make it more portable on different servers (contrary to boost, likely uninstalled) --- epik/CMakeLists.txt | 5 +++-- epik/rapidjson.cmake | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 epik/rapidjson.cmake diff --git a/epik/CMakeLists.txt b/epik/CMakeLists.txt index 39221bc..82d29ae 100644 --- a/epik/CMakeLists.txt +++ b/epik/CMakeLists.txt @@ -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) @@ -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}) diff --git a/epik/rapidjson.cmake b/epik/rapidjson.cmake new file mode 100644 index 0000000..478c269 --- /dev/null +++ b/epik/rapidjson.cmake @@ -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)