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.

48 lines
1.5 KiB

8 years ago
# 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})
2 years ago
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
8 years ago
2 years ago
# Add Corrade as a subproject
add_subdirectory(corrade EXCLUDE_FROM_ALL)
2 years ago
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
2 years ago
# Add Magnum as a subproject, enable Sdl2Application
set(MAGNUM_WITH_SDL2APPLICATION ON CACHE BOOL "" FORCE)
2 years ago
set(MAGNUM_WITH_TGAIMPORTER ON CACHE BOOL "" FORCE)
2 years ago
add_subdirectory(magnum EXCLUDE_FROM_ALL)
2 years ago
find_package(Magnum REQUIRED GL Sdl2Application Trade TgaImporter)
2 years ago
message(STATUS "Magnum found: ${MAGNUM_FOUND}")
2 years ago
corrade_add_resource(RESOURCES Assets/resources.conf)
8 years ago
2 years ago
# Set the sources, allows VS to filter them properly
file(GLOB SOURCES "src/*.cpp")
file(GLOB HEADERS "src/*.h")
include_directories(include)
8 years ago
2 years ago
add_executable(${PNAME} ${SOURCES}
${RESOURCES})
2 years ago
message(STATUS "sources: ${SOURCES}")
2 years ago
add_dependencies(${PNAME} Magnum::TgaImporter)
8 years ago
2 years ago
target_link_libraries(${PNAME} PRIVATE
2 years ago
Corrade::Main
2 years ago
Magnum::Application
Magnum::GL
2 years ago
Magnum::Magnum
Magnum::Trade)
8 years ago
# 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