Skip to content

Instantly share code, notes, and snippets.

@seven332
Last active June 14, 2016 10:27
Show Gist options
  • Save seven332/d985394de63ca68b91742128d9ca3c40 to your computer and use it in GitHub Desktop.
Save seven332/d985394de63ca68b91742128d9ca3c40 to your computer and use it in GitHub Desktop.
# Include
find_path(SDL2_INCLUDE_DIR SDL2/SDL.h)
if(SDL2_INCLUDE_DIR)
set(SDL2_INCLUDE_DIR2 ${SDL2_INCLUDE_DIR}/SDL2)
endif(SDL2_INCLUDE_DIR)
# Lib
find_library(SDL2_MAIN_LIBRARY NAMES SDL2main)
find_library(SDL2_LIBRARY NAMES SDL2)
# Done
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
SDL2
REQUIRED_VARS SDL2_LIBRARY SDL2_MAIN_LIBRARY SDL2_INCLUDE_DIR SDL2_INCLUDE_DIR2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment