@@ -6,20 +6,13 @@ Set (DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Sets the root of
66Set (ICONDIR "${DATAROOTDIR} /icons" CACHE STRING "Sets the icon directory for desktop entry to a non-default location." )
77Set (DESKTOPDIR "${DATAROOTDIR} /applications" CACHE STRING "Sets the desktop file directory for desktop entry to a non-default location." )
88
9- Find_Package (SDL REQUIRED)
10- Find_Package (SDL_mixer REQUIRED)
11-
12- if (NOT SDL_FOUND)
13- message (FATAL_ERROR "SDL library could not be found!" )
14- endif (NOT SDL_FOUND)
15-
16- if (NOT SDL_MIXER_FOUND)
17- message (FATAL_ERROR "SDL_mixer library could not be found!" )
18- endif (NOT SDL_MIXER_FOUND)
9+ include (FindPkgConfig)
10+ pkg_search_module(SDL2 REQUIRED sdl2)
11+ pkg_search_module(SDL2_MIXER REQUIRED SDL2_mixer)
12+ pkg_search_module(SDL2_IMAGE REQUIRED SDL2_image)
1913
2014# Find LibGamerzilla library
2115if (NOT APPLE )
22- include (FindPkgConfig)
2316 pkg_search_module(GAMERZILLA OPTIONAL gamerzilla)
2417
2518 if (GAMERZILLA_LIBRARIES)
@@ -32,8 +25,9 @@ add_definitions(-DDATA_PATH=\"${DATAROOTDIR}/anagramarama\")
3225
3326#Add the include directories of the (found) libraries.
3427Include_Directories (
35- ${SDL_INCLUDE_DIR}
36- ${SDL_MIXER_INCLUDE_DIR}
28+ ${SDL2_INCLUDE_DIRS}
29+ ${SDL2_MIXER_INCLUDE_DIRS}
30+ ${SDL2_IMAGE_INCLUDE_DIRS}
3731 ${GAMERZILLA_INCLUDE_DIRS}
3832)
3933
@@ -42,8 +36,9 @@ file(GLOB SOURCES src/dlb.c src/linked.c src/sprite.c src/ag_core.c src/ag.c)
4236Add_Executable (anagramarama ${SOURCES} )
4337Target_Link_Libraries (
4438 anagramarama
45- ${SDL_LIBRARY}
46- ${SDL_MIXER_LIBRARY}
39+ ${SDL2_LIBRARIES}
40+ ${SDL2_MIXER_LIBRARIES}
41+ ${SDL2_IMAGE_LIBRARIES}
4742 ${GAMERZILLA_LIBRARIES}
4843)
4944
0 commit comments