-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
86 lines (75 loc) · 3.64 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required(VERSION 3.28)
set(CMAKE_GENERATOR_PLATFORM win32)
set(CMAKE_SYSTEM_VERSION 10.0)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_DEBUG_POSTFIX "")
add_compile_options(/MP /Gy /GS- /utf-8)
add_compile_definitions(_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS)
add_link_options(/OPT:REF /INCREMENTAL:NO /level='requireAdministrator' /uiAccess='false')
# add_compile_definitions(YRTR_LOG_STD)
add_compile_definitions(YRTR_LOG_DBGVIEW)
add_compile_definitions(YRTR_LOG_FILE)
project(ra2_trainer)
find_package(OpenGL REQUIRED)
set(FMT_DOC OFF CACHE BOOL "disable fmt doc")
set(FMT_TEST OFF CACHE BOOL "disable fmt test")
set(FMT_INSTALL OFF CACHE BOOL "disable fmt install target")
add_subdirectory(deps/fmt)
# https://www.glfw.org/docs/latest/build_guide.html
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "disable glfw examples")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "disable glfw tests")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "disable glfw docs")
set(GLFW_INSTALL OFF CACHE BOOL "use glfw as a submodule")
add_subdirectory(deps/glfw)
add_subdirectory(deps/tomlplusplus)
set(IMGUI_INCLUDES deps/imgui
deps/imgui/backends)
set(IMGUI_SOURCES deps/imgui/imgui.cpp
deps/imgui/imgui_demo.cpp
deps/imgui/imgui_draw.cpp
deps/imgui/imgui_tables.cpp
deps/imgui/imgui_widgets.cpp
deps/imgui/backends/imgui_impl_glfw.cpp
deps/imgui/backends/imgui_impl_opengl3.cpp
deps/imgui/backends/imgui_impl_win32.cpp)
add_library(libimgui STATIC ${IMGUI_SOURCES})
target_include_directories(libimgui
PUBLIC deps/glfw
PUBLIC deps/glfw/include
PUBLIC ${IMGUI_INCLUDES})
add_subdirectory(src/aa_engine)
add_executable(${PROJECT_NAME} WIN32 src/bin/main.cpp
src/config.cpp
src/logging.cpp
src/timer.cpp
src/gui.cpp
src/win32utils.cpp
src/trainer.cpp)
target_include_directories(${PROJECT_NAME} PRIVATE deps/fmt/include
PRIVATE deps/glfw
PRIVATE deps/glfw/include
PRIVATE deps/tomlplusplus/include
PRIVATE ${IMGUI_INCLUDES}
PRIVATE src)
target_compile_options(${PROJECT_NAME} PRIVATE /W4
PRIVATE /WX)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL
PRIVATE libimgui
PRIVATE glfw
PRIVATE fmt::fmt
PRIVATE aa_engine
PRIVATE tomlplusplus::tomlplusplus)
add_executable(disasm src/bin/test_disasm.cpp
src/logging.cpp
src/win32utils.cpp)
target_include_directories(disasm PRIVATE deps/fmt/include
PRIVATE deps/glfw
PRIVATE deps/glfw/include
PRIVATE deps/tomlplusplus/include
PRIVATE ${IMGUI_INCLUDES}
PRIVATE src)
target_link_libraries(disasm PRIVATE fmt::fmt
PRIVATE aa_engine)