Fix CMakeFile.txt for SDL2 supplied SDL2-config.cmake, which is inclu… (#830) * Fix CMakeFile.txt for SDL2 supplied SDL2-config.cmake, which is included with version 2.0.4 and newer. * Fall back to pkgconfig for ancient releases that are stuck on pre-2.0.4 SDL.
Christopher Snowhill kode54@gmail.com
Fri, 28 Jul 2017 21:49:31 -0700
1 files changed,
5 insertions(+),
2 deletions(-)
jump to
M
src/platform/sdl/CMakeLists.txt
→
src/platform/sdl/CMakeLists.txt
@@ -1,8 +1,11 @@
set(SDL_VERSION "2" CACHE STRING "Version of SDL to use (1.2 or 2)") if (SDL_VERSION EQUAL "2") - include(FindPkgConfig) - pkg_search_module(SDL2 sdl2) + find_package(SDL2) + if (NOT SDL2_FOUND) + include(FindPkgConfig) + pkg_search_module(SDL2 sdl2) + endif() if (SDL2_FOUND) set(SDL_INCLUDE_DIR ${SDL2_INCLUDE_DIRS}) set(SDL_LIBRARY ${SDL2_LIBRARIES})