aboutsummaryrefslogtreecommitdiff
blob: 3776de0a5f55595f3ae4c01973ebc7ca61974321 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 1e2eea45ba79412ed2d7a80dbc8388ccec93af09 Mon Sep 17 00:00:00 2001
From: Markus Meier <maekke@gentoo.org>
Date: Sat, 14 Jan 2023 14:56:46 +0100
Subject: [PATCH] add USE_SDL2 option to control SDL2 package usage

https://gitweb.gentoo.org/repo/gentoo.git/tree/media-gfx/darktable/files/darktable-4.2.0_libs-deps-automagic.patch
---
 DefineOptions.cmake     |  1 +
 src/libs/CMakeLists.txt | 22 ++++++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/DefineOptions.cmake b/DefineOptions.cmake
index 59ea1e3d5..9266766f2 100644
--- a/DefineOptions.cmake
+++ b/DefineOptions.cmake
@@ -42,6 +42,7 @@ option(USE_GMIC "Use G'MIC image processing framework." ON)
 option(USE_ICU "Use ICU - International Components for Unicode." ON)
 option(USE_GAME "Build 1st April easter egg game" ON)
 option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
+option(USE_SDL2 "Enable SDL2 support" ON)
 
 if (USE_OPENCL)
     option(TESTBUILD_OPENCL_PROGRAMS "Test-compile opencl programs (needs llvm and clang 3.9+)" ON)
diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt
index 20a5f0eff..272968061 100644
--- a/src/libs/CMakeLists.txt
+++ b/src/libs/CMakeLists.txt
@@ -92,16 +92,18 @@ if(PortMidi_FOUND)
   target_link_libraries (midi ${PortMidi_LIBRARY})
 endif()
 
-find_package(SDL2)
-if(SDL2_FOUND)
-  add_definitions("-DHAVE_SDL")
-  set(MODULES ${MODULES} gamepad)
-  add_library(gamepad MODULE "tools/gamepad.c")
-  if(TARGET SDL2::SDL2)
-    target_link_libraries(gamepad SDL2::SDL2)
-  else()
-    include_directories(${SDL2_INCLUDE_DIRS})
-    target_link_libraries(gamepad ${SDL2_LIBRARIES})
+if(USE_SDL2)
+  find_package(SDL2)
+  if(SDL2_FOUND)
+    add_definitions("-DHAVE_SDL")
+    set(MODULES ${MODULES} gamepad)
+    add_library(gamepad MODULE "tools/gamepad.c")
+    if(TARGET SDL2::SDL2)
+      target_link_libraries(gamepad SDL2::SDL2)
+    else()
+      include_directories(${SDL2_INCLUDE_DIRS})
+      target_link_libraries(gamepad ${SDL2_LIBRARIES})
+    endif()
   endif()
 endif()
 
-- 
2.38.2