rendering
This commit is contained in:
@@ -6,16 +6,20 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(PNAME floppy-bird)
|
||||
project(${PNAME})
|
||||
|
||||
# Set up variables, and find SFML
|
||||
set(SFML_ROOT root CACHE STRING "User specified path")
|
||||
set(SFML_COMPONENTS graphics window system network audio)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
find_package(SFML 2.5 COMPONENTS ${SFML_COMPONENTS} REQUIRED)
|
||||
message(STATUS "SFML found: ${SFML_FOUND}")
|
||||
# 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 the directories for the main program, GL, CL and SFML's headers
|
||||
include_directories(${SFML_INCLUDE_DIR})
|
||||
include_directories(include)
|
||||
|
||||
# Set the sources, allows VS to filter them properly
|
||||
@@ -24,6 +28,11 @@ 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})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user