-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
160 lines (142 loc) · 5.17 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# CMakeList.txt : Top-level CMake project file, do global configuration
# and include sub-projects here.
#
cmake_minimum_required (VERSION 3.8)
# Require C++23 for stacktrace etc
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()
project(JuniorsToolbox)
file(GLOB TOOLBOX_SRC
"lib/*.hpp"
"lib/*.cpp"
"src/*.cpp"
"include/*.hpp"
"include/*.h"
"src/bmg/*.cpp"
"include/bmg/*.hpp"
"src/bti/*.cpp"
"include/bti/*.hpp"
"src/core/*.cpp"
"include/core/*.hpp"
"src/core/application/*.cpp"
"include/core/application/*.hpp"
"src/core/event/*.cpp"
"include/core/event/*.hpp"
"src/core/input/*.cpp"
"include/core/input/*.hpp"
"src/core/mimedata/*.cpp"
"include/core/mimedata/*.hpp"
"src/core/keybind/*.cpp"
"include/core/keybind/*.hpp"
"src/core/time/*.cpp"
"include/core/time/*.hpp"
"src/dolphin/*.cpp"
"include/dolphin/*.hpp"
"src/dolphin/interpreter/*.cpp"
"include/dolphin/interpreter/*.hpp"
"src/dolphin/interpreter/instructions/*.cpp"
"include/dolphin/interpreter/instructions/*.hpp"
"src/game/*.cpp"
"include/game/*.hpp"
"src/gui/dolphin/*.cpp"
"include/gui/dolphin/*.hpp"
"src/gui/event/*.cpp"
"include/gui/event/*.hpp"
"src/gui/dragdrop/*.cpp"
"include/gui/dragdrop/*.hpp"
"src/gui/image/*.cpp"
"include/gui/image/*.hpp"
"src/gui/layer/*.cpp"
"include/gui/layer/*.hpp"
"src/gui/pad/*.cpp"
"include/gui/pad/*.hpp"
"src/gui/widget/*.cpp"
"include/gui/widget/*.hpp"
"src/image/*.cpp"
"include/image/*.hpp"
"src/objlib/*.cpp"
"include/objlib/*.hpp"
"src/pad/*.cpp"
"include/pad/*.hpp"
"src/platform/*.cpp"
"include/platform/*.hpp"
"src/rail/*.cpp"
"include/rail/*.hpp"
"src/rarc/*.cpp"
"include/rarc/*.hpp"
"src/resource/*.cpp"
"include/resource/*.hpp"
"src/scene/*.cpp"
"include/scene/*.hpp"
"src/window/*.cpp"
"include/window/*.hpp"
"src/objlib/meta/*.cpp"
"include/objlib/meta/*.hpp"
"src/io/*.cpp"
"src/gui/*.cpp"
"include/gui/*.hpp"
"src/gui/logging/*.cpp"
"include/gui/logging/*.hpp"
"src/gui/settings/*.cpp"
"include/gui/settings/*.hpp"
"src/gui/scene/*.cpp"
"include/gui/scene/*.hpp"
"src/gui/property/*.cpp"
"include/gui/property/*.hpp"
"include/io/*.hpp"
"lib/ImGuiFileDialog/*.h"
"lib/ImGuiFileDialog/*.cpp"
)
add_executable(JuniorsToolbox ${TOOLBOX_SRC})
include(lib/imgui.cmake)
add_subdirectory(lib/J3DUltra)
add_subdirectory(lib/libbti)
add_subdirectory(lib/glfw)
add_subdirectory(lib/nativefiledialog-extended)
if(MSVC)
# target_compile_options(j3dultra PRIVATE /w)
target_compile_options(JuniorsToolbox PRIVATE /FS /MP)
else()
# target_compile_options(j3dultra PRIVATE -w)
endif()
# find_package(ICU 61.0 COMPONENTS uc i18n REQUIRED)
find_package(Iconv REQUIRED)
if(CMAKE_COMPILER_IS_GNUCXX)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED gtk+-3.0)
include_directories(${GTK_INCLUDE_DIRS})
target_link_libraries(JuniorsToolbox PRIVATE j3dultra imgui glfw ${ICONV_LIBRARIES} tbb X11 GL ${GTK_LIBRARIES})
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14)
target_link_libraries(JuniorsToolbox PRIVATE stdc++exp)
else()
target_link_libraries(JuniorsToolbox PRIVATE stdc++_libbacktrace)
endif()
else()
# target_link_libraries(JuniorsToolbox PRIVATE j3dultra imgui glfw ICU::uc ICU::i18n)
target_link_libraries(JuniorsToolbox PRIVATE j3dultra imgui glfw Iconv::Iconv)
endif()
target_link_libraries(JuniorsToolbox PRIVATE nfd)
if (WIN32)
# link this library so we can find Nahimic service
# this is because it crashes window corner resizing :P
target_link_libraries(JuniorsToolbox PRIVATE Advapi32)
endif()
target_compile_definitions(JuniorsToolbox PRIVATE NOMINMAX IMGUI_DEFINE_MATH_OPERATORS)
target_include_directories(JuniorsToolbox PRIVATE "include" "lib" "lib/imgui" "lib/imgui/backends" "lib/nlohmann" "lib/glm::glm" "lib/J3DUltra" "lib/libbti" "lib/ImGuiFileDialog" "lib/glfw" "lib/nativefiledialog-extended/src/include")
add_custom_command(TARGET JuniorsToolbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Fonts/ $<TARGET_FILE_DIR:JuniorsToolbox>/Fonts/)
add_custom_command(TARGET JuniorsToolbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Images/ $<TARGET_FILE_DIR:JuniorsToolbox>/Images/)
add_custom_command(TARGET JuniorsToolbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Templates/ $<TARGET_FILE_DIR:JuniorsToolbox>/Templates/)
add_custom_command(TARGET JuniorsToolbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Themes/ $<TARGET_FILE_DIR:JuniorsToolbox>/Themes/)