Skip to content

Commit 7bd1878

Browse files
committed
➕ explicitly add nlohmann_json as a dependency to be found in QMAP
Signed-off-by: burgholzer <[email protected]>
1 parent a3c6647 commit 7bd1878

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cmake/ExternalDependencies.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ else()
6565
endif()
6666
endif()
6767

68+
set(JSON_VERSION
69+
3.11.3
70+
CACHE STRING "nlohmann_json version")
71+
set(JSON_URL https://github.com/nlohmann/json/releases/download/v${JSON_VERSION}/json.tar.xz)
72+
set(JSON_SystemInclude
73+
ON
74+
CACHE INTERNAL "Treat the library headers like system headers")
75+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
76+
FetchContent_Declare(nlohmann_json URL ${JSON_URL} FIND_PACKAGE_ARGS ${JSON_VERSION})
77+
list(APPEND FETCH_PACKAGES nlohmann_json)
78+
else()
79+
find_package(nlohmann_json ${JSON_VERSION} QUIET)
80+
if(NOT nlohmann_json_FOUND)
81+
FetchContent_Declare(nlohmann_json URL ${JSON_URL})
82+
list(APPEND FETCH_PACKAGES nlohmann_json)
83+
endif()
84+
endif()
85+
6886
set(PLOG_VERSION
6987
1.1.10
7088
CACHE STRING "Plog version")

0 commit comments

Comments
 (0)