You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.3 KiB

# Check versions message(STATUS "CMake version: ${CMAKE_VERSION}")
cmake_minimum_required(VERSION 3.1)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
# Set the project name
set(PNAME floppy-bird)
project(${PNAME})
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
# Add Corrade as a subproject
add_subdirectory(corrade EXCLUDE_FROM_ALL)
# Add Magnum as a subproject, enable Sdl2Application
set(MAGNUM_WITH_SDL2APPLICATION ON CACHE BOOL "" FORCE)
add_subdirectory(magnum EXCLUDE_FROM_ALL)
find_package(Magnum REQUIRED GL Sdl2Application)
message(STATUS "Magnum found: ${MAGNUM_FOUND}")
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
include_directories(include)
# Set the sources, allows VS to filter them properly
file(GLOB SOURCES "*.cpp")
file(GLOB HEADERS "*.h")
add_executable(${PNAME} ${SOURCES} Bird.cpp Bird.h Pipe.cpp Pipe.h)
target_link_libraries(${PNAME} PRIVATE
Magnum::Application
Magnum::GL
Magnum::Magnum)
# Link CL, GL, and SFML
target_link_libraries (${PNAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
# Setup to use C++11 + others
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 11) # Use C++11