Kart-Public/cmake/Modules/FindSDL2.cmake
Alam Ed Arias 515895dd30 cmake: Fixes to allow MSVC to compile
running is another story

Author:    Ronald Kinard <furyhunter600@gmail.com>
Date:      Wed Jan 28 02:09:03 2015 -0600

git-svn-id: https://code.orospakr.ca/svn/srb2/trunk@9013 6de4a73c-47e2-0310-b8c1-93d6ecd3f8cd
2015-03-31 18:00:13 -04:00

45 lines
864 B
CMake

# Find SDL2
# Once done, this will define
#
# SDL2_FOUND - system has SDL2
# SDL2_INCLUDE_DIRS - SDL2 include directories
# SDL2_LIBRARIES - link libraries
include(LibFindMacros)
libfind_pkg_check_modules(SDL2_PKGCONF SDL2)
# includes
find_path(SDL2_INCLUDE_DIR
NAMES SDL.h
PATHS
${SDL2_PKGCONF_INCLUDE_DIRS}
"/usr/include/SDL2"
"/usr/local/include/SDL2"
)
# library
find_library(SDL2_LIBRARY
NAMES SDL2
PATHS
${SDL2_PKGCONF_LIBRARY_DIRS}
"/usr/lib"
"/usr/local/lib"
)
find_library(SDL2_MAIN_LIBRARY
NAMES SDL2_main
PATHS
${SDL2_PKGCONF_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
# set include dir variables
set(SDL2_PROCESS_INCLUDES SDL2_INCLUDE_DIR)
set(SDL2_PROCESS_LIBS SDL2_LIBRARY)
set(SDL2_MAIN_PROCESS_INCLUDES SDL2_INCLUDE_DIR)
set(SDL2_MAIN_PROCESS_LIBS SDL2_MAIN_LIBRARY)
libfind_process(SDL2)
libfind_process(SDL2_MAIN)