Created
April 19, 2015 17:53
-
-
Save mazurio/a9e294c689831dc54a58 to your computer and use it in GitHub Desktop.
Basic SDL2 Template for CMAKE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.0) | |
include(FindPkgConfig) | |
project(SDL01) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
set(SOURCE_FILES main.cpp) | |
add_executable(SDL01 ${SOURCE_FILES}) | |
pkg_search_module(SDL2 REQUIRED sdl2) | |
pkg_search_module(SDL2IMAGE REQUIRED SDL2_image>=2.0.0) | |
pkg_search_module(SDL2TTF REQUIRED SDL2_ttf>=2.0.0) | |
include_directories(${SDL2_INCLUDE_DIRS} | |
${SDL2IMAGE_INCLUDE_DIRS} | |
${SDL2TTF_INCLUDE_DIRS} | |
) | |
target_link_libraries(${PROJECT_NAME} | |
${SDL2_LIBRARIES} | |
${SDL2IMAGE_LIBRARIES} | |
${SDL2TTF_LIBRARIES} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment