From 8d2ab5397051886be26e3b03ca914fcaf09cd760 Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Sun, 17 Dec 2023 18:35:43 +0100 Subject: [PATCH] Fix SDL autodetection Moving to the official SDL2 config resulted in a few variables now following the standard CMake naming conventions. Use the new names when checking whether SDL is present. --- cmake/FreecivDependencies.cmake | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cmake/FreecivDependencies.cmake b/cmake/FreecivDependencies.cmake index ce67fda234..30440ec468 100644 --- a/cmake/FreecivDependencies.cmake +++ b/cmake/FreecivDependencies.cmake @@ -65,17 +65,16 @@ if(FREECIV_ENABLE_NLS) endif() # SDL2 for audio -find_package(SDL2 QUIET) -find_package(SDL2_mixer QUIET) -if (SDL2_MIXER_LIBRARIES AND SDL2_LIBRARY) +find_package(SDL2) +find_package(SDL2_mixer) +if (SDL2_MIXER_LIBRARIES AND SDL2_FOUND) set(AUDIO_SDL TRUE) endif() -if (NOT SDL2_LIBRARY) - message("SDL2 not found") - set(SDL2_INCLUDE_DIR "") +if (NOT SDL2_FOUND) + message(STATUS "SDL2 not found - audio support disabled") endif() if (NOT SDL2_MIXER_LIBRARIES) - message("SDL2_mixer not found") + message(STATUS "SDL2_mixer not found - audio support disabled") set(SDL2_MIXER_LIBRARIES "") set(SDL2_MIXER_INCLUDE_DIR "") endif()