summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindSdl.cmake
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
committermanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
commitf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (patch)
treed8de60fc7e17edeb6f0921726c038ee54b281445 /cmake/modules/FindSdl.cmake
parentae08c8b7221bc965ac40d70e53fc8fcddb050c46 (diff)
downloadkodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.gz
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.bz2
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.zip
sync with upstream
Diffstat (limited to 'cmake/modules/FindSdl.cmake')
-rw-r--r--cmake/modules/FindSdl.cmake29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/modules/FindSdl.cmake b/cmake/modules/FindSdl.cmake
new file mode 100644
index 0000000..81c1793
--- /dev/null
+++ b/cmake/modules/FindSdl.cmake
@@ -0,0 +1,29 @@
1#.rst:
2# FindSDL
3# -------
4# Finds the SDL library
5#
6# This will will define the following variables::
7#
8# SDL_FOUND - system has SDL
9# SDL_INCLUDE_DIRS - the SDL include directory
10# SDL_LIBRARIES - the SDL libraries
11# SDL_DEFINITIONS - the SDL compile definitions
12
13if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_SDL sdl QUIET)
15endif()
16
17find_path(SDL_INCLUDE_DIR SDL/SDL.h PATHS ${PC_SDL_INCLUDE_DIR})
18find_library(SDL_LIBRARY NAMES SDL PATHS ${PC_SDL_LIBDIR})
19
20include(FindPackageHandleStandardArgs)
21find_package_handle_standard_args(Sdl REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR)
22
23if(SDL_FOUND)
24 set(SDL_LIBRARIES ${SDL_LIBRARY})
25 set(SDL_INCLUDE_DIRS ${SDL_INCLUDE_DIR})
26 set(SDL_DEFINITIONS -DHAVE_SDL=1)
27endif()
28
29mark_as_advanced(SDL_LIBRARY SDL_INCLUDE_DIR)