texture example
This commit is contained in:
@@ -10,31 +10,35 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH} ${CM
|
||||
|
||||
# Add Corrade as a subproject
|
||||
add_subdirectory(corrade EXCLUDE_FROM_ALL)
|
||||
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
|
||||
|
||||
# Add Magnum as a subproject, enable Sdl2Application
|
||||
set(MAGNUM_WITH_SDL2APPLICATION ON CACHE BOOL "" FORCE)
|
||||
set(MAGNUM_WITH_TGAIMPORTER ON CACHE BOOL "" FORCE)
|
||||
add_subdirectory(magnum EXCLUDE_FROM_ALL)
|
||||
find_package(Magnum REQUIRED GL Sdl2Application Trade TgaImporter)
|
||||
|
||||
find_package(Magnum REQUIRED GL Sdl2Application)
|
||||
message(STATUS "Magnum found: ${MAGNUM_FOUND}")
|
||||
|
||||
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
|
||||
corrade_add_resource(RESOURCES Assets/resources.conf)
|
||||
|
||||
include_directories(include)
|
||||
|
||||
# Set the sources, allows VS to filter them properly
|
||||
file(GLOB SOURCES "*.cpp")
|
||||
file(GLOB HEADERS "*.h")
|
||||
# Set the sources, allows VS to filter them properly
|
||||
file(GLOB SOURCES "src/*.cpp")
|
||||
file(GLOB HEADERS "src/*.h")
|
||||
include_directories(include)
|
||||
|
||||
add_executable(${PNAME} ${SOURCES} Bird.cpp Bird.h Pipe.cpp Pipe.h)
|
||||
add_executable(${PNAME} ${SOURCES}
|
||||
${RESOURCES})
|
||||
|
||||
add_dependencies(${PNAME} Magnum::TgaImporter)
|
||||
|
||||
target_link_libraries(${PNAME} PRIVATE
|
||||
Corrade::Main
|
||||
Magnum::Application
|
||||
Magnum::GL
|
||||
Magnum::Magnum)
|
||||
|
||||
# Link CL, GL, and SFML
|
||||
target_link_libraries (${PNAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
|
||||
Magnum::Magnum
|
||||
Magnum::Trade)
|
||||
|
||||
# Setup to use C++11 + others
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
Reference in New Issue
Block a user