Skip to content

Instantly share code, notes, and snippets.

@junwatu
Last active February 16, 2019 13:37
Show Gist options
  • Save junwatu/e556c38d0f0474556e884963b22af9d3 to your computer and use it in GitHub Desktop.
Save junwatu/e556c38d0f0474556e884963b22af9d3 to your computer and use it in GitHub Desktop.
Cmake SDL2
cmake_minimum_required(VERSION 3.0)
project(test)
find_path(SDL2_INCLUDE_DIR SDL2/SDL.h)
find_library(SDL2_LIBRARY SDL2)
find_library(SDL2_MAIN SDL2main)
add_executable(main main.cpp)
target_include_directories(main PUBLIC ${SDL2_INCLUDE_DIR})
target_link_libraries(main PRIVATE ${SDL2_LIBRARY} ${SDL2_MAIN})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment