diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindSdl.cmake | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindSdl.cmake')
-rw-r--r-- | cmake/modules/FindSdl.cmake | 29 |
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..60959cb --- /dev/null +++ b/cmake/modules/FindSdl.cmake @@ -0,0 +1,29 @@ +#.rst: +# FindSDL +# ------- +# Finds the SDL library +# +# This will define the following variables:: +# +# SDL_FOUND - system has SDL +# SDL_INCLUDE_DIRS - the SDL include directory +# SDL_LIBRARIES - the SDL libraries +# SDL_DEFINITIONS - the SDL compile definitions + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_SDL sdl QUIET) +endif() + +find_path(SDL_INCLUDE_DIR SDL/SDL.h PATHS ${PC_SDL_INCLUDE_DIR}) +find_library(SDL_LIBRARY NAMES SDL PATHS ${PC_SDL_LIBDIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Sdl REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR) + +if(SDL_FOUND) + set(SDL_LIBRARIES ${SDL_LIBRARY}) + set(SDL_INCLUDE_DIRS ${SDL_INCLUDE_DIR}) + set(SDL_DEFINITIONS -DHAVE_SDL=1) +endif() + +mark_as_advanced(SDL_LIBRARY SDL_INCLUDE_DIR) |