# usage: # FetchContent_MakeAvailable(json) # target_link_libraries(${PROJECT_NAME} PRIVATE nlohmann_json::nlohmann_json) if (NOT DEFINED NLOHMANN_JSON_GIT_TAG) message(FATAL_ERROR "NLOHMANN_JSON_GIT_TAG is not defined.\n see https://github.com/nlohmann/json and grab a release tag.\n example: set(NLOHMANN_JSON_GIT_TAG v3.11.2)") endif() FetchContent_Declare( json GIT_REPOSITORY https://github.com/nlohmann/json GIT_TAG ${NLOHMANN_JSON_GIT_TAG} ) include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake) print_git_tag(${NLOHMANN_JSON_GIT_TAG})