43 lines
910 B
CMake
43 lines
910 B
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(deep_miner)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# Compiler warnings
|
|
if(MSVC)
|
|
add_compile_options(/W4)
|
|
else()
|
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
|
endif()
|
|
|
|
include_directories(include)
|
|
|
|
# All robot + world sources (shared between game and test binaries)
|
|
set(LIB_SOURCES
|
|
src/BaseRobot.cpp
|
|
src/World.cpp
|
|
src/SortBot.cpp
|
|
src/DigDeepBot.cpp
|
|
src/RandomBot.cpp
|
|
src/SmartBot.cpp
|
|
src/LookaheadBot.cpp
|
|
)
|
|
|
|
# Main game executable
|
|
add_executable(deep_miner
|
|
${LIB_SOURCES}
|
|
src/Game.cpp
|
|
main.cpp
|
|
)
|
|
|
|
# Test executable (no Game.cpp — tests target individual classes directly)
|
|
add_executable(deep_miner_tests
|
|
${LIB_SOURCES}
|
|
tests/test_all.cpp
|
|
)
|
|
|
|
# Register with CTest so `ctest` / `cmake --build . --target test` works
|
|
enable_testing()
|
|
add_test(NAME unit_tests COMMAND deep_miner_tests)
|