You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
569 B
CMake
19 lines
569 B
CMake
# 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})
|