| 1 |
#.rst: |
| 2 |
# FindSdl2 |
| 3 |
# ------- |
| 4 |
# Finds the SDL2 library |
| 5 |
# |
| 6 |
# This will will define the following variables:: |
| 7 |
# |
| 8 |
# SDL2_FOUND - system has SDL2 |
| 9 |
# SDL2_INCLUDE_DIRS - the SDL2 include directory |
| 10 |
# SDL2_LIBRARIES - the SDL2 libraries |
| 11 |
# SDL2_DEFINITIONS - the SDL2 compile definitions |
| 12 |
|
| 13 |
find_path(SDL2_INCLUDE_DIR NAMES SDL2/SDL.h) |
| 14 |
find_library(SDL2_LIBRARY NAMES SDL2) |
| 15 |
|
| 16 |
include(FindPackageHandleStandardArgs) |
| 17 |
find_package_handle_standard_args(Sdl2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR) |
| 18 |
|
| 19 |
if(SDL2_FOUND) |
| 20 |
set(SDL2_LIBRARIES ${SDL2_LIBRARY}) |
| 21 |
set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR}) |
| 22 |
set(SDL2_DEFINITIONS -DHAVE_SDL=1 -DHAVE_SDL_VERSION=2) |
| 23 |
endif() |
| 24 |
|
| 25 |
mark_as_advanced(SDL2_LIBRARY SDL2_INCLUDE_DIR) |