-
Notifications
You must be signed in to change notification settings - Fork 8
/
qt-5.12.10.cmake
775 lines (679 loc) · 26.7 KB
/
qt-5.12.10.cmake
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
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
# This file is part of OpenOrienteering.
# Copyright 2016-2021, 2024 Kai Pastor
#
# Redistribution and use is allowed according to the terms of the BSD license:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(short_version 5.12)
set(version 5.12.7)
set(patch_version ${version}-0)
set(openorienteering_version ${version}-qtbase-5.12.10-2)
option(USE_SYSTEM_QT "Use the system Qt if possible" ON)
# Note for Android
# Set environment variable ANDROID_API_VERSION to specify the target API level.
# Building Qt 5.12.10 needs "android-24" or higher.
# Cf. https://bugreports.qt.io/browse/QTBUG-89616
string(CONFIGURE [[
if("${module}" MATCHES "Android" AND NOT ANDROID)
set(BUILD_CONDITION 0)
elseif(ANDROID AND "${module}" STREQUAL "Qt5SerialPort")
set(BUILD_CONDITION 0)
elseif(ANDROID AND "${module}" STREQUAL "Qt5Help")
set(BUILD_CONDITION 0)
elseif("${module}" STREQUAL "qtattributionsscanner")
find_program(QTATTRIBUTIONSCANNER NAME "${module}" ONLY_CMAKE_FIND_ROOT_PATH QUIET)
string(FIND "${QTATTRIBUTIONSCANNER}" "${CMAKE_STAGING_PREFIX}/" staging_prefix_start)
if(CMAKE_CROSSCOMPILING)
set(BUILD_CONDITION 0)
elseif(QTATTRIBUTIONSCANNER AND NOT staging_prefix_start EQUAL 0)
message(STATUS "Found ${SYSTEM_NAME} ${module}: ${QTATTRIBUTIONSCANNER}")
endif()
elseif(USE_SYSTEM_QT)
find_package(Qt5Core @version@ CONFIG QUIET
NO_CMAKE_FIND_ROOT_PATH
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
if(Qt5Core_VERSION)
find_package(${module} ${Qt5Core_VERSION} CONFIG EXACT
NO_CMAKE_FIND_ROOT_PATH
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
find_package(${module} ${Qt5Core_VERSION_MAJOR}.${Qt5Core_VERSION_MINOR} CONFIG
NO_CMAKE_FIND_ROOT_PATH
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
string(FIND "${${module}_INCLUDE_DIRS}" "${CMAKE_STAGING_PREFIX}/" staging_prefix_start)
if(${module}_VERSION AND NOT staging_prefix_start EQUAL 0)
message(STATUS "Found ${SYSTEM_NAME} ${module}: ${${module}_VERSION}")
set(BUILD_CONDITION 0)
else()
message(STATUS "Found ${SYSTEM_NAME} Qt5Core ${Qt5Core_VERSION}, but no matching ${module}")
endif()
endif()
endif()
if(DEFINED ENV{HOST_PREFIX})
set(HOST_PREFIX "$ENV{HOST_PREFIX}" PARENT_SCOPE)
else()
set(HOST_PREFIX "${TOOLCHAIN_DIR}" PARENT_SCOPE)
endif()
]] use_system_qt @ONLY)
set(qtbase-gcc-13_patch [[
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
index 615f5238..6258423e 100644
--- a/src/corelib/global/qendian.h
+++ b/src/corelib/global/qendian.h
@@ -47,6 +47,7 @@
// include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems
#include <stdlib.h>
#include <string.h>
+#include <limits>
#ifdef min // MSVC
#undef min
diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h
index dafaea9c..fd9038dc 100644
--- a/src/corelib/tools/qbytearraymatcher.h
+++ b/src/corelib/tools/qbytearraymatcher.h
@@ -40,6 +40,7 @@
#ifndef QBYTEARRAYMATCHER_H
#define QBYTEARRAYMATCHER_H
+#include <limits>
#include <QtCore/qbytearray.h>
QT_BEGIN_NAMESPACE
]])
set(qtbase-8467bed_patch [[
diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
index dd3ebca4a65..ee7ac5c0143 100644
--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
@@ -43,6 +43,8 @@
#include <qpa/qplatformgraphicsbuffer.h>
#include <private/qcore_mac_p.h>
+#include <CoreGraphics/CGColorSpace.h>
+
QT_BEGIN_NAMESPACE
class QIOSurfaceGraphicsBuffer : public QPlatformGraphicsBuffer
]])
# copyright and patches for superbuild of Qt
set(default [[$<STREQUAL:${SYSTEM_NAME},default>]])
set(crosscompiling [[$<BOOL:${CMAKE_CROSSCOMPILING}>]])
set(windows [[$<STREQUAL:${CMAKE_SYSTEM_NAME},Windows>]])
set(macos [[$<STREQUAL:${CMAKE_SYSTEM_NAME},Darwin>]])
set(android [[$<BOOL:${ANDROID}>]])
set(use_sysroot [[$<NOT:$<AND:$<BOOL:${CMAKE_CROSSCOMPILING}>,$<BOOL:${ANDROID}>>>]])
set(qmake [[$<$<BOOL:${CMAKE_CROSSCOMPILING}>:$${}{HOST_PREFIX}>$<$<NOT:$<BOOL:${CMAKE_CROSSCOMPILING}>>:${CMAKE_STAGING_PREFIX}>/bin/qmake]])
set(module Qt5Core)
superbuild_package(
NAME qt-${short_version}-openorienteering
VERSION ${openorienteering_version}
SOURCE
URL https://github.com/OpenOrienteering/superbuild/archive/qt-${short_version}-openorienteering_${openorienteering_version}.tar.gz
URL_HASH SHA256=63a9e4a5000e6a6de572644867e8f926274dd13d9b32d51e97548d5c498070b7
)
# qtbase
set(qtbase_version 5.12.10)
set(qtbase_patch_version ${qtbase_version}-1)
superbuild_package(
NAME qtbase
VERSION ${short_version}
DEPENDS
qtbase-everywhere-src-${qtbase_patch_version}+openorienteering2
)
set(module Qt5Core)
superbuild_package(
NAME qtbase-everywhere-src
VERSION ${qtbase_patch_version}+openorienteering2
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
freetype
libjpeg
libpng
pcre2
pkg-config
sqlite3
zlib
SOURCE_WRITE
gcc-13.patch qtbase-gcc-13_patch
qtbase-8467bed.patch qtbase-8467bed_patch
SOURCE
URL https://download.qt.io/archive/qt/${short_version}/${qtbase_version}/submodules/qtbase-everywhere-src-${qtbase_version}.tar.xz
URL_HASH SHA256=8088f174e6d28e779516c083b6087b6a9e3c8322b4bc161fd1b54195e3c86940
# Don't accidently used bundled copies
PATCH_COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/angle # excluded by -opengl desktop
COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/dbus-ifaces # excluded by -no-dbus
COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/libjpeg # excluded by -system-libjpeg
COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/libpng # excluded by -system-libpng
COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/pcre # excluded by -system-pcre
COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/sqlite # excluded by -system-sqlite, -no-sql-sqlite
COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/wasm # for WebAssembly platform
COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/xcb # requires -qt-xcb
COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/zlib # excluded by -system-zlib
COMMAND
"${CMAKE_COMMAND}"
-Dpackage=qt-${short_version}-openorienteering-${openorienteering_version}/qtbase
-P "${APPLY_PATCHES_SERIES}"
COMMAND
# Enforce make for MSYS. Needed for config.tests outside qtbase, e.g. libtiff in qtimageformats
# Cf. https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-qt5/0025-qt-5.8.0-force-using-make-on-msys.patch
sed -i -e "/MAKEFILE_GENERATOR, MINGW/,/mingw32-make/ s/.equals.QMAKE_HOST.os, Windows./\\!isEmpty(QMAKE_SH)|\\!equals(QMAKE_HOST.os, Windows)/"
mkspecs/features/configure_base.prf
COMMAND
patch -p1 < gcc-13.patch
COMMAND
patch -p1 < qtbase-8467bed.patch
USING default crosscompiling windows android macos USE_SYSTEM_QT module short_version openorienteering_version qtbase_patch_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
$<@crosscompiling@:
COMMAND
# Cf. qtbase configure "SYSTEM_VARIABLES"
"${CMAKE_COMMAND}" -E env
--unset=AR
--unset=RANLIB
--unset=STRIP
--unset=OBJDUMP
--unset=LD
--unset=CC
--unset=CXX
--unset=CFLAGS
--unset=CXXFLAGS
--unset=LDFLAGS
$<@android@:
# Required to satisfy qconfigure.pri
PKG_CONFIG_SYSROOT_DIR=set-but-not-used
PKG_CONFIG_LIBDIR=set-but-not-used
>
# fall through
>
"${SOURCE_DIR}/configure"
-opensource
-confirm-license
$<$<CONFIG:Debug>:-debug>$<$<NOT:$<CONFIG:Debug>>:-release $<$<CONFIG:RelWithDebInfo>:-force-debug-info>>
-shared
-optimized-tools
$<@macos@:-no-framework>
-gui
-widgets
-system-libjpeg
-system-libpng
-system-pcre
-system-sqlite
-system-zlib
-no-sql-db2
-no-sql-ibase
-no-sql-mysql
-no-sql-oci
-no-sql-odbc
-no-sql-psql
-sql-sqlite
-no-sql-sqlite2
-no-sql-tds
-no-openssl
-no-directfb
-no-linuxfb
$<$<OR:@android@,@macos@,@windows@>:
-no-dbus
>
-nomake examples
-nomake tests
-nomake tools
-system-proxies
-no-glib
-prefix "${CMAKE_INSTALL_PREFIX}"
-archdatadir "${CMAKE_INSTALL_PREFIX}/lib/qt5"
-datadir "${CMAKE_INSTALL_PREFIX}/share/qt5"
-examplesdir "${CMAKE_INSTALL_PREFIX}/share/qt5/examples"
-headerdir "${CMAKE_INSTALL_PREFIX}/include/qt5"
-libdir "${CMAKE_INSTALL_PREFIX}/lib"
-extprefix "${CMAKE_STAGING_PREFIX}"
$<$<BOOL:@MSYS@>:
-no-pkg-config
-platform win32-g++
-opengl desktop
>
$<@crosscompiling@:
-hostprefix "${HOST_PREFIX}"
#-hostdatadir "${HOST_PREFIX}/share/qt5"
$<@windows@:
-device-option CROSS_COMPILE=${SUPERBUILD_TOOLCHAIN_TRIPLET}-
-xplatform win32-g++
-opengl desktop
-no-feature-systemtrayicon # Workaround missing ChangeWindowMessageFilterEx symbol
>
$<@android@:
-pkg-config
$<$<STREQUAL:@CMAKE_CXX_COMPILER_ID@,GNU>:
-xplatform android-g++
>$<$<STREQUAL:@CMAKE_CXX_COMPILER_ID@,Clang>:
-xplatform android-clang
-disable-rpath
>
-android-ndk "${ANDROID_NDK_ROOT}"
-android-sdk "${ANDROID_SDK_ROOT}"
-android-arch "${ANDROID_ABI}"
-android-ndk-platform "${ANDROID_PLATFORM}"
>
>
-I "${CMAKE_STAGING_PREFIX}/include"
-L "${CMAKE_STAGING_PREFIX}/lib"
INSTALL_COMMAND
"$(MAKE)" install INSTALL_ROOT=${DESTDIR}
$<@android@:
# androiddeployqt QTBUG-73141
COMMAND
"${CMAKE_COMMAND}" -E create_symlink
"${CMAKE_STAGING_PREFIX}/lib/qt5/plugins"
"${CMAKE_STAGING_PREFIX}/plugins"
>
COMMAND
"${CMAKE_COMMAND}" -E copy
"<SOURCE_DIR>/../qt-${short_version}-openorienteering-${openorienteering_version}/qtbase/copyright"
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/qtbase-${qtbase_patch_version}.txt"
]]
)
# qtandroidextras
set(qtandroidextras_version ${patch_version})
superbuild_package(
NAME qtandroidextras
VERSION ${short_version}
DEPENDS qtandroidextras-everywhere-src-${qtandroidextras_version}
)
set(module Qt5AndroidExtras)
superbuild_package(
NAME qtandroidextras-everywhere-src
VERSION ${qtandroidextras_version}
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
qtbase-${short_version}
SOURCE
URL https://download.qt.io/archive/qt/${short_version}/${version}/submodules/qtandroidextras-everywhere-src-${version}.tar.xz
URL_HASH SHA256=a5acc927bd46ed87627e2ae0f0bfc199189d383a3e17c2f34b8c34ea57b2aea1
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qtandroidextras_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"@qmake@" "${SOURCE_DIR}"
INSTALL_COMMAND
"$(MAKE)" install INSTALL_ROOT=${DESTDIR}
COMMAND
"${CMAKE_COMMAND}" -E copy
"<SOURCE_DIR>/../qt-${short_version}-openorienteering-${openorienteering_version}/qtandroidextras/copyright"
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/qtandroidextras-${qtandroidextras_version}.txt"
]]
)
# qtimageformats
set(qtimageformats_version ${patch_version})
superbuild_package(
NAME qtimageformats
VERSION ${short_version}
DEPENDS qtimageformats-everywhere-src-${qtimageformats_version}
)
set(module Qt5Gui) # qtimageformats adds plugins to Qt5Gui
superbuild_package(
NAME qtimageformats-everywhere-src
VERSION ${qtimageformats_version}
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
qtbase-${short_version}
libwebp
tiff
SOURCE
URL https://download.qt.io/archive/qt/${short_version}/${version}/submodules/qtimageformats-everywhere-src-${version}.tar.xz
URL_HASH SHA256=9bd19ee24fb85f249d01c78e637c95377dd738feb61da0deeee6b770fa62f70b
# Don't accidently used bundled copies
PATCH_COMMAND
"${CMAKE_COMMAND}" -E remove_directory src/3rdparty/libtiff
COMMAND
"${CMAKE_COMMAND}"
-Dpackage=qt-${short_version}-openorienteering-${openorienteering_version}/qtimageformats
-P "${APPLY_PATCHES_SERIES}"
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qtimageformats_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"@qmake@" "${SOURCE_DIR}" --
-no-jasper
-no-mng
-system-tiff
-system-webp
INSTALL_COMMAND
"$(MAKE)" install INSTALL_ROOT=${DESTDIR}
COMMAND
"${CMAKE_COMMAND}" -E copy
"<SOURCE_DIR>/../qt-${short_version}-openorienteering-${openorienteering_version}/qtimageformats/copyright"
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/qtimageformats-${qtimageformats_version}.txt"
]]
)
# qtlocation
set(qtlocation_version ${patch_version})
superbuild_package(
NAME qtlocation
VERSION ${short_version}
DEPENDS qtlocation-everywhere-src-${qtlocation_version}
)
set(module Qt5Location)
superbuild_package(
NAME qtlocation-everywhere-src
VERSION ${qtlocation_version}
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
qtbase-${short_version}
qtserialport-${short_version}
SOURCE
URL https://download.qt.io/archive/qt/${short_version}/${version}/submodules/qtlocation-everywhere-src-${version}.tar.xz
URL_HASH SHA256=d1e905b80befda3c9aaad92ea984e6dbf722568b5c91e8d15b027bc5bc22781f
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qtlocation_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"@qmake@" "${SOURCE_DIR}"
INSTALL_COMMAND
"$(MAKE)" install INSTALL_ROOT=${DESTDIR}
COMMAND
"${CMAKE_COMMAND}" -E copy
"<SOURCE_DIR>/../qt-${short_version}-openorienteering-${openorienteering_version}/qtlocation/copyright"
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/qtlocation-${qtlocation_version}.txt"
]]
)
# qtsensors
set(qtsensors_version ${patch_version})
superbuild_package(
NAME qtsensors
VERSION ${short_version}
DEPENDS qtsensors-everywhere-src-${qtsensors_version}
)
set(module Qt5Sensors)
superbuild_package(
NAME qtsensors-everywhere-src
VERSION ${qtsensors_version}
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
qtbase-${short_version}
SOURCE
URL https://download.qt.io/archive/qt/${short_version}/${version}/submodules/qtsensors-everywhere-src-${version}.tar.xz
URL_HASH SHA256=2b9aea9f4e2f681b4067f2b9d97c5073c135e41d26601c71f18f199bc980e740
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qtsensors_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"@qmake@" "${SOURCE_DIR}"
INSTALL_COMMAND
"$(MAKE)" install INSTALL_ROOT=${DESTDIR}
COMMAND
"${CMAKE_COMMAND}" -E copy
"<SOURCE_DIR>/../qt-${short_version}-openorienteering-${openorienteering_version}/qtsensors/copyright"
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/qtsensors-${qtsensors_version}.txt"
]]
)
# qtserialport
set(qtserialport_version ${patch_version})
superbuild_package(
NAME qtserialport
VERSION ${short_version}
DEPENDS qtserialport-everywhere-src-${qtserialport_version}
)
set(module Qt5SerialPort)
superbuild_package(
NAME qtserialport-everywhere-src
VERSION ${qtserialport_version}
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
qtbase-${short_version}
SOURCE
URL https://download.qt.io/archive/qt/${short_version}/${version}/submodules/qtserialport-everywhere-src-${version}.tar.xz
URL_HASH SHA256=224c282ebed750f46b72dfe18260c3d26fbb74e928dec64bd8c51e7beed8721f
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qtserialport_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"@qmake@" "${SOURCE_DIR}"
INSTALL_COMMAND
"$(MAKE)" install INSTALL_ROOT=${DESTDIR}
COMMAND
"${CMAKE_COMMAND}" -E copy
"<SOURCE_DIR>/../qt-${short_version}-openorienteering-${openorienteering_version}/qtserialport/copyright"
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/qtserialport-${qtserialport_version}.txt"
]]
)
# qttools
set(gcc-14_patch [[
--- a/src/assistant/qcollectiongenerator/main.c
+++ b/src/assistant/qcollectiongenerator/main.c
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
argv[0] = newPath;
#ifdef _WIN32
- const intptr_t ret = _spawnvp(_P_WAIT, newPath, argv);
+ const intptr_t ret = _spawnvp(_P_WAIT, newPath, (const char* const *)argv);
if (ret == -1) {
fprintf(stderr, "Error while executing \"%s\" tool.\n", newPath);
return 3;
]])
set(qttools_version ${patch_version})
superbuild_package(
NAME qttools
VERSION ${short_version}
DEPENDS qttools-everywhere-src-${qttools_version}
)
superbuild_package(
NAME qttools-everywhere-src
VERSION ${qttools_version}
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
qttools-linguist
qttools-assistant
qttools-qtattributionsscanner
SOURCE_WRITE
gcc-14.patch gcc-14_patch
SOURCE
URL https://download.qt.io/archive/qt/${short_version}/${version}/submodules/qttools-everywhere-src-${version}.tar.xz
URL_HASH SHA256=860a97114d518f83c0a9ab3742071da16bb018e6eb387179d5764a8dcca03948
PATCH_COMMAND
"${CMAKE_COMMAND}"
-Dpackage=qt-${short_version}-openorienteering-${openorienteering_version}/qttools
-P "${APPLY_PATCHES_SERIES}"
COMMAND
patch -p1 < gcc-14.patch
)
set(module Qt5LinguistTools) # proxy
superbuild_package(
NAME qttools-copyright
VERSION ${qttools_version}
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
SOURCE qttools-everywhere-src-${qttools_version}
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qttools_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND
"${CMAKE_COMMAND}" -E copy
"<SOURCE_DIR>/../qt-${short_version}-openorienteering-${openorienteering_version}/qttools/copyright"
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/qttools-${qttools_version}.txt"
]]
)
set(module Qt5Help)
superbuild_package(
NAME qttools-assistant
VERSION ${qttools_version}
DEPENDS
qtbase-${short_version}
qttools-copyright-${qttools_version}
SOURCE qttools-everywhere-src-${qttools_version}
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qttools_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"${CMAKE_COMMAND}" -E make_directory src/assistant
COMMAND
"${CMAKE_COMMAND}" -E chdir src/assistant "@qmake@" "${SOURCE_DIR}/src/assistant"
BUILD_COMMAND
"$(MAKE)" -C src/assistant
sub-assistant-make_first
sub-qcollectiongenerator-make_first
sub-qhelpgenerator-make_first
INSTALL_COMMAND
"$(MAKE)" -C src/assistant
sub-assistant-install_subtargets
sub-qcollectiongenerator-install_subtargets
sub-qhelpgenerator-install_subtargets
INSTALL_ROOT=${DESTDIR}
]]
)
set(module Qt5LinguistTools)
superbuild_package(
NAME qttools-linguist
VERSION ${qttools_version}
DEPENDS
qtbase-${short_version}
qttools-copyright-${qttools_version}
SOURCE qttools-everywhere-src-${qttools_version}
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qttools_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"${CMAKE_COMMAND}" -E make_directory src/linguist
COMMAND
"${CMAKE_COMMAND}" -E chdir src/linguist "@qmake@" "${SOURCE_DIR}/src/linguist"
BUILD_COMMAND
"$(MAKE)" -C src/linguist
INSTALL_COMMAND
"$(MAKE)" -C src/linguist install INSTALL_ROOT=${DESTDIR}
]]
)
set(module qtattributionsscanner) # dummy
superbuild_package(
NAME qttools-qtattributionsscanner
VERSION ${qttools_version}
DEPENDS
qtbase-${short_version}
qttools-copyright-${qttools_version}
SOURCE qttools-everywhere-src-${qttools_version}
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qttools_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"${CMAKE_COMMAND}" -E make_directory src/qtattributionsscanner
COMMAND
"${CMAKE_COMMAND}" -E chdir src/qtattributionsscanner "@qmake@" "${SOURCE_DIR}/src/qtattributionsscanner"
BUILD_COMMAND
"$(MAKE)" -C src/qtattributionsscanner
INSTALL_COMMAND
"$(MAKE)" -C src/qtattributionsscanner install INSTALL_ROOT=${DESTDIR}
]]
)
# qttranslations
set(qttranslations_version ${patch_version})
superbuild_package(
NAME qttranslations
VERSION ${short_version}
DEPENDS qttranslations-everywhere-src-${qttranslations_version}
)
set(module Qt5Core) # Can't find qttranslations via CMake.
superbuild_package(
NAME qttranslations-everywhere-src
VERSION ${qttranslations_version}
DEPENDS
source:qt-${short_version}-openorienteering-${openorienteering_version}
qtbase-${short_version}
qttools-${short_version}
SOURCE
URL https://download.qt.io/archive/qt/${short_version}/${version}/submodules/qttranslations-everywhere-src-${version}.tar.xz
URL_HASH SHA256=2c8d1169f1f20ba32639181f1853b4159940cbaaac41adaa018b6f43ca31323f
USING qmake USE_SYSTEM_QT module short_version openorienteering_version qttranslations_version
BUILD_CONDITION ${use_system_qt}
BUILD [[
CONFIGURE_COMMAND
"@qmake@" "${SOURCE_DIR}"
INSTALL_COMMAND
"$(MAKE)" install INSTALL_ROOT=${DESTDIR}
COMMAND
"${CMAKE_COMMAND}" -E copy
"<SOURCE_DIR>/../qt-${short_version}-openorienteering-${openorienteering_version}/qttranslations/copyright"
"${DESTDIR}${CMAKE_STAGING_PREFIX}/share/doc/copyright/qttranslations-${qttranslations_version}.txt"
]]
)
# Attribution maintenance, in git
find_package(Git QUIET)
find_package(PythonInterp 3 QUIET)
if(GIT_EXECUTABLE AND PYTHONINTERP_FOUND)
superbuild_package(
NAME qt-${short_version}-openorienteering
VERSION git
DEPENDS
qttools-qtattributionsscanner-${patch_version}
source:qtandroidextras-everywhere-src-${patch_version}
source:qtbase-everywhere-src-${qtbase_patch_version}+openorienteering2
source:qtimageformats-everywhere-src-${patch_version}
source:qtlocation-everywhere-src-${patch_version}
source:qtsensors-everywhere-src-${patch_version}
source:qtserialport-everywhere-src-${patch_version}
source:qttools-everywhere-src-${patch_version}
source:qttranslations-everywhere-src-${patch_version}
SOURCE
GIT_REPOSITORY https://github.com/OpenOrienteering/superbuild.git
GIT_TAG qt-${short_version}-openorienteering
PATCH_COMMAND
"${CMAKE_COMMAND}" -E make_directory "source/"
COMMAND
"${CMAKE_COMMAND}" -E create_symlink "<SOURCE_DIR>/../qtandroidextras-everywhere-src-${patch_version}" "source/qtandroidextras"
COMMAND
"${CMAKE_COMMAND}" -E create_symlink "<SOURCE_DIR>/../qtbase-everywhere-src-${qtbase_patch_version}" "source/qtbase"
COMMAND
"${CMAKE_COMMAND}" -E create_symlink "<SOURCE_DIR>/../qtimageformats-everywhere-src-${patch_version}" "source/qtimageformats"
COMMAND
"${CMAKE_COMMAND}" -E create_symlink "<SOURCE_DIR>/../qtlocation-everywhere-src-${patch_version}" "source/qtlocation"
COMMAND
"${CMAKE_COMMAND}" -E create_symlink "<SOURCE_DIR>/../qtsensors-everywhere-src-${patch_version}" "source/qtsensors"
COMMAND
"${CMAKE_COMMAND}" -E create_symlink "<SOURCE_DIR>/../qtserialport-everywhere-src-${patch_version}" "source/qtserialport"
COMMAND
"${CMAKE_COMMAND}" -E create_symlink "<SOURCE_DIR>/../qttools-everywhere-src-${patch_version}" "source/qttools"
COMMAND
"${CMAKE_COMMAND}" -E create_symlink "<SOURCE_DIR>/../qttranslations-everywhere-src-${patch_version}" "source/qttranslations"
USING patch_version PYTHON_EXECUTABLE
BUILD [[
CMAKE_ARGS
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
"-DVERSION=${patch_version}"
"-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}"
BUILD_COMMAND
"${CMAKE_COMMAND}" --build . --target update-copyright
BUILD_ALWAYS 1
INSTALL_COMMAND ""
]]
)
endif()