From d46a3cd0802e4a694165ef2da46d9e25558178ab Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 14 Dec 2016 08:53:05 -0500 Subject: [PATCH] CMake: Fix SDL2 detection for macOS --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) -- 2.39.2