view cmake/FindSDL2.cmake @ 667:325be9bbc68f

buf: initial import
author David Demelier <markand@malikania.fr>
date Fri, 21 Feb 2020 15:09:53 +0100
parents 5bd9424a523a
children 8002da0f5f0b
line wrap: on
line source

# FindSDL2
# --------
#
# Find SDL2 library, this modules defines:
#
#  SDL2_LIBRARY, the name of the library to link against
#  SDL2_FOUND, if false, do not try to link to SDL
#  SDL2_INCLUDE_DIR, where to find SDL.h

find_path(
	SDL2_INCLUDE_DIR
	NAMES SDL.h
	PATH_SUFFIXES include/SDL2 include
)

find_library(SDL2_LIBRARY NAMES SDL2 SDL2-2.0 libSDL2 libSDL2-2.0)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(
	SDL2
	REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
)

set(SDL2_LIBRARIES ${SDL2_LIBRARY})
set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})

mark_as_advanced(SDL2_INCLUDE_DIR SDL2_LIBRARY)