feat: add nlohmann/json lib

This commit is contained in:
Aaron Kimbre
2024-04-23 16:29:57 -05:00
parent 99e7349f6c
commit 63f9a9f9d4
2 changed files with 23 additions and 1 deletions

21
cmake/FindJSON.cmake Normal file
View File

@@ -0,0 +1,21 @@
include(FetchContent)
message(STATUS "Fetching json...")
FetchContent_Declare(
json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG v3.11.3
)
FetchContent_GetProperties(json)
if(NOT json_POPULATED)
set(JSON_BuildTests OFF CACHE INTERNAL "")
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(json)
message(STATUS "json fetched and is now ready.")
set(JSON_FOUND TRUE)