2019-05-27 13:50:49 +02:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
project(raycasting)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
|
|
|
# Detect and add SFML
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
|
|
|
|
find_package(SFML COMPONENTS system window graphics network audio REQUIRED)
|
|
|
|
|
|
|
|
if(NOT SFML_FOUND)
|
|
|
|
message(FATAL_ERROR "SFML could not be found")
|
|
|
|
endif()
|
|
|
|
|
2024-01-26 23:00:26 +00:00
|
|
|
set(LIBS
|
2019-05-27 13:50:49 +02:00
|
|
|
sfml-window
|
2024-01-26 23:00:26 +00:00
|
|
|
sfml-graphics)
|
|
|
|
|
|
|
|
find_package(ImGui QUIET)
|
|
|
|
find_package(ImGui-SFML QUIET)
|
|
|
|
|
|
|
|
if(NOT ImGui_FOUND OR NOT ImGui-SFML_FOUND OR NO_IMGUI)
|
|
|
|
message("*Not* building with ImGui")
|
|
|
|
else ()
|
|
|
|
message("Building with ImGui")
|
|
|
|
add_compile_definitions(IMGUI)
|
|
|
|
set(LIBS ${LIBS}
|
|
|
|
ImGui-SFML::ImGui-SFML)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_compile_options(-Wall -Wextra)
|
|
|
|
|
|
|
|
add_executable(raycasting
|
|
|
|
main.cpp
|
|
|
|
Player.cpp
|
|
|
|
World.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(raycasting ${LIBS})
|