File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,22 @@ find_package( Filesystem REQUIRED )
4444# Similar setup for libatomic; required only on 32-bit systems
4545find_package ( Atomic REQUIRED )
4646
47- # Add nlohmann/json dependency
48- find_package (nlohmann_json 3.11.2 REQUIRED)
47+ # Add nlohmann/json dependency (use system if available; otherwise, fetch it)
48+ find_package (nlohmann_json 3.11.2 QUIET )
49+ if (NOT nlohmann_json_FOUND)
50+ include (FetchContent)
51+ # Allow a locally-found tarball; if missing, fall back to upstream URL
52+ set (JSON_URL "${CMAKE_CURRENT_SOURCE_DIR} /nlohmann-json-3.11.2.tar.xz" )
53+ if (NOT EXISTS "${JSON_URL} " )
54+ set (JSON_URL "https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz" )
55+ endif ()
56+ cmake_policy (SET CMP0135 NEW)
57+ FetchContent_Declare(
58+ nlohmann_json
59+ URL "${JSON_URL} "
60+ )
61+ FetchContent_MakeAvailable(nlohmann_json)
62+ endif ()
4963
5064if ( NOT XROOTD_EXTERNAL_TINYXML2 )
5165 include (FetchContent)
You can’t perform that action at this time.
0 commit comments