From: Neal Gompa Date: Wed, 14 Dec 2016 13:53:05 +0000 (-0500) Subject: CMake: Fix SDL2 detection for macOS X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=commitdiff_plain;h=d46a3cd0802e4a694165ef2da46d9e25558178ab CMake: Fix SDL2 detection for macOS --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 044544f..0feb4b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,9 +173,13 @@ else(WIN32) find_package(OpenAL REQUIRED) endif(WIN32) -# Not all distros provide sdl2-config.cmake yet -#find_package(sdl2 REQUIRED) -pkg_check_modules(SDL2 sdl2 REQUIRED) +# macOS has problems with using pkgconfig to find SDL2 +if(APPLE) + find_package(sdl2 REQUIRED) +else(APPLE) + pkg_check_modules(SDL2 sdl2 REQUIRED) +endif(APPLE) + find_package(PNG REQUIRED) find_package(JPEG REQUIRED) find_package(ZLIB REQUIRED)