1 | # CMake info |
2 | cmake_minimum_required(VERSION 3.22) |
3 |
|
4 | project("zydeco") |
5 |
|
6 |
|
7 | # Locations |
8 | set(SOURCE_DIR "src") |
9 | set(INCLUDE_DIR "include" "include/sdl2" "include/events") |
10 |
|
11 |
|
12 | # Compile settings |
13 | set(CMAKE_CXX_STANDARD 20) |
14 | set(COMPILE_OPTIONS "-O3 -Wall -Wextra -pedantic") |
15 |
|
16 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
17 | add_compile_options (-fdiagnostics-color=always) |
18 | elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
19 | add_compile_options (-fcolor-diagnostics) |
20 | endif () |
21 |
|
22 |
|
23 | # Add source files |
24 | include_directories(${INCLUDE_DIR}) |
25 | set(PROGRAM_SOURCES |
26 | "${SOURCE_DIR}/main.cpp" |
27 | "${SOURCE_DIR}/Engine.cpp" |
28 | "${SOURCE_DIR}/util/Fault.cpp" |
29 | "${SOURCE_DIR}/util/Logger.cpp" |
30 | "${SOURCE_DIR}/sdl2/EventHandlerSDL2.cpp" |
31 | "${SOURCE_DIR}/sdl2/WindowSDL2.cpp" |
32 | ) |
33 |
|
34 |
|
35 | # Link libraries |
36 | find_package(cpptrace REQUIRED) |
37 | link_libraries("fmt" "cpptrace::cpptrace" "SDL2" "GL") |
38 |
|
39 |
|
40 | # Output |
41 | add_executable("zydeco" ${PROGRAM_SOURCES}) |
42 |
|