Skip to content

Commit 4929764

Browse files
committed
fix: Update nlohmann-json.cmake to use FetchContent
1 parent ebe3cd5 commit 4929764

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cmake/nlohmann-json.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FetchContent_Declare(
2+
nlohmann_json
3+
GIT_REPOSITORY https://github.com/nlohmann/json
4+
GIT_TAG v3.12.0
5+
)
6+
7+
FetchContent_GetProperties(nlohmann_json)
8+
if(NOT nlohmann_json_POPULATED)
9+
FetchContent_Populate(nlohmann_json)
10+
add_library(nlohmann_json INTERFACE)
11+
target_include_directories(nlohmann_json INTERFACE
12+
$<BUILD_INTERFACE:${nlohmann_json_SOURCE_DIR}/single_include>
13+
)
14+
endif()

0 commit comments

Comments
 (0)