Skip to content

Commit bdc1a07

Browse files
authored
📤 Use nlohmann_json tar release (#259)
* 📤 Use nlohmann_json tar release This avoids downloading the whole git repository and restricts the download to the pieces that are actually important, saving time and traffic.
1 parent 5032d59 commit bdc1a07

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
cmake_minimum_required(VERSION 3.14)
2+
cmake_policy(VERSION 3.14)
3+
if(POLICY CMP0135) # DOWNLOAD_EXTRACT_TIMESTAMP
4+
cmake_policy(SET CMP0135 OLD)
5+
endif()
26

37
# HUNTER_ENABLED is always set if this package is included in a project using hunter (HunterGate sets it) In this case
48
# we will use hunter as well to stay consistent. If not the use can supply it on configure to force using hunter.
@@ -65,11 +69,13 @@ endif()
6569
find_package(nlohmann_json CONFIG)
6670

6771
if(NOT nlohmann_json_FOUND)
72+
message(STATUS "jwt-cpp: using FetchContent for nlohmann json")
6873
include(FetchContent)
69-
70-
fetchcontent_declare(nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json.git GIT_TAG v3.11.2)
71-
72-
fetchcontent_makeavailable(nlohmann_json)
74+
FetchContent_Declare(nlohmann_json
75+
URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz
76+
URL_MD5 127794b2c82c0c5693805feaa2a703e2
77+
)
78+
FetchContent_MakeAvailable(nlohmann_json)
7379
endif()
7480

7581
set(JWT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include)

0 commit comments

Comments
 (0)