cmake_minimum_required(VERSION 3.8) set(This Chess) project(${This} C CXX) enable_language(CXX) # set(SDL2_INCLUDE_DIR /usr/include/SDL2) # set(SDL2_LIBRARY /usr/lib/x86_64-linux-gnu/libSDL2.so) # list(APPEND CMAKE_MODULE_PATH SDL2_INCLUDE_DIR) # list(APPEND CMAKE_MODULE_PATH SDL2_LIBRARY) #list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2) find_package(SDL2 REQUIRED) file(GLOB FILES src/*.cpp) add_executable(${This} ${FILES}) include_directories(${SDL2_INCLUDE_DIRS}) target_link_libraries(${This} ${SDL2_LIBRARIES})