Skip to content

Commit 36c4de9

Browse files
committed
linux build fix
1 parent fdba8b5 commit 36c4de9

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/CMakeModules/Bootstrap_Linux.cmake

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@ find_package(OpenAL REQUIRED)
3939
find_package(SFML 2 COMPONENTS graphics window REQUIRED)
4040
find_package(X11 REQUIRED)
4141

42-
# nlohmann/json
43-
FetchContent_Declare(nlohmann_json
44-
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
45-
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
46-
)
47-
FetchContent_MakeAvailable(nlohmann_json)
42+
# nlohmann/json - try system package first, fall back to fetching
43+
find_package(nlohmann_json 3.12.0 QUIET)
44+
if(NOT nlohmann_json_FOUND)
45+
FetchContent_Declare(nlohmann_json
46+
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
47+
DOWNLOAD_DIR ${CASPARCG_DOWNLOAD_CACHE}
48+
)
49+
FetchContent_MakeAvailable(nlohmann_json)
50+
endif()
4851

4952
# support for Ubuntu 22.04
5053
if (NOT TARGET OpenAL::OpenAL)

tools/linux/deb/ubuntu-jammy/debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Build-Depends: cmake,
3131
libswscale-dev,
3232
libtbb-dev,
3333
libxrandr-dev,
34+
nlohmann-json3-dev,
3435
pkg-config,
3536
txt2man,
3637
zlib1g-dev,

tools/linux/deb/ubuntu-noble/debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Build-Depends: cmake,
3131
libswscale-dev,
3232
libtbb-dev,
3333
libxrandr-dev,
34+
nlohmann-json3-dev,
3435
pkg-config,
3536
txt2man,
3637
zlib1g-dev,

0 commit comments

Comments
 (0)