forked from copperspice/copperspice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
610 lines (491 loc) · 19 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
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
cmake_policy(VERSION 3.8..3.13)
# support using rpath on Mac OS X
cmake_policy(SET CMP0042 NEW)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
# prefer OpenGL libraries from a hardware vendor if available
set(OpenGL_GL_PREFERENCE GLVND)
project(copperspice)
set(BUILD_MAJOR "1")
set(BUILD_MINOR "6")
set(BUILD_MICRO "2")
set(BUILD_ABI ${BUILD_MAJOR}.${BUILD_MINOR})
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckTypeSize)
include(FeatureSummary)
include(ResourceMacros)
include(TestLargeFiles)
# location for install or package
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
include(GNUInstallDirs)
# rpath
file(RELATIVE_PATH CS_BIN_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_RPATH "@executable_path/${CS_BIN_RPATH}")
elseif(CMAKE_SYSTEM_NAME MATCHES "(Linux|OpenBSD|FreeBSD|NetBSD|DragonFly)")
include(GNUInstallDirs)
# rpath
file(RELATIVE_PATH CS_BIN_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_RPATH "$ORIGIN/${CS_BIN_RPATH}")
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(CMAKE_INSTALL_BINDIR bin)
set(CMAKE_INSTALL_LIBDIR lib)
set(CMAKE_INSTALL_INCLUDEDIR include)
endif()
# required library
set(BUILD_COMPONENTS "Core")
# unused at this time: DBus, Declarative, and ScriptTools
set(CS_OPTIONAL_COMPONENTS Gui Multimedia Network OpenGL Script Sql Svg WebKit Xml XmlPatterns)
set(PACKAGE "copperspice")
set(PACKAGE_NAME "CopperSpice")
set(PACKAGE_VERSION "${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_MICRO}")
set(PACKAGE_STRING "copperspice ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_MICRO}")
set(PACKAGE_TARNAME "copperspice")
set(PACKAGE_BUGREPORT "[email protected]")
set(PACKAGE_URL "https://www.copperspice.com/")
# values used in cs_build_info.h.in
set(HEX_VERSION "0x0${BUILD_MAJOR}0${BUILD_MINOR}0${BUILD_MICRO}")
set(VERSION "${PACKAGE_VERSION}")
set(prefix "${CMAKE_INSTALL_PREFIX}")
if(MSVC)
enable_language(ASM_MASM)
set(target "MSVC")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang|AppleClang)")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
OUTPUT_VARIABLE DUMPMACHINE_OUTPUT
RESULT_VARIABLE DUMPMACHINE_EXITCODE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT DUMPMACHINE_EXITCODE EQUAL 0)
message(SEND_ERROR "Failed to obtain machine from ${CMAKE_CXX_COMPILER}")
endif()
set(target "${DUMPMACHINE_OUTPUT}")
else()
message(WARNING
"Your compiler (${CMAKE_CXX_COMPILER}) may not be supported. "
"The plugin key which will be used is: ${CMAKE_SYSTEM}"
)
set(target "${CMAKE_SYSTEM}")
endif()
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VENDOR "CopperSpice")
set(CPACK_PACKAGE_VERSION_MAJOR ${BUILD_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${BUILD_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${BUILD_MICRO})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cross platform C++ GUI libraries")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX})
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PACKAGE_VERSION}")
set(CPACK_SOURCE_GENERATOR ZIP TBZ2)
file(STRINGS cmake/dist_ignore.txt CPACK_SOURCE_IGNORE_FILES)
include(CPack)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-undefined,error")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-undefined,error")
elseif(CMAKE_SYSTEM_NAME MATCHES "(OpenBSD|FreeBSD|NetBSD|DragonFly)")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
elseif(MSVC)
string (REGEX REPLACE "/W3" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" )
string (REGEX REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
# Linux, Windows (MinGW)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wa,-mbig-obj")
endif()
endif()
string(TIMESTAMP BUILD_DATE "%Y-%m-%d")
add_definitions(-DQT_SHARED)
check_include_file(dlfcn.h HAVE_DLFCN_H)
check_include_file(dirent.h HAVE_DIRENT_H)
check_include_file(features.h HAVE_FEATURES_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(grp.h HAVE_GRP_H)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(libpq-fe.h HAVE_LIBPQ_FE_H)
check_include_file(memory.h HAVE_MEMORY_H)
check_include_file(pg_config.h HAVE_PG_CONFIG_H)
check_include_file(pthread.h HAVE_PTHREAD_H)
check_include_file(pthread_np.h HAVE_PTHREAD_NP_H)
check_include_file(pwd.h HAVE_PWD_H)
check_include_file(signal.h HAVE_SIGNAL_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stdlib.h HAVE_STDLIB_H)
check_include_file(strings.h HAVE_STRINGS_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(cups/cups.h HAVE_CUPS_CUPS_H)
check_include_file(mysql/mysql.h HAVE_MYSQL_H)
check_include_file(net/if.h HAVE_NET_IF_H)
check_include_file(netinet/in.h HAVE_NETINET_IN_H)
check_include_file(sys/eventfd.h HAVE_SYS_EVENTFD_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H)
check_include_file(sys/ipc.h HAVE_SYS_IPC_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/shm.h HAVE_SYS_SHM_H)
check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_file(sys/stat.h HAVE_SYS_STAT_H)
check_include_file(sys/wait.h HAVE_SYS_WAIT_H)
check_include_file(sys/param.h HAVE_SYS_PARAM_H)
check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" STDC_HEADERS)
check_type_size(size_t SIZEOF_SIZE_T)
opj_test_large_files(HAVE_LARGEFILESUPPORT)
option(WITH_PSQL_PLUGIN "Build PostgreSQL database plugin (if possible)" ON)
add_feature_info(PostgreSQL WITH_PSQL_PLUGIN "Popular open source database")
option(WITH_MYSQL_PLUGIN "Build MySQL database plugin (if possible)" ON)
add_feature_info(MySQL WITH_MYSQL_PLUGIN "Popular open source database")
option(WITH_ODBC_PLUGIN "Build ODBC database plugin (if possible)" ON)
add_feature_info(ODBC WITH_ODBC_PLUGIN "Popular open source database")
foreach(component ${CS_OPTIONAL_COMPONENTS})
string(TOUPPER ${component} uppercomp)
option(WITH_${uppercomp} "Build ${component} component" ON)
endforeach()
# start if output
message("")
message("Configuring CMake for CopperSpice\n\n")
message("Search for required Packages\n")
find_package(OpenSSL 1.0)
set_package_properties(OpenSSL PROPERTIES
PURPOSE "Required for HTTPS support"
DESCRIPTION "Support for SSL and TLS"
URL "https://openssl.org"
TYPE RECOMMENDED
)
find_package(ZLIB)
set_package_properties(ZLIB PROPERTIES
PURPOSE "Required for compression support"
DESCRIPTION "Compression Library"
URL "https://zlib.net"
TYPE RECOMMENDED
)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
find_package(Cups)
set_package_properties(Cups PROPERTIES
PURPOSE "Required for printing support"
DESCRIPTION "CUPS is the standards-based open source printing system"
URL "https://www.cups.org"
TYPE RECOMMENDED
)
find_package(ALSA)
set_package_properties(ALSA PROPERTIES
PURPOSE "Required for ALSA audio support"
DESCRIPTION "Advanced Linux Sound Architecture"
URL "http://www.alsa-project.org"
TYPE RECOMMENDED
)
find_package(PulseAudio)
set_package_properties(PulseAudio PROPERTIES
PURPOSE "Required for pulseaudio support"
DESCRIPTION "Sound processing daemon for Unix"
URL "http://www.pulseaudio.org"
TYPE RECOMMENDED
)
endif()
find_package(PostgreSQL)
set_package_properties(PostgreSQL PROPERTIES
PURPOSE "Required for PostgreSQL database support"
DESCRIPTION "Popular open source database"
URL "http://www.postgresql.org"
TYPE RECOMMENDED
)
if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND PostgreSQL_FOUND)
foreach (fname IN LISTS PostgreSQL_INCLUDE_DIRS)
# testing for 'EXISTS', is really a query for if the file can be read or written
if (EXISTS "${fname}/pthread.h")
# Postgres bug
message(WARNING "")
message(WARNING "------------------------------------------------------------")
message(WARNING "WARNING WARNING WARNING")
message(WARNING "The '${fname}' directory contains a file called pthread.h")
message(WARNING "")
message(WARNING "A conflict exists between pthread.h and the standard library ")
message(WARNING "Rename or remove pthread.h in order to build the CsSqlPsql plugin")
message(WARNING "------------------------------------------------------------")
message(WARNING "")
# force to not found
set(PostgreSQL_FOUND false)
message(STATUS "PostgreSQL client library was found, plugin will not be built")
message(STATUS "")
endif()
endforeach()
endif()
find_package(MySQL)
set_package_properties(MySQL PROPERTIES
PURPOSE "Required for MySQL database support"
DESCRIPTION "Popular open source database"
URL "http://www.mysql.com"
TYPE RECOMMENDED
)
# emerald - temporarily turn off GTK as a workaround, conflicts with freetype version in Harfbuzz
set(CMAKE_DISABLE_FIND_PACKAGE_GTK2 TRUE)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
find_package(GTK2)
set_package_properties(GTK2 PROPERTIES
PURPOSE "Required for GTK style and application integration support"
DESCRIPTION "Multi-platform toolkit for creating graphical user interfaces"
URL "http://www.gtk.org"
TYPE RECOMMENDED
)
endif()
#if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
# find_package(Security)
# set_package_properties(Security PROPERTIES
# PURPOSE "Required for HTTPS support"
# DESCRIPTION "Support for secure network communications using Secure Trasnport for SSL and TLS"
# URL "https://developer.apple.com/documentation/security/secure_transport"
# TYPE RECOMMENDED
# )
#endif()
if(CMAKE_SYSTEM_NAME MATCHES "(Linux|OpenBSD|FreeBSD|NetBSD|DragonFly)")
find_package(Threads)
set_package_properties(Threads PROPERTIES
PURPOSE "Required for threading support"
DESCRIPTION "Platform dependant threading library"
URL ""
TYPE REQUIRED
)
find_package(GLib2)
set_package_properties(GLib2 PROPERTIES
PURPOSE "Required for glib mainloop support"
DESCRIPTION "GNOME core library"
URL "https://developer.gnome.org/glib"
TYPE REQUIRED
)
find_package(GObject2)
set_package_properties(GObject2 PROPERTIES
PURPOSE "Required for glib mainloop support"
DESCRIPTION "The object system used for Pango and GTK+"
URL "https://developer.gnome.org/gobject"
TYPE REQUIRED
)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(Iconv)
set_package_properties(Iconv PROPERTIES
PURPOSE "Iconv support"
DESCRIPTION "For use on systems which do not have Iconv or lack Unicode support"
URL "http://www.gnu.org/software/libiconv/"
TYPE REQUIRED
)
endif()
if(WITH_GUI)
find_package(X11 COMPONENTS ICE SM Xcursor Xext Xfixes Xi Xinerama Xrandr Xrender)
set_package_properties(X11 PROPERTIES
PURPOSE "Required for X11/X.Org integration support"
DESCRIPTION "Open source implementation of the X Window System"
URL "https://www.x.org"
TYPE REQUIRED
)
find_package(XCB COMPONENTS xcb xcb-image xcb-icccm xcb-sync xcb-xfixes xcb-shm xcb-randr
xcb-shape xcb-keysyms xcb-xinerama xcb-xkb xcb-render xcb-render-util)
set_package_properties(XCB PROPERTIES
PURPOSE "Required for XCB/X.Org integration support"
DESCRIPTION "Open source implementation of the XCB Interface for the X11 Window System"
URL "https://xcb.freedesktop.org"
TYPE REQUIRED
)
find_package(X11_XCB)
set_package_properties(X11_XCB PROPERTIES
PURPOSE "Required for X11 XCB support"
DESCRIPTION "Integration between X11 and XCB"
URL "https://xcb.freedesktop.org"
TYPE REQUIRED
)
find_package(XKBCommon)
set_package_properties(XKBCommon PROPERTIES
PURPOSE "Required for XKB integration support"
DESCRIPTION "Keyboard library"
URL "https://xkbcommon.org"
TYPE REQUIRED
)
find_package(XKBCommon_X11)
set_package_properties(XKBCommon_X11 PROPERTIES
PURPOSE "Required for XKB X11 integration support"
DESCRIPTION "Keyboard library"
URL "https://xkbcommon.org"
TYPE REQUIRED
)
find_package(Fontconfig)
set_package_properties(Fontconfig PROPERTIES
PURPOSE "Required for fonts configuration support"
DESCRIPTION "Library for configuring and customizing font access"
URL "http://www.freedesktop.org/wiki/Software/fontconfig/"
TYPE REQUIRED
)
endif()
if(WITH_MULTIMEDIA)
find_package(GStreamer)
set_package_properties(GStreamer PROPERTIES
PURPOSE "Required for multimedia audio and video support"
DESCRIPTION "Open source media playback library"
URL "http://gstreamer.freedesktop.org"
TYPE REQUIRED
)
endif()
if(WITH_OPENGL)
find_package(OpenGL)
set_package_properties(OpenGL PROPERTIES
PURPOSE "Required for OpenGL support"
DESCRIPTION "The Mesa 3D Graphics Library"
URL "http://www.mesa3d.org/"
TYPE REQUIRED
)
endif()
if(WITH_WEBKIT)
find_package(LibXml2)
set_package_properties(LibXml2 PROPERTIES
PURPOSE "Required for XML support in WebKit"
DESCRIPTION "XML C parser and toolkit developed for the Gnome project"
URL "http://www.xmlsoft.org/"
TYPE REQUIRED
)
endif()
endif()
if(WIN32)
add_definitions(-DUNICODE)
endif()
if(NOT Cups_FOUND)
add_definitions(-DQT_NO_CUPS)
endif()
if(NOT GLIB2_FOUND)
add_definitions(-DQT_NO_GLIB)
endif()
if(NOT ZLIB_FOUND)
include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/zlib)
endif()
if(HAVE_LARGEFILESUPPORT)
if(_FILE_OFFSET_BITS)
add_definitions(-D_FILE_OFFSET_BITS=64)
endif()
if(_LARGE_FILES)
add_definitions(-D_LARGE_FILES)
endif()
if(_LARGEFILE_SOURCE)
add_definitions(-D_LARGEFILE_SOURCE)
endif()
endif()
configure_file(
${CMAKE_SOURCE_DIR}/cmake/cs-config.h.cmake
${CMAKE_BINARY_DIR}/include/cs-config.h
)
configure_file(
${CMAKE_SOURCE_DIR}/src/core/global/cs_build_info.h.in
${CMAKE_BINARY_DIR}/include/QtCore/cs_build_info.h
)
# file locations for building
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Ninja generator does not yet know how to build archives in pieces, so response
# files must be used to deal with very long linker command lines.
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)
# check components dependencies BROOM
if(WITH_MULTIMEDIA AND NOT WITH_GUI)
message(SEND_ERROR "Multimedia component requires Gui component")
elseif(WITH_OPENGL AND NOT WITH_GUI)
message(SEND_ERROR "OpenGL component requires Gui component")
elseif(WITH_SVG AND NOT WITH_GUI)
message(SEND_ERROR "Svg component requires Gui component")
elseif(WITH_XMLPATTERNS AND NOT WITH_NETWORK)
message(SEND_ERROR "XmlPatterns component requires Network component")
elseif(WITH_WEBKIT AND NOT (WITH_GUI AND WITH_NETWORK AND WITH_SCRIPT))
message(SEND_ERROR "WebKit component requires Gui, Network, and Script components")
endif()
add_subdirectory(src/core)
foreach(component ${CS_OPTIONAL_COMPONENTS})
string(TOUPPER ${component} uppercomp)
if(WITH_${uppercomp})
string(TOLOWER ${component} lowercomp)
add_subdirectory(src/${lowercomp})
set(BUILD_COMPONENTS "${BUILD_COMPONENTS} ${component}")
endif()
endforeach()
if(WITH_XML)
add_subdirectory(src/tools/shared)
add_subdirectory(src/tools/lconvert)
add_subdirectory(src/tools/lrelease)
add_subdirectory(src/tools/lupdate)
endif()
if(WITH_XML AND WITH_GUI)
add_subdirectory(src/tools/rcc)
add_subdirectory(src/tools/uic)
endif()
# platform plugins
if(WITH_GUI)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(BUILD_PLATFORMS_COCOA_PLUGIN TRUE)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(BUILD_PLATFORMS_WINDOWS_PLUGIN TRUE)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "(Linux|OpenBSD|FreeBSD|NetBSD|DragonFly)")
set(BUILD_PLATFORMS_XCB_PLUGIN TRUE)
endif()
add_subdirectory(src/plugins/platforms)
add_subdirectory(src/plugins/printerdrivers)
endif()
configure_file(
${CMAKE_SOURCE_DIR}/cmake/CopperSpiceConfig.cmake
${CMAKE_BINARY_DIR}/CopperSpiceConfig.cmake
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/cmake/CopperSpiceConfigVersion.cmake
${CMAKE_BINARY_DIR}/CopperSpiceConfigVersion.cmake
@ONLY
)
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(PKG_PREFIX "CopperSpice.framework/Resources")
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(PKG_PREFIX "cmake/CopperSpice")
else()
set(PKG_PREFIX "${CMAKE_INSTALL_LIBDIR}/cmake/CopperSpice")
endif()
install(
FILES
${CMAKE_BINARY_DIR}/CopperSpiceConfig.cmake
${CMAKE_BINARY_DIR}/CopperSpiceConfigVersion.cmake
${CMAKE_SOURCE_DIR}/cmake/CopperSpiceDeploy.cmake
${CMAKE_SOURCE_DIR}/cmake/CopperSpiceMacros.cmake
${CMAKE_SOURCE_DIR}/cmake/InstallMinGW.cmake
DESTINATION ${PKG_PREFIX}
)
install(
EXPORT CopperSpiceBinaryTargets
NAMESPACE CopperSpice::
FILE CopperSpiceBinaryTargets.cmake
DESTINATION ${PKG_PREFIX}
)
install(EXPORT CopperSpiceLibraryTargets
NAMESPACE CopperSpice::
FILE CopperSpiceLibraryTargets.cmake
DESTINATION ${PKG_PREFIX}
)
message("\n")
message("Enabled CopperSpice libraries")
message("\n * ${BUILD_COMPONENTS}\n")
feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
set(TARGETBITS 32)
else()
set(TARGETBITS 64)
endif()
message("")
message("CopperSpice configured to run on: ${CMAKE_SYSTEM_NAME} ${TARGETBITS} bit, ${CMAKE_BUILD_TYPE} Mode")
message("CopperSpice will be built in: ${CMAKE_BINARY_DIR}")
message("CopperSpice will be installed in: ${CMAKE_INSTALL_PREFIX}")
message("\n")