From 540a7e3dd4cbb6144ed87d44defaed069bbc0eff Mon Sep 17 00:00:00 2001 From: eike-fokken <33839210+eike-fokken@users.noreply.github.com> Date: Tue, 4 Jul 2023 13:02:33 +0200 Subject: [PATCH] Replace the full nlohmann_json repo with a fetch_content variant. (#279) During the configuring of json-schema-validator, the repository nlohmann_json is fetched via the fetch_content functionality of CMake. It is a huge repository with size 180MB, which are downloaded whenever one configures CMake on an empty build directory (e.g. after deleting the build directory to clear out cached CMake variables.) The repository https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent only contains releases instead of all development commits and has (at the moment) size of only 830kB, which stronly cuts the download time. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b81049..167d233 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ set(fetch_packages "") # TODO: Remove when bumping cmake >= 3.24 if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) FetchContent_Declare(nlohmann_json - GIT_REPOSITORY https://github.com/nlohmann/json + GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent GIT_TAG ${JSON_FETCH_VERSION} FIND_PACKAGE_ARGS ) @@ -95,7 +95,7 @@ else () if (NOT nlohmann_json_FOUND) # If failed fetch the desired version FetchContent_Declare(nlohmann_json - GIT_REPOSITORY https://github.com/nlohmann/json + GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent GIT_TAG ${JSON_FETCH_VERSION} ) list(APPEND fetch_packages nlohmann_json)