1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-29 23:01:16 +03:00

FetchContent_MakeAvailable (#3351)

* 🔧 use FetchContent_MakeAvailable

* 💚 fix test names
This commit is contained in:
Niels Lohmann
2022-03-06 15:33:05 +01:00
committed by GitHub
parent d1e57df48b
commit c6d8892e5d
6 changed files with 48 additions and 18 deletions

View File

@ -100,15 +100,8 @@ automatically download a release as a dependency at configure type.
include(FetchContent)
FetchContent_Declare(json
URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz
)
FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz)
FetchContent_MakeAvailable(json)
add_executable(example example.cpp)
target_link_libraries(example PRIVATE nlohmann_json::nlohmann_json)