123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- cmake_minimum_required(VERSION 3.27)
- project(Snake)
- set(CMAKE_CXX_STANDARD
- set(CMAKE_CXX_STANDARD_REQUIRED
- set(CMAKE_CXX_EXTENSIONS
- include(FetchContent)
- FetchContent_Declare(
- SDL2
- GIT_REPOSITORY ///libsdl-org/
- GIT_TAG
- FIND_PACKAGE_ARGS
- )
- FetchContent_Declare(
- SDL2_image
- GIT_REPOSITORY ///libsdl-org/
- GIT_TAG
- FIND_PACKAGE_ARGS
- )
- FetchContent_Declare(
- SDL2_ttf
- GIT_REPOSITORY ///libsdl-org/
- GIT_TAG
- FIND_PACKAGE_ARGS
- )
- FetchContent_MakeAvailable(SDL2
- set(Boost_USE_MULTITHREADED
- set(Boost_USE_STATIC_LIBS
- set(Boost_USE_STATIC_RUNTIME
- find_package(Boost
- add_executable(Snake
- main.cxx
- SDL.cxx
- SDLWindow.cxx
- SDLRenderer.cxx
- game/GameState.hxx
- game/GameStateManager.cxx /GameStateManager.hxx
- game//LoadingState.hxx
- game//SplashState.hxx
- game//MenuState.hxx
- game//PlayingState.hxx
- game//GameOverState.hxx
- game//HighScoreState.hxx
- game//DummyState.hxx
- game//AssetManager.hxx
- game//Button.cxx game//Button.hxx
- game//LineInput.cxx game//LineInput.hxx
- game//UiColor.hxx game//UiColor.cxx
- game//HighScoreManager.hxx
- )
- target_link_libraries(Snake PRIVATE
- SDL2::SDL2-static SDL2::SDL2main
- SDL2_image::SDL2_image-static
- SDL2_ttf::SDL2_ttf-static
- Boost::headers Boost::serialization Boost::program_options
- )
|