this repo has no description
at master 60 lines 1.9 kB view raw
1# - Find SDL 2# Find the SDL libraries (asound) 3# 4# This module defines the following variables: 5# SDL_FOUND - True if SDL_INCLUDE_DIR & SDL_LIBRARY are found 6# SDL_LIBRARY - Set when SDL_LIBRARY is found 7# 8# SDL_INCLUDE_DIR - where to find SDL.h, etc. 9# 10 11#============================================================================= 12# Copyright Eric Wing 13# 14# Distributed under the OSI-approved BSD License (the "License"); 15# see accompanying file Copyright.txt for details. 16# 17# This software is distributed WITHOUT ANY WARRANTY; without even the 18# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19# See the License for more information. 20#============================================================================= 21# (To distribute this file outside of CMake, substitute the full 22# License text for the above reference.) 23 24find_path(SDL2_INCLUDE_DIR NAMES SDL.h 25 PATH_SUFFIXES include/SDL2 include 26 DOC "The SDL include directory" 27) 28 29if(CMAKE_SIZEOF_VOID_P EQUAL 4) 30 set(SDL2_LIBRARY_PATH_SUFFIXES lib/x86) 31else() 32 set(SDL2_LIBRARY_PATH_SUFFIXES lib/x64) 33endif() 34 35find_library(SDL2_LIBRARY NAMES SDL2 SDL2d sdl2 sdl2 sdl-2.0 36 PATH_SUFFIXES ${SDL2_LIBRARY_PATH_SUFFIXES} 37 DOC "The SDL library" 38) 39 40if(WIN32) 41 find_library(SDL2MAIN_LIBRARY NAMES SDL2main sdl2main 42 PATH_SUFFIXES ${SDL2_LIBRARY_PATH_SUFFIXES} 43 DOC "The SDLmain library needed on some platforms when builing an application (opposed to a library)" 44) 45else() 46 set(SDL2MAIN_LIBRARY "") 47endif() 48 49 50# handle the QUIETLY and REQUIRED arguments and set SDL_FOUND to TRUE if 51# all listed variables are TRUE 52include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) 53 54FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 55 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR 56 VERSION_VAR SDL2_VERSION_STRING) 57 58#mark_as_advanced(SDL_INCLUDE_DIR SDL_LIBRARIES) 59 60