cmake_minimum_required(VERSION 2.8 FATAL_ERROR) cmake_policy(SET CMP0048 NEW) #to use VERSION in project() project(game VERSION 0.1.0 LANGUAGES CXX) include(FindPkgConfig) pkg_search_module(SDL2 REQUIRED sdl2) pkg_search_module(SDL2IMAGE REQUIRED SDL2_image>=2.0.0) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.h" ) include_directories( . "${CMAKE_CURRENT_BINARY_DIR}" ${SDL2_INCLUDE_DIR} ) add_executable(${PROJECT_NAME} main.cpp ) target_link_libraries(${PROJECT_NAME} doorkeeper ${SDL2_LIBRARIES} ${SDL2IMAGE_LIBRARIES} ) #add_custom_command( # TARGET game POST_BUILD # COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/game game #)