forked from fips-libs/fips-turbobadger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
297 lines (273 loc) · 7.79 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
#
# project: fips-turbobadger
#
if (NOT FIPS_IMPORT)
cmake_minimum_required(VERSION 3.5)
project(fips-turbobadger)
# include the fips main cmake file
get_filename_component(FIPS_ROOT_DIR "../fips" ABSOLUTE)
include("${FIPS_ROOT_DIR}/cmake/fips.cmake")
fips_setup()
endif()
option(TB_ENABLE_RTTI "Do not disable RTTI" OFF)
if (NOT FIPS_EXCEPTIONS)
set(TB_NO_EXCEPTIONS "-fno-exceptions")
endif()
if (NOT TB_ENABLE_RTTI)
set(TB_NO_RTTI "-fno-rtti")
endif()
if (FIPS_WINDOWS)
add_definitions(-DGLFW_EXPOSE_NATIVE_WIN32)
add_definitions(-DGLFW_EXPOSE_NATIVE_WGL)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-DTB_USE_CURRENT_DIRECTORY)
elseif (FIPS_LINUX)
elseif (FIPS_MACOS)
add_definitions(-DMACOSX)
add_definitions(-Dnullptr=0)
add_definitions(-DTB_USE_CURRENT_DIRECTORY)
endif()
fips_begin_lib(turbobadger)
fips_dir(config)
fips_files(
tb_config.h
)
fips_dir(turbobadger/src/tb/animation)
fips_files(
tb_animation_utils.h
tb_animation.cpp
tb_animation.h
tb_widget_animation.cpp
tb_widget_animation.h
)
fips_dir(turbobadger/src/tb/image)
fips_files(
tb_image_manager.cpp
tb_image_manager.h
tb_image_widget.cpp
tb_image_widget.h
)
fips_dir(turbobadger/src/tb/parser)
fips_files(
tb_parser.cpp
tb_parser.h
)
fips_dir(turbobadger/src/tb/platform)
fips_files(
tb_clipboard_interface.h
tb_clipboard_interface_dummy.cpp
tb_clipboard_interface_dummy.h
tb_file_interface.h
tb_system_interface.h
)
fips_dir(turbobadger/src/tb/renderers)
fips_files(
tb_renderer_batcher.cpp
tb_renderer_batcher.h
)
#fips_dir(turbobadger/src/tb/tests)
# fips_files(
# tb_test.cpp
# tb_test.h
# test_tb_color.cpp
# test_tb_dimension.cpp
# test_tb_geometry.cpp
# test_tb_hashtable.cpp
# test_tb_linklist.cpp
# test_tb_node_ref_tree.cpp
# test_tb_object.cpp
# test_tb_parser_definitions.tb.txt
# test_tb_parser_included.tb.txt
# test_tb_parser.cpp
# test_tb_parser.tb.txt
# test_tb_space_allocator.cpp
# test_tb_style_edit.cpp
# test_tb_tempbuffer.cpp
# test_tb_test.cpp
# test_tb_value.cpp
# test_tb_widget_value.cpp
# )
fips_dir(turbobadger/src/tb/thirdparty)
fips_files(
stb_image.h
stb_truetype.h
)
fips_dir(turbobadger/src/tb/utf8)
fips_files(
utf8.cpp
utf8.h
)
fips_dir(turbobadger/src/tb)
fips_files(
tb_bitmap_fragment.cpp
tb_bitmap_fragment.h
tb_blur.cpp
tb_blur.h
tb_color.cpp
tb_color.h
# tb_config.h
tb_core.cpp
tb_core.h
tb_debug.cpp
tb_debug.h
tb_dimension.cpp
tb_dimension.h
tb_editfield.cpp
tb_editfield.h
tb_font_desc.h
tb_font_renderer.cpp
tb_font_renderer.h
# tb_font_renderer_freetype.cpp
# tb_font_renderer_stb.cpp
tb_font_renderer_tbbf.cpp
tb_geometry.cpp
tb_geometry.h
tb_hash.cpp
tb_hash.h
tb_hashtable.cpp
tb_hashtable.h
tb_id.cpp
tb_id.h
tb_image_loader_stb.cpp
tb_inline_select.cpp
tb_inline_select.h
tb_language.cpp
tb_language.h
tb_layout.cpp
tb_layout.h
tb_linklist.cpp
tb_linklist.h
tb_list.cpp
tb_list.h
tb_menu_window.cpp
tb_menu_window.h
tb_message_window.cpp
tb_message_window.h
tb_msg.cpp
tb_msg.h
tb_node_ref_tree.cpp
tb_node_ref_tree.h
tb_node_tree.cpp
tb_node_tree.h
tb_object.cpp
tb_object.h
tb_popup_window.cpp
tb_popup_window.h
tb_renderer.cpp
tb_renderer.h
tb_scroller.cpp
tb_scroller.h
tb_scroll_container.cpp
tb_scroll_container.h
tb_select.cpp
tb_select.h
tb_select_item.cpp
tb_select_item.h
tb_shape_rasterizer.cpp
tb_shape_rasterizer.h
tb_skin.cpp
tb_skin.h
tb_skin_util.cpp
tb_skin_util.h
tb_sort.h
tb_str.cpp
tb_str.h
tb_style_edit.cpp
tb_style_edit.h
tb_style_edit_content.cpp
tb_style_edit_content.h
tb_tab_container.cpp
tb_tab_container.h
tb_tempbuffer.cpp
tb_tempbuffer.h
tb_toggle_container.cpp
tb_toggle_container.h
tb_types.h
tb_value.cpp
tb_value.h
tb_widgets.cpp
tb_widgets.h
tb_widgets_common.cpp
tb_widgets_common.h
tb_widgets_listener.cpp
tb_widgets_listener.h
tb_widgets_reader.cpp
tb_widgets_reader.h
tb_widget_skin_condition_context.cpp
tb_widget_skin_condition_context.h
tb_widget_value.cpp
tb_widget_value.h
tb_window.cpp
tb_window.h
)
fips_end_lib()
#if (NOT FIPS_IMPORT)
# if (FIPS_MACOS OR FIPS_LINUX OR FIPS_WINDOWS)
# fips_begin_app(demo windowed)
# include_directories(turbobadger/Demo)
# include_directories(turbobadger/Demo/demo01)
# include_directories(turbobadger/Demo/platform)
# fips_dir(turbobadger/Demo/platform)
# fips_files(
# Application.cpp
# Application.h
# glfw_extra.h
# glfw_extra_linux.cpp
# glfw_extra_win.cpp
# port_glfw.cpp
# )
# fips_dir(turbobadger/Demo/demo01)
# fips_files(
# Demo.h
# Demo01.cpp
# ListWindow.cpp
# ListWindow.h
# ResourceEditWindow.cpp
# ResourceEditWindow.h
# )
# fips_deps(turbobadger glfw3)
#
# if (FIPS_WINDOWS)
# fips_libs(opengl32 winmm)
# endif()
#
# if (FIPS_LINUX)
# fips_libs(X11 Xrandr Xi Xinerama Xxf86vm Xcursor GL m)
# endif()
#
# if (FIPS_MACOS)
# fips_libs(m)
# endif()
# fips_end_app()
# endif()
# if (FIPS_ANDROID)
# # demo android
# endif()
#
# if (FIPS_CLANG)
# set_target_properties(demo PROPERTIES COMPILE_FLAGS "${TB_NO_EXCEPTIONS} ${TB_NO_RTTI} -Wall -Wextra -Wno-unused-parameter -Wno-unused-function")
# elseif(FIPS_GCC)
# set_target_properties(demo PROPERTIES COMPILE_FLAGS "${TB_NO_EXCEPTIONS} ${TB_NO_RTTI} -Wall -Wextra -Wno-unused-parameter -Wno-unused-function")
# endif()
#endif()
target_compile_definitions(turbobadger PUBLIC TB_STATIC=1)
if (FIPS_CLANG)
set_target_properties(turbobadger PROPERTIES COMPILE_FLAGS "${TB_NO_EXCEPTIONS} ${TB_NO_RTTI} -Wall -Wextra -Wno-unused-parameter -Wno-unused-function")
elseif(FIPS_GCC)
set_target_properties(turbobadger PROPERTIES COMPILE_FLAGS "${TB_NO_EXCEPTIONS} ${TB_NO_RTTI} -Wall -Wextra -Wno-unused-parameter -Wno-unused-function")
elseif(FIPS_MSVC)
if (NOT FIPS_EXCEPTIONS)
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # -fno-exceptions
endif()
if (NOT TB_ENABLE_RTTI)
string(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # -fno-rtti
endif()
string(REPLACE "/WX" "/WX-" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # disable warning as error due GCC pragmas
target_compile_options(turbobadger PUBLIC /wd4267)
endif()
if (NOT FIPS_IMPORT)
# fips_finish()
target_include_directories(turbobadger PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
target_include_directories(turbobadger PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/turbobadger/src/tb)
endif()