diff --git a/.gitmodules b/.gitmodules index 39e18fd..44fd2fc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "backend/external/uwebsockets"] path = backend/external/uwebsockets url = https://github.com/uNetworking/uWebSockets.git +[submodule "backend/external/json"] + path = backend/external/json + url = https://github.com/nlohmann/json.git diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 17b83d1..2fb2469 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -34,9 +34,10 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(tec.h) -# https://json.nlohmann.me/integration/cmake/#fetchcontent -FetchContent_Declare(nlohmann_json URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz) -FetchContent_MakeAvailable(nlohmann_json) +# nlohmann/json via git submodule (backend/external/json) +set(JSON_BuildTests OFF CACHE INTERNAL "") +set(JSON_Install OFF CACHE INTERNAL "") +add_subdirectory(external/json) find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED) diff --git a/backend/external/json b/backend/external/json new file mode 160000 index 0000000..55f9368 --- /dev/null +++ b/backend/external/json @@ -0,0 +1 @@ +Subproject commit 55f93686c01528224f448c19128836e7df245f72