summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/obs-advanced-masks-nlohmann-json.patch
blob: ee38b9d4aad83434afbffdabfb32e93c59ab6432 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: search for nlohmann_json path
Author: Joao Eriberto Mota Filho <eriberto@debian.org>
Forwarded: https://github.com/FiniteSingularity/obs-advanced-masks/pull/86
Last-Update: 2025-09-04
Index: obs-advanced-masks/CMakeLists.txt
===================================================================
--- obs-advanced-masks.orig/CMakeLists.txt
+++ obs-advanced-masks/CMakeLists.txt
@@ -73,9 +73,13 @@ if(BUILD_OUT_OF_TREE)
         add_library(nlohmann_json INTERFACE)
         target_include_directories(nlohmann_json INTERFACE "${CMAKE_BINARY_DIR}/json/single_include")
     else()
-        include(FetchContent)
-        FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
-        FetchContent_MakeAvailable(json)
+        # Try to find a system-installed nlohmann_json (Debian: nlohmann-json3-dev)
+        find_package(nlohmann_json QUIET)
+        if(NOT nlohmann_json_FOUND)
+            include(FetchContent)
+            FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
+            FetchContent_MakeAvailable(json)
+        endif()
     endif()
 else()
 	if(OBS_VERSION VERSION_GREATER_EQUAL 30.1.0)