-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
44 lines (36 loc) · 1.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.25)
# (wontfix) I wasted many hours trying to find a "reliable way" to avoid repeated cloning for different configurations. Now I'd rather let it go.
# Note to self: don't bother with this problem anymore.
include(FetchContent)
set(FETCHCONTENT_QUIET FALSE)
set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
FetchContent_Declare(
SDL2
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_TAG 9519b9916cd29a14587af0507292f2bd31dd5752 #release-2.30.7
GIT_PROGRESS TRUE
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(SDL2)
project(Moody)
file(GLOB imgui_src CONFIGURE_DEPENDS imgui/* imgui/backends/*)
add_executable(${PROJECT_NAME} WIN32
${imgui_src}
src/rule.hpp
src/tile_base.hpp
src/tile.hpp
src/rule_algo.hpp
src/dear_imgui.hpp
src/common.hpp
src/apply_rule.cpp
src/edit_rule.cpp
src/docs.cpp
src/load_rule.cpp
src/frame_main.cpp
src/main.cpp
)
# https://stackoverflow.com/questions/47690822/possible-to-force-cmake-msvc-to-use-utf-8-encoding-for-source-files-without-a-bo
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
target_include_directories(${PROJECT_NAME} PRIVATE src imgui imgui/backends)
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2-static SDL2::SDL2main)