forked from Mudlet/Mudlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
579 lines (528 loc) · 18.4 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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
############################################################################
# Copyright (C) 2014-2017 by Ahmed Charles - acharles@outlook.com #
# Copyright (C) 2015-2018 by Stephen Lyons - slysven@virginmedia.com #
# Copyright (C) 2018 by Huadong Qi - novload@outlook.com #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
############################################################################
set(mudlet_RCCS mudlet.qrc)
if(USE_FONTS)
set(mudlet_fonts_RCCS mudlet_fonts.qrc)
add_definitions(-DINCLUDE_FONTS)
endif()
set(mudlet_SRCS
ActionUnit.cpp
AliasUnit.cpp
ctelnet.cpp
discord.cpp
dlgAboutDialog.cpp
dlgActionMainArea.cpp
dlgAliasMainArea.cpp
dlgColorTrigger.cpp
dlgComposer.cpp
dlgConnectionProfiles.cpp
dlgIRC.cpp
dlgKeysMainArea.cpp
dlgMapper.cpp
dlgNotepad.cpp
dlgPackageExporter.cpp
dlgProfilePreferences.cpp
dlgRoomExits.cpp
dlgScriptsMainArea.cpp
dlgSourceEditorArea.cpp
dlgSystemMessageArea.cpp
dlgTimersMainArea.cpp
dlgTriggerEditor.cpp
dlgTriggerPatternEdit.cpp
dlgTriggersMainArea.cpp
dlgVarsMainArea.cpp
EAction.cpp
exitstreewidget.cpp
FontManager.cpp
glwidget.cpp
Host.cpp
HostManager.cpp
ircmessageformatter.cpp
KeyUnit.cpp
LuaInterface.cpp
main.cpp
mudlet.cpp
ScriptUnit.cpp
T2DMap.cpp
TAction.cpp
TAlias.cpp
TArea.cpp
TBuffer.cpp
TCommandLine.cpp
TConsole.cpp
TDebug.cpp
TDockWidget.cpp
TEasyButtonBar.cpp
TFlipButton.cpp
TForkedProcess.cpp
TimerUnit.cpp
TKey.cpp
TLabel.cpp
TLuaInterpreter.cpp
TMap.cpp
TriggerUnit.cpp
TRoom.cpp
TRoomDB.cpp
TScript.cpp
TSplitter.cpp
TSplitterHandle.cpp
TTabBar.cpp
TTextEdit.cpp
TTimer.cpp
TToolBar.cpp
TTreeWidget.cpp
TTrigger.cpp
TVar.cpp
VarUnit.cpp
wcwidth.cpp
XMLexport.cpp
XMLimport.cpp
)
# This is for compiled UI files, not those used at runtime though the resource file.
set(mudlet_UIS
ui/about_dialog.ui
ui/actions_main_area.ui
ui/aliases_main_area.ui
ui/color_trigger.ui
ui/composer.ui
ui/connection_profiles.ui
ui/dlgPackageExporter.ui
ui/irc.ui
ui/keybindings_main_area.ui
ui/main_window.ui
ui/mapper.ui
ui/notes_editor.ui
ui/profile_preferences.ui
ui/room_exits.ui
ui/scripts_main_area.ui
ui/source_editor_area.ui
ui/system_message_area.ui
ui/timers_main_area.ui
ui/triggers_main_area.ui
ui/trigger_editor.ui
ui/trigger_pattern_edit.ui
ui/vars_main_area.ui)
set(mudlet_MOC_HDRS
ctelnet.h
discord.h
dlgAboutDialog.h
dlgActionMainArea.h
dlgAliasMainArea.h
dlgColorTrigger.h
dlgComposer.h
dlgConnectionProfiles.h
dlgIRC.h
dlgKeysMainArea.h
dlgMapper.h
dlgNotepad.h
dlgPackageExporter.h
dlgProfilePreferences.h
dlgRoomExits.h
dlgScriptsMainArea.h
dlgSourceEditorArea.h
dlgSystemMessageArea.h
dlgTimersMainArea.h
dlgTriggerEditor.h
dlgTriggerPatternEdit.h
dlgTriggersMainArea.h
dlgVarsMainArea.h
EAction.h
exitstreewidget.h
glwidget.h
Host.h
mudlet.h
T2DMap.h
TCommandLine.h
TConsole.h
TEasyButtonBar.h
TForkedProcess.h
TLabel.h
TLuaInterpreter.h
TMap.h
TSplitter.h
TSplitterHandle.h
TTextEdit.h
TToolBar.h
TTreeWidget.h
XMLexport.h
)
set(mudlet_HDRS
ActionUnit.h
AliasUnit.h
discord.h
FontManager.h
HostManager.h
ircmessageformatter.h
KeyUnit.h
LuaInterface.h
post_guard.h
pre_guard.h
ScriptUnit.h
TAction.h
TAlias.h
TArea.h
TAstar.h
TBuffer.h
TDebug.h
TDockWidget.h
testdbg.h
TEvent.h
TFlipButton.h
TimerUnit.h
TKey.h
TMatchState.h
Tree.h
TriggerUnit.h
TRoom.h
TRoomDB.h
TScript.h
TSplitterHandle.h
TTabBar.h
TTimer.h
TTrigger.h
TVar.h
VarUnit.h
wcwidth.h
XMLimport.h
)
if(USE_UPDATER)
list(APPEND mudlet_SRCS updater.cpp)
list(APPEND mudlet_MOC_HDRS updater.h)
endif(USE_UPDATER)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP") # parallel builds
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zc:inline") # improve link times
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zc:rvalueCast") # improve conformance
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4305") # '=' : truncation from 'double' to 'float'
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4309") # 'initializing' : truncation of constant value
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4996") # deprecation
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
endif()
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(PCRE_DIR "${PROJECT_SOURCE_DIR}/.." CACHE PATH "PCRE install directory.")
set(YAJL_DIR "${PROJECT_SOURCE_DIR}/.." CACHE PATH "YAJL install directory.")
set(HUNSPELL_DIR "${PROJECT_SOURCE_DIR}/.." CACHE PATH "HUNSPELL install directory.")
set(ZIP_DIR "${PROJECT_SOURCE_DIR}/.." CACHE PATH "ZIP install directory.")
if(EXISTS "${PROJECT_SOURCE_DIR}/../include/lua.h")
set(LUA_INCLUDE_DIR_TEMP "${PROJECT_SOURCE_DIR}/../include")
get_filename_component(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR_TEMP} ABSOLUTE CACHE)
if(EXISTS "${PROJECT_SOURCE_DIR}/../lib/lualib.lib")
set(LUA_LIBRARY_RELEASE_TEMP "${PROJECT_SOURCE_DIR}/../lib/lualib.lib")
get_filename_component(LUA_LIBRARY_RELEASE ${LUA_LIBRARY_RELEASE_TEMP} ABSOLUTE CACHE)
endif()
if(EXISTS "${PROJECT_SOURCE_DIR}/../lib/lualibd.lib")
set(LUA_LIBRARY_DEBUG_TEMP "${PROJECT_SOURCE_DIR}/../lib/lualibd.lib")
get_filename_component(LUA_LIBRARY_DEBUG ${LUA_LIBRARY_DEBUG_TEMP} ABSOLUTE CACHE)
endif()
if(LUA_LIBRARY_DEBUG AND LUA_LIBRARY_RELEASE)
set(LUA_LIBRARY optimized ${LUA_LIBRARY_RELEASE} debug ${LUA_LIBRARY_DEBUG} )
elseif(LUA_LIBRARY_RELEASE)
set(LUA_LIBRARY ${LUA_LIBRARY_RELEASE} )
elseif(LUA_LIBRARY_DEBUG)
set(LUA_LIBRARY ${LUA_LIBRARY_DEBUG} )
endif()
endif()
if(WIN32)
if(EXISTS "${PROJECT_SOURCE_DIR}/../include/zlib.h")
set(ZLIB_INCLUDE_DIR_TEMP "${PROJECT_SOURCE_DIR}/../include")
get_filename_component(ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIR_TEMP} ABSOLUTE CACHE)
set(ZLIB_ROOT "${PROJECT_SOURCE_DIR}/..")
if(EXISTS "${PROJECT_SOURCE_DIR}/../lib/zlibstat.lib")
set(ZLIB_LIBRARY_RELEASE_TEMP "${PROJECT_SOURCE_DIR}/../lib/zlibstat.lib")
get_filename_component(ZLIB_LIBRARY_RELEASE ${ZLIB_LIBRARY_RELEASE_TEMP} ABSOLUTE CACHE)
endif()
if(EXISTS "${PROJECT_SOURCE_DIR}/../lib/zlibstatd.lib")
set(ZLIB_LIBRARY_DEBUG_TEMP "${PROJECT_SOURCE_DIR}/../lib/zlibstatd.lib")
get_filename_component(ZLIB_LIBRARY_DEBUG ${ZLIB_LIBRARY_DEBUG_TEMP} ABSOLUTE CACHE)
endif()
if(ZLIB_LIBRARY_DEBUG AND ZLIB_LIBRARY_RELEASE)
set(ZLIB_LIBRARY optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG} )
elseif(ZLIB_LIBRARY_RELEASE)
set(ZLIB_LIBRARY ${ZLIB_LIBRARY_RELEASE} )
elseif(ZLIB_LIBRARY_DEBUG)
set(ZLIB_LIBRARY ${ZLIB_LIBRARY_DEBUG} )
endif()
endif()
endif()
# Break each step into a separate command so any status message is output straight away
if(APPLE)
# The include directory setup for Zip is unusual in that as well as e.g. /usr/include/zip.h
# we need the path to an interal header zipconf.h that it calls for using '<''>'s
# i.e. SYSTEM #include delimiters which are typically located at e.g. /usr/lib/libzip/include/zipconf.h
# and using pkg-config is the recommended way to get the details.
# Spotted recommendation to use pkg-config here https://github.com/Homebrew/homebrew/issues/13390
find_package(PkgConfig)
if(NOT(PKG_CONFIG_FOUND))
message(WARNING "Unable to use pkg_config - will possibly fail to find/use Zip library...")
endif()
endif()
if((APPLE) AND (PKG_CONFIG_FOUND))
PKG_SEARCH_MODULE(PC_ZIP zip libzip)
# Use a PC_ prefix to distinguish between what pkg-config finds and a direct use of find_package(ZIP)
# Package "zip" is called "libzip" at least on MY Linux box so look for BOTH
if(PC_ZIP_FOUND)
if(PC_ZIP_zip_FOUND)
message(STATUS "Using pkg_config, found \"zip\" version: ${PC_ZIP_zip_VERSION} with:")
elseif(PC_ZIP_libzip_FOUND)
message(STATUS "Using pkg_config, found \"libzip\" version: ${PC_ZIP_libzip_VERSION} with:")
else()
message(STATUS "Using pkg_config, found Zip version: ${PC_ZIP_VERSION} with:")
endif()
message(STATUS " include directory(ies), ZIP_INCLUDE_DIRS: ${PC_ZIP_INCLUDE_DIRS} .")
message(STATUS " library(ies): ZIP_LIBRARY_DIRS: ${PC_ZIP_LIBRARY_DIRS}; ZIP_LIBDIR: ${PC_ZIP_LIBDIR}. ")
else()
message(WARNING "Using pkg_config, failed to find any version of Zip library!")
endif()
endif()
if((APPLE) AND (PKG_CONFIG_FOUND))
PKG_SEARCH_MODULE(PC_HUNSPELL hunspell libhunspell)
if(PC_HUNSPELL_FOUND)
if(PC_HUNSPELL_hunspell_FOUND)
message(STATUS "Using pkg_config, found \"hunspell\" version: ${PC_HUNSPELL_hunspell_VERSION} with:")
elseif(PC_HUNSPELL_libhunspell_FOUND)
message(STATUS "Using pkg_config, found \"libhunspell\" version: ${PC_HUNSPELL_libhunspell_VERSION} with:")
else()
message(STATUS "Using pkg_config, found Hunspell version: ${PC_HUNSPELL_VERSION} with:")
endif()
message(STATUS " include directory(ies), HUNSPELL_INCLUDE_DIRS: ${PC_HUNSPELL_INCLUDE_DIRS} .")
message(STATUS " library(ies): HUNSPELL_LIBRARY_DIRS: ${PC_HUNSPELL_LIBRARY_DIRS}; HUNSPELL_LIBRARY_DIR: ${PC_HUNSPELL_LIBRARY_DIR}. ")
elseif()
message(WARNING "Using pkg_config, failed to find any version of Hunspell library!")
endif()
endif()
find_package(Qt5 5.7 REQUIRED COMPONENTS Core Multimedia Network OpenGL UiTools Widgets Concurrent)
# This is not present before Qt 5.7:
find_package(Qt5 COMPONENTS Gamepad QUIET)
# This is not present before Qt 5.9:
find_package(Qt5 COMPONENTS TextToSpeech QUIET)
if (Qt5Core_VERSION VERSION_LESS 5.7)
message(FATAL_ERROR "Mudlet requires Qt 5.7 or later, yours is ${Qt5Core_VERSION}")
elif(Qt5Core_VERSION VERSION_LESS 5.9)
# Qt Gamepad was a Technology Preview in 5.7
# Qt Gamepad was a Technology Preview 2 in 5.8
# Qt Speech (or at least the TTS part) was a Technology Preview in 5.8
message(WARNING "Qt version: ${Qt5Core_VERSION} - Gamepad and TextToSpeech may not be supported, as officially they requires 5.9 and 5.10 respectively")
elif(Qt5Core_VERSION VERSION_LESS 5.10)
# Qt Speech (or at least the TTS part) was a Technology Preview 2 in 5.9, now supported on Mingw
# Qt Gamepad was officially released in 5.9
message(WARNING "Qt version: ${Qt5Core_VERSION} - TextToSpeech may not be supported, officially it requires 5.10")
else()
# Qt Speech (or at least the TTS part) was officially release in 5.10
message(STATUS "Qt version: ${Qt5Core_VERSION}")
endif()
message(STATUS "Using ${CMAKE_CXX_COMPILER_ID} compiler")
if(USE_FONTS)
message(STATUS "Including additional font resources within the Mudlet executable")
else()
message(STATUS "No font resources are to be included within the Mudlet executable")
endif()
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME STREQUAL "Windows") OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
if(USE_UPDATER)
message(STATUS "The updater code is included in this configuration")
else(USE_UPDATER)
message(STATUS "The updater code is excluded from this configuration")
endif(USE_UPDATER)
else()
message(STATUS "The Updater code is excluded as on-line updating is not available on this platform")
endif()
if(WIN32)
set(mudlet_RC_ICONS = icons/mudlet_main_512x512_6XS_icon.ico)
QT5_ADD_RESOURCES(RC_ICONS ${mudlet_RC_ICONS})
endif()
if(NOT(PC_ZIP_FOUND))
find_package(ZIP REQUIRED)
endif()
find_package(OpenGL REQUIRED)
find_package(Lua51 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(PCRE REQUIRED)
find_package(YAJL REQUIRED)
find_package(PUGIXML REQUIRED)
# Fall back on original FIND_PACKAGE process on Apple if Package Config failed
# Originally we did use that but it started to fail on Travis C.I. in June 2016
# So we now try to use PackageConfig for MacOs platform
if(APPLE)
if(NOT(PC_HUNSPELL_FOUND))
find_package(HUNSPELL REQUIRED)
endif()
else()
find_package(HUNSPELL REQUIRED)
endif()
find_package(Boost 1.44 COMPONENTS graph)
add_definitions(-DAPP_VERSION="${APP_VERSION}" -DAPP_BUILD="${APP_BUILD}" -DAPP_TARGET="${APP_TARGET}")
if(UNIX)
set(LUA_DEFAULT_DIR "${CMAKE_INSTALL_PREFIX}/share/mudlet/lua")
set(LCF_DIR "${CMAKE_INSTALL_PREFIX}/share/mudlet/lua/lcf")
endif(UNIX)
# Define a preprocessor symbol with the default fallback location from which
# to load installed mudlet lua files. Set LUA_DEFAULT_DIR to a
# platform-specific value. If LUA_DEFAULT_DIR is unset, the root directory
# will be used.
add_definitions(-DLUA_DEFAULT_PATH="${LUA_DEFAULT_DIR}")
# Enable leak detection for MSVC debug builds.
if(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -FItestdbg.h")
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5OpenGL_INCLUDE_DIRS}
${Qt5Multimedia_INCLUDE_DIRS}
${Qt5UiTools_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${LUA_INCLUDE_DIR}
${PCRE_INCLUDE_DIR}
${YAJL_INCLUDE_DIR}
${PUGIXML_INCLUDE_DIR}
)
if(Qt5TextToSpeech_FOUND)
add_definitions(${Qt5TextToSpeech_DEFINITIONS})
include_directories(${Qt5TextToSpeech_INCLUDE_DIRS})
message(STATUS "Using TextToSpeech module")
endif(Qt5TextToSpeech_FOUND)
if(Qt5Gamepad_FOUND)
add_definitions(${Qt5Gamepad_DEFINITIONS})
include_directories(${Qt5Gamepad_INCLUDE_DIRS})
message(STATUS "Using Gamepad module")
endif(Qt5Gamepad_FOUND)
# Need to use the plural variables as there can be more than ONE directory to specify:
if(PC_ZIP_FOUND)
include_directories( ${PC_ZIP_INCLUDE_DIRS} )
else()
include_directories( ${ZIP_INCLUDE_DIRS} )
endif()
include_directories( ${ZLIB_INCLUDE_DIR} )
QT5_WRAP_UI(mudlet_UIS_H ${mudlet_UIS})
QT5_WRAP_CPP(mudlet_MOC_SRCS ${mudlet_MOC_HDRS})
if(USE_FONTS)
QT5_ADD_RESOURCES(mudlet_RCC_SRCS ${mudlet_RCCS} ${mudlet_fonts_RCCS})
else()
QT5_ADD_RESOURCES(mudlet_RCC_SRCS ${mudlet_RCCS})
endif()
if(WIN32)
add_executable(mudlet WIN32
${mudlet_SRCS}
${mudlet_MOC_SRCS}
${mudlet_RCC_SRCS}
${mudlet_HDRS}
${mudlet_UIS_H}
${mudlet_MOC_HDRS}
${mudlet_LUA_FILES})
else()
add_executable(mudlet
${mudlet_SRCS}
${mudlet_MOC_SRCS}
${mudlet_RCC_SRCS}
${mudlet_HDRS}
${mudlet_UIS_H}
${mudlet_MOC_HDRS}
${mudlet_LUA_FILES})
endif()
target_link_libraries(mudlet
${Qt5Core_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Multimedia_LIBRARIES}
${Qt5OpenGL_LIBRARIES}
${Qt5UiTools_LIBRARIES}
${Qt5Concurrent_LIBRARIES}
${Boost_LIBRARIES}
${LUA_LIBRARIES}
${OPENGL_LIBRARIES}
${PCRE_LIBRARIES}
${YAJL_LIBRARIES}
${ZLIB_LIBRARIES}
${PUGIXML_LIBRARIES}
communi
edbee-lib
)
if(Qt5TextToSpeech_FOUND)
target_link_libraries(mudlet ${Qt5TextToSpeech_LIBRARIES})
endif(Qt5TextToSpeech_FOUND)
if(USE_UPDATER)
target_link_libraries(mudlet dblsqd)
endif(USE_UPDATER)
if(Qt5Gamepad_FOUND)
target_link_libraries(mudlet ${Qt5Gamepad_LIBRARIES})
endif(Qt5Gamepad_FOUND)
if(PC_ZIP_FOUND)
target_link_libraries(mudlet ${PC_ZIP_LIBRARIES})
else()
target_link_libraries(mudlet ${ZIP_LIBRARIES})
endif()
if(WIN32)
target_link_libraries(mudlet ws2_32
)
endif()
if(APPLE)
target_link_libraries(mudlet luazip)
if(USE_UPDATER)
target_link_libraries(mudlet
cocoa-qt-glue
"-framework Sparkle"
"-framework AppKit"
"-F${CMAKE_HOME_DIRECTORY}/3rdparty/cocoapods/Pods/Sparkle")
endif(USE_UPDATER)
endif()
if(PC_HUNSPELL_FOUND)
target_link_libraries(mudlet ${PC_HUNSPELL_LIBRARIES})
else()
target_link_libraries(mudlet ${HUNSPELL_LIBRARIES})
endif()
# *nix "make install" provision:
if(UNIX)
# CMAKE_INSTALL_PREFIX is automagically set on Unix to DESTDIR environment
# variable and is prefixed onto relative DESTINATION values
foreach(lua_file ${lua_files})
get_filename_component(lua_file_name ${lua_file} NAME)
get_filename_component(lua_file_path ${lua_file} DIRECTORY)
# message(STATUS "For ${lua_file} ==> installing ${lua_file_name} in ${CMAKE_INSTALL_PREFIX}/share/mudlet/lua/${lua_file_path}")
install(FILES "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/lua/${lua_file}"
DESTINATION "share/mudlet/lua/${lua_file_path}"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
CONFIGURATIONS Debug Release)
endforeach(lua_file)
foreach(lcf_file ${lcf_files})
get_filename_component(lcf_file_name ${lcf_file} NAME)
get_filename_component(lcf_file_path ${lcf_file} DIRECTORY)
# message(STATUS "For ${lcf_file} ==> installing ${lcf_file_name} in ${CMAKE_INSTALL_PREFIX}/share/mudlet/lua/${lcf_file_path}")
install(FILES "${CMAKE_HOME_DIRECTORY}/3rdparty/${lcf_file}"
DESTINATION "share/mudlet/lua/${lcf_file_path}"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
CONFIGURATIONS Debug Release)
endforeach(lcf_file)
install(TARGETS mudlet
RUNTIME
DESTINATION "bin"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
CONFIGURATIONS Debug Release
COMPONENT All)
endif()