summarylogtreecommitdiffstats
path: root/system-sdl.patch
blob: ccfdbcb8ac3c5a5ca2c151b4507b9187598e887c (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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5556943..95fec2e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,6 +76,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
   find_package(OpenGL REQUIRED)
   find_package(GTK2 2.6 REQUIRED gtk)
   find_package(X11 REQUIRED)
+  find_package(SDL2 REQUIRED)
   find_library(XINPUT_LIBRARY libXi.so)
   find_package(Threads REQUIRED)
 
@@ -95,10 +96,13 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
     message(FATAL_ERROR "Could not find X11 libraries")
   endif()
 
+  if(NOT SDL2_FOUND)
+    message(FATAL_ERROR "Could not find SDL2 libraries")
+  endif()
+
   target_include_directories(Milton PRIVATE
     ${GTK2_INCLUDE_DIRS}
     ${X11_INCLUDE_DIR}
-    ${SDL2DIR}/build/linux64/include/SDL2
     ${OPENGL_INCLUDE_DIR}
   )
 
@@ -107,8 +111,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
     ${X11_LIBRARIES}
     ${OPENGL_LIBRARIES}
     ${XINPUT_LIBRARY}
-    ${SDL2DIR}/build/linux64/lib/libSDL2maind.a
-    ${SDL2DIR}/build/linux64/lib/libSDL2d.a
+    SDL2::SDL2
     ${CMAKE_THREAD_LIBS_INIT}
     ${CMAKE_DL_LIBS}
     )