Compare commits
1026 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
33f5e985e4 | ||
|
ce09de5809 | ||
|
ccd827be0a | ||
|
2561158bc6 | ||
|
2f9c7ca99a | ||
|
7ea0adfc3c | ||
|
b40c61c8eb | ||
|
0523b06055 | ||
|
3277497b4e | ||
|
d958b85dac | ||
|
798175930e | ||
|
f041e662c9 | ||
|
1ed82ab778 | ||
|
a7f4a61211 | ||
|
096a112259 | ||
|
f504186992 | ||
|
1048b43ef9 | ||
|
6378d98e01 | ||
|
9b5c3d3104 | ||
|
478c80fd07 | ||
|
93a3deb973 | ||
|
0641d4e5a7 | ||
|
60d41595f6 | ||
|
34eaba13b8 | ||
|
a66a3983f2 | ||
|
e8514f771d | ||
|
a1a5e12ef9 | ||
|
5866056a97 | ||
|
20966dc53f | ||
|
5f30d04ccd | ||
|
6aba1ac852 | ||
|
4dc4bf6cf1 | ||
|
9ac3eab056 | ||
|
bb4e6d908f | ||
|
e8fb761f75 | ||
|
4f450ddf19 | ||
|
281ee04a82 | ||
|
7e1321080c | ||
|
28ad12261c | ||
|
da2e47edb0 | ||
|
afbc0c7267 | ||
|
35b3deeb58 | ||
|
89b36f4943 | ||
|
18678e3fc7 | ||
|
f6720887e6 | ||
|
f96365db99 | ||
|
3c5841ace3 | ||
|
a93a41fcd1 | ||
|
f4d0320f45 | ||
|
f8466e5b2c | ||
|
9fcee2287a | ||
|
50b51d2b50 | ||
|
2d9935cc6d | ||
|
ca9a3ba6c8 | ||
|
d066497527 | ||
|
e4101bf6ca | ||
|
88ec95d25f | ||
|
1b86653088 | ||
|
9954eb9c50 | ||
|
0ef069956f | ||
|
c02d99a7f9 | ||
|
16c1d52a66 | ||
|
bcdcceca6c | ||
|
4fb8aebf8f | ||
|
4b21b332ee | ||
|
d5b36aa609 | ||
|
9dbb4a8f81 | ||
|
1bb4c33708 | ||
|
4b26cb5866 | ||
|
37e3596808 | ||
|
faee1c1640 | ||
|
b984680021 | ||
|
b46607000e | ||
|
8f07015af8 | ||
|
a88f26f7e4 | ||
|
364c409e9f | ||
|
f1adbc7bfe | ||
|
41a21e8ac3 | ||
|
df1f97a5b2 | ||
|
50cee3d508 | ||
|
3b67d5a5d1 | ||
|
9dd2dd4ab4 | ||
|
9f3c74bfab | ||
|
8efaa9f830 | ||
|
d28a9f512e | ||
|
170a2594f4 | ||
|
75779446e6 | ||
|
7549f7fdb0 | ||
|
43cfa11b31 | ||
|
f5c68d0e89 | ||
|
1255def0f2 | ||
|
c3c5323e6c | ||
|
515a0faf85 | ||
|
dce0b8ea69 | ||
|
030793accd | ||
|
046ea6b707 | ||
|
23c87ff341 | ||
|
02fd6ca5e7 | ||
|
92ae4071dd | ||
|
e6157e356a | ||
|
8145c7d2dd | ||
|
5700a3355c | ||
|
0ef9d8a49a | ||
|
eb5f183754 | ||
|
259b3148ab | ||
|
61cd31a67d | ||
|
df55581a79 | ||
|
974e5986ba | ||
|
806a24a57d | ||
|
b0d6fe9ad1 | ||
|
d1f2b9dcc8 | ||
|
2265a1efd7 | ||
|
92e3f5250a | ||
|
d514557091 | ||
|
c462d33d3d | ||
|
45bf63676d | ||
|
a169728d7f | ||
|
086a22c4fc | ||
|
bb66e67b6c | ||
|
238e18e385 | ||
|
43326b3802 | ||
|
010ab170cb | ||
|
b211c84505 | ||
|
67739448fb | ||
|
63b0b25ccf | ||
|
62e17eae88 | ||
|
9044a8e035 | ||
|
864544eb1a | ||
|
cd917e8999 | ||
|
f76ee96e58 | ||
|
355e2aa12c | ||
|
f56b186f78 | ||
|
9bd2b35bf3 | ||
|
e3cf47d7d7 | ||
|
4c9e36ffcd | ||
|
4f55529d4a | ||
|
4daef13af8 | ||
|
35ee5b4eb7 | ||
|
a87bfe2c83 | ||
|
704d4597a5 | ||
|
7864c01c77 | ||
|
4b39596512 | ||
|
19242733aa | ||
|
9478aa74ee | ||
|
a1045b2b0f | ||
|
7cd3b65980 | ||
|
4091fe8516 | ||
|
253731e84e | ||
|
e9cf618a9d | ||
|
68e2645da2 | ||
|
91619f0e76 | ||
|
30d416c67d | ||
|
941b2de2ee | ||
|
a506e0835e | ||
|
37cfc0e045 | ||
|
2578cc7d9e | ||
|
72024ef741 | ||
|
8d47db7a78 | ||
|
5381df0240 | ||
|
94d9e05aa6 | ||
|
654b74aa05 | ||
|
b34073eab5 | ||
|
75dc131a28 | ||
|
d2891e5d01 | ||
|
d8f614648f | ||
|
1a779b15b2 | ||
|
2bc116f832 | ||
|
bda8582f39 | ||
|
fd7418cfb5 | ||
|
84dbb356ef | ||
|
9e1eb7ff69 | ||
|
6c6653719e | ||
|
7bee8bd163 | ||
|
66dfbea290 | ||
|
641459e986 | ||
|
f326d50e72 | ||
|
2a70f6cccf | ||
|
5a171799cf | ||
|
fbafac20af | ||
|
50d9ed401b | ||
|
e76a01d690 | ||
|
fa4231bd11 | ||
|
928885a5c0 | ||
|
c013c57c84 | ||
|
e016960338 | ||
|
6782e1eb70 | ||
|
514d24da02 | ||
|
63959e4560 | ||
|
3fc198cf3c | ||
|
001ecc5d7b | ||
|
01692d46c8 | ||
|
6099a3e09b | ||
|
7efe78bb5e | ||
|
0cc4424414 | ||
|
d5e8ff75ce | ||
|
10cc2d614c | ||
|
25d7fa178b | ||
|
d0968b6ddf | ||
|
3590e2cc52 | ||
|
724f7fb6c8 | ||
|
bd4ab9c23c | ||
|
d05102e1da | ||
|
208a587b01 | ||
|
1018624561 | ||
|
3ba8179d6b | ||
|
fc08f7c6b8 | ||
|
d8a8cc1295 | ||
|
35dda81f7a | ||
|
b02a296710 | ||
|
646912cac7 | ||
|
bbae65a75d | ||
|
883a12d28d | ||
|
8240f9437e | ||
|
e32b3aeb64 | ||
|
65f2d65730 | ||
|
6ec1766c5c | ||
|
bcbbafca88 | ||
|
eb1d0f5d05 | ||
|
ac2c9b21c9 | ||
|
9595678cad | ||
|
afe0a6a4ab | ||
|
a31d82ba66 | ||
|
d0378c32d0 | ||
|
8d1cdc1fe8 | ||
|
9559c09fbe | ||
|
eb8cda8ee8 | ||
|
16cce399d2 | ||
|
cbea2f5705 | ||
|
6f00da8489 | ||
|
4f1e91a185 | ||
|
a1b79d137f | ||
|
f974ea6f86 | ||
|
281b5154bf | ||
|
44a2dd16ed | ||
|
bc948965f1 | ||
|
d21f16ecb9 | ||
|
6f303a6c24 | ||
|
9e43e9fa3a | ||
|
e27d14bd55 | ||
|
14d8d5099e | ||
|
04efbda0df | ||
|
61c8e411b5 | ||
|
2e8fa5b8f3 | ||
|
bc569d65b1 | ||
|
06a0f9b419 | ||
|
a4b96df51d | ||
|
53e351a1ad | ||
|
3ce73dc0d6 | ||
|
2fd12c03cd | ||
|
b29f12be3e | ||
|
4df46fd72c | ||
|
566aede35f | ||
|
f925278917 | ||
|
82e189441e | ||
|
8ab0d1e9e8 | ||
|
3e9c292dbc | ||
|
f7dcf1a2d9 | ||
|
6de7e0d646 | ||
|
954f13545c | ||
|
5d341c848e | ||
|
743aac16b3 | ||
|
3458cf984a | ||
|
b33b0eeb45 | ||
|
2969f119eb | ||
|
ea50a2deb5 | ||
|
b32f16b169 | ||
|
4781de5859 | ||
|
e4d4714aae | ||
|
cd81b9016e | ||
|
d9b11a3343 | ||
|
f6ccf8bfbf | ||
|
6c9cba45ca | ||
|
0603c8be97 | ||
|
55e5ab8d57 | ||
|
0136720e52 | ||
|
8d96533c42 | ||
|
d77b12a9bb | ||
|
3c2985a363 | ||
|
2332b6ccde | ||
|
7279e97dc3 | ||
|
d5fbeeff52 | ||
|
7265ab1897 | ||
|
7cd5f6952e | ||
|
74f33348f2 | ||
|
8a1e204edf | ||
|
a44a81ceb7 | ||
|
11ca4ae1f8 | ||
|
ec4b9503e8 | ||
|
f656ffdb0a | ||
|
3a9bbf235d | ||
|
3e09f3abbb | ||
|
3e1a7eeabb | ||
|
a3346dbef3 | ||
|
bc88069890 | ||
|
9f0a95a806 | ||
|
8ac594b13f | ||
|
001394acf7 | ||
|
b4e7e6cfa7 | ||
|
d53745d702 | ||
|
9f1c5945b7 | ||
|
31a26a4f2e | ||
|
23b4ab8f45 | ||
|
4c7553c30a | ||
|
9e0850b564 | ||
|
15ed84677c | ||
|
95cdc8c1d3 | ||
|
2c8a5b5051 | ||
|
ce3ca69dc6 | ||
|
f699962821 | ||
|
7079c28664 | ||
|
7864dcbe4e | ||
|
5ab33c107f | ||
|
849d7bee68 | ||
|
d2210aaf02 | ||
|
f0869a66ae | ||
|
5c0dea4760 | ||
|
a0981f1341 | ||
|
73880c92ea | ||
|
f06ad33e46 | ||
|
3ef96cc184 | ||
|
2aa619d3b3 | ||
|
7effe20b59 | ||
|
89552df61d | ||
|
7ae5b002dc | ||
|
e03c895be6 | ||
|
5fb1bec201 | ||
|
85a4749302 | ||
|
ea9f37469e | ||
|
6171141717 | ||
|
98e791bdca | ||
|
78165c6b83 | ||
|
fa7a19e97a | ||
|
94a5d32343 | ||
|
b3c12b05e6 | ||
|
c79e71fe2c | ||
|
94124571b5 | ||
|
8442b05bdd | ||
|
194848c5fd | ||
|
0f272af5c8 | ||
|
81d2137738 | ||
|
b1d28854f2 | ||
|
5d9c7c9e35 | ||
|
8823e00668 | ||
|
b50d72a4cb | ||
|
3ea8e8aef0 | ||
|
a6b7a613c7 | ||
|
70e0b39114 | ||
|
4fad4be7a8 | ||
|
5ab4764f1e | ||
|
b66fc29fb7 | ||
|
49ce591e69 | ||
|
7dda27c95e | ||
|
1d84c2d479 | ||
|
88dd567930 | ||
|
0be8f763d5 | ||
|
bdeaa4b3cc | ||
|
712db87ac4 | ||
|
367cc461c1 | ||
|
9cd6cb67eb | ||
|
ed6914e017 | ||
|
dc9e677f7f | ||
|
db8a15de70 | ||
|
c9d8bcb9dd | ||
|
5bae58bb45 | ||
|
8d0833a81b | ||
|
d150f5cf74 | ||
|
a2dfc69730 | ||
|
31bfd89f6c | ||
|
4f3b16c491 | ||
|
539e123f0d | ||
|
6257ade025 | ||
|
9887252d14 | ||
|
1f664fe9cf | ||
|
fca06f50d1 | ||
|
13d3c7fb22 | ||
|
540869f4c5 | ||
|
d680fe607f | ||
|
9cb4100e7a | ||
|
b37be2387e | ||
|
99d0f997aa | ||
|
1b583f39d3 | ||
|
168b3b75e0 | ||
|
aac6ba691f | ||
|
067adfbb11 | ||
|
f10c8d3069 | ||
|
bbe8c20ff5 | ||
|
a2f0d82503 | ||
|
e3f1695143 | ||
|
830d4ee315 | ||
|
665c7b757b | ||
|
e54810d86b | ||
|
6354e7d37c | ||
|
426740ba1d | ||
|
3858614666 | ||
|
70eab2cfd2 | ||
|
14a2bd7adb | ||
|
ee09dbe13d | ||
|
a92ee82651 | ||
|
6fedc36483 | ||
|
5221fbc4b0 | ||
|
a1ec66e7a3 | ||
|
8c2e80e9e2 | ||
|
5b97f49777 | ||
|
bf650edb2e | ||
|
afe038bb0e | ||
|
a5756053b3 | ||
|
a8c5512798 | ||
|
763c56028c | ||
|
49d0e34f06 | ||
|
55d3a2442c | ||
|
57a7efe4dd | ||
|
65eae6ad45 | ||
|
66d3682264 | ||
|
95291e4a8a | ||
|
cbaecba8dc | ||
|
326240ef79 | ||
|
69eec3cd48 | ||
|
e395b1eb3f | ||
|
068e0cbb2f | ||
|
eb21238015 | ||
|
5699b77aa2 | ||
|
b0ed8d1058 | ||
|
2a748c164e | ||
|
a835abd6e3 | ||
|
cc7079e5b8 | ||
|
cb1489314c | ||
|
48866bb73f | ||
|
de200cc91f | ||
|
94e83053ed | ||
|
4f5b6967bb | ||
|
687415e10c | ||
|
5bf290776c | ||
|
7294226274 | ||
|
c905f18e37 | ||
|
687af7b1a9 | ||
|
938c442e8a | ||
|
68b0ad4201 | ||
|
eb8605ed2d | ||
|
94c9ce85c7 | ||
|
7b6682cfbb | ||
|
6843a4a69e | ||
|
226f84d5ac | ||
|
ac6fcaf565 | ||
|
908bf2bac4 | ||
|
4595ad68a9 | ||
|
618abdcd80 | ||
|
095bfbd3e4 | ||
|
d3d8a717fd | ||
|
6909fb0019 | ||
|
4f75b1cdb7 | ||
|
c9111d1ca3 | ||
|
c7a767660a | ||
|
1a5691c189 | ||
|
ad7a711c3d | ||
|
be1185ad32 | ||
|
56e4691407 | ||
|
8ac712968a | ||
|
9758650a37 | ||
|
aa0f395fd1 | ||
|
1a628e82cc | ||
|
63e7dc7bd6 | ||
|
bb08829eb7 | ||
|
8cf1b2b53a | ||
|
aa2c0eb7eb | ||
|
9fcc290b1d | ||
|
799bdf5c53 | ||
|
7050aec00b | ||
|
392131feb4 | ||
|
ff157648d6 | ||
|
abc9fd2023 | ||
|
f655c6c9b9 | ||
|
3094ac8e55 | ||
|
e067969ef7 | ||
|
c4a7f22e3e | ||
|
47f219c798 | ||
|
89db6ceef0 | ||
|
bd45bd2769 | ||
|
c5b083dd13 | ||
|
da4820419e | ||
|
79f7000099 | ||
|
cf910cc4a0 | ||
|
5078becc41 | ||
|
4395e1e06b | ||
|
52cd08293f | ||
|
f9ea1604a5 | ||
|
8fada6f0c8 | ||
|
30ffd6639f | ||
|
b528f9b1c6 | ||
|
3ace2833ea | ||
|
023aecc885 | ||
|
aea3d99a39 | ||
|
bdaeee9736 | ||
|
33f22d821f | ||
|
bd55ecbbce | ||
|
b01710cba8 | ||
|
e861274f27 | ||
|
ec1248b183 | ||
|
a2bbbfaa02 | ||
|
4d2c405fe5 | ||
|
95befb165b | ||
|
742dc3ff40 | ||
|
e2b8476151 | ||
|
d32e1153c1 | ||
|
074cec7683 | ||
|
2adc225391 | ||
|
46af7d3d1f | ||
|
d760569dee | ||
|
303d7cabd3 | ||
|
0749d1fa33 | ||
|
22d8539016 | ||
|
db1bf57a29 | ||
|
7d55bf65fb | ||
|
7d042a0d37 | ||
|
a8b0b7798e | ||
|
163a97fdd2 | ||
|
e6b1d99ff2 | ||
|
ad330d9f61 | ||
|
2b7854bd31 | ||
|
9244100789 | ||
|
41388a7ce4 | ||
|
360e71d5be | ||
|
09cebbd128 | ||
|
5edba15ab3 | ||
|
147ad81c1f | ||
|
a966e35ec0 | ||
|
2ead07f210 | ||
|
9a55243e53 | ||
|
9f1f2e3eed | ||
|
95ed706e82 | ||
|
bda8c5216c | ||
|
7bbb12b5d8 | ||
|
f46856ae16 | ||
|
56c40449ae | ||
|
b9c4fb7e61 | ||
|
c3efe23ad1 | ||
|
e9bd092bda | ||
|
1c0029070c | ||
|
ce7a1aa628 | ||
|
44949ea13e | ||
|
e46c3c3e5a | ||
|
2be472a07c | ||
|
8d4945fb65 | ||
|
8bf8c9113c | ||
|
2d9d633cce | ||
|
1781eb50ac | ||
|
c5986c9e59 | ||
|
b2004620bd | ||
|
8783783cfc | ||
|
2373c70e2d | ||
|
f329934052 | ||
|
e4d9303a46 | ||
|
5b2e3475ba | ||
|
84ec6b1dc6 | ||
|
979d367ef7 | ||
|
220f86d1ee | ||
|
2634898e2e | ||
|
5d05532c32 | ||
|
1beb9335b4 | ||
|
9dcff27fcf | ||
|
1671172375 | ||
|
e57bf5b99d | ||
|
f339262217 | ||
|
fde0d8a017 | ||
|
b386b5b00b | ||
|
f66dd99261 | ||
|
abb28791b7 | ||
|
96a67452b1 | ||
|
4f89eb5a7a | ||
|
477ecafaee | ||
|
98ff5a2676 | ||
|
90beb456f7 | ||
|
ec14d91a09 | ||
|
2eae708fad | ||
|
667a99c322 | ||
|
ac328eec8d | ||
|
40024a24f0 | ||
|
46abad6741 | ||
|
65b2832503 | ||
|
91a3ba1496 | ||
|
8d86ae9f90 | ||
|
ae6e27d601 | ||
|
a9e8aa565c | ||
|
b09ff420e4 | ||
|
64a4f7120f | ||
|
c1425724d7 | ||
|
06d434ef28 | ||
|
b5d66b52df | ||
|
acc2cdb6c8 | ||
|
4a15c6bdf5 | ||
|
31a3e82b70 | ||
|
66217fe0ae | ||
|
8bad89cf53 | ||
|
03ee1e1002 | ||
|
0c9787babd | ||
|
b35f5a187d | ||
|
743a23b897 | ||
|
f732833eaa | ||
|
a83d59b901 | ||
|
66044f94cb | ||
|
4d4e88beb5 | ||
|
78bd3bd006 | ||
|
2c0e78e7b1 | ||
|
e333057970 | ||
|
e7ce9a6546 | ||
|
2d4827ac53 | ||
|
fd29e6ddb9 | ||
|
f4db3a83b5 | ||
|
0114514c0a | ||
|
8adf5b9316 | ||
|
d450c94203 | ||
|
8c75df013a | ||
|
4756d5bb6c | ||
|
08c1f77c9a | ||
|
be9797b6b6 | ||
|
52f665ebaf | ||
|
f5479dda74 | ||
|
e3b08a61eb | ||
|
2b62922e2e | ||
|
5bc7d8b2e8 | ||
|
75d5ad3ac9 | ||
|
ad010d77d9 | ||
|
002e495903 | ||
|
64335e3ceb | ||
|
b34d5dcf68 | ||
|
cf9e5d0dd8 | ||
|
23982baf56 | ||
|
dacc75de29 | ||
|
84a5667cd8 | ||
|
c1ad580dca | ||
|
cb562418fb | ||
|
6a04d4dc9c | ||
|
c5f650af76 | ||
|
5d19dfb915 | ||
|
732b0ca949 | ||
|
3cc1885370 | ||
|
a81d214463 | ||
|
7c9dcaf2aa | ||
|
c859532b0b | ||
|
52de4aa86e | ||
|
6334d43fce | ||
|
05a2a4b450 | ||
|
9043e95ad9 | ||
|
92ffc0ac38 | ||
|
49f8f62b03 | ||
|
3d21cc29e8 | ||
|
9361271f11 | ||
|
0188af38b1 | ||
|
c9fe146401 | ||
|
63428b1f1f | ||
|
2e70ca4847 | ||
|
bccb6c13f0 | ||
|
eea8c04e6f | ||
|
a3a5d805c9 | ||
|
2461783ae9 | ||
|
90d96766af | ||
|
acaf9b0d2c | ||
|
74571f3455 | ||
|
9c7b9f9f58 | ||
|
6f5132cf83 | ||
|
f50d13389d | ||
|
4ea9f75b11 | ||
|
747ceb8515 | ||
|
32f93394ef | ||
|
f00f557ee6 | ||
|
4ba4723d57 | ||
|
9cded930f0 | ||
|
d0a9b93324 | ||
|
78a45e4a65 | ||
|
dcef040b9d | ||
|
c1f6fbdd4e | ||
|
0a981bd9db | ||
|
ce7725cf85 | ||
|
95c8d2914a | ||
|
26623b9d09 | ||
|
3d70617c71 | ||
|
8b1f858f65 | ||
|
8527913a0c | ||
|
fd1be66d16 | ||
|
583065c533 | ||
|
eb1cec404e | ||
|
3bbdd022a7 | ||
|
8cf16c6f50 | ||
|
a825cd1a3f | ||
|
11456b4d56 | ||
|
cd16e289f6 | ||
|
cb3416696f | ||
|
f9b5440292 | ||
|
f4cc885f8c | ||
|
7bdef9c75a | ||
|
77a1c96be9 | ||
|
05a2de3ce9 | ||
|
433e5223d6 | ||
|
d117cd5f3a | ||
|
5cf68eb150 | ||
|
95fa5e33d0 | ||
|
0b1fdf1185 | ||
|
6a2956172b | ||
|
ee72e23897 | ||
|
390b2b773e | ||
|
4fa8095ad4 | ||
|
dd4a42e86f | ||
|
83172f759a | ||
|
4df0132adc | ||
|
bc2ba337dc | ||
|
745e7583d0 | ||
|
e938a4a100 | ||
|
3af876d53b | ||
|
13beed1569 | ||
|
05def66af0 | ||
|
3cfaab940f | ||
|
a869f448e9 | ||
|
8bd5865f76 | ||
|
b851d89e8a | ||
|
7cdf9eca5c | ||
|
86c4d60fde | ||
|
70f48ca973 | ||
|
4ffd435333 | ||
|
865bfc531c | ||
|
8bd70959f8 | ||
|
0714ab7db5 | ||
|
f0feeb8486 | ||
|
92805d19bb | ||
|
1c9fe0173c | ||
|
a47eccc32c | ||
|
3b4c6da046 | ||
|
1dc356cf5e | ||
|
f61c424919 | ||
|
d6bf951b76 | ||
|
9845bda23f | ||
|
25b995a575 | ||
|
1c682c2432 | ||
|
9e8c8fc105 | ||
|
11aa5f8aca | ||
|
054510b8aa | ||
|
eb6784eb87 | ||
|
2a1ba918da | ||
|
1e2aa97a11 | ||
|
08f2757fe0 | ||
|
a9b924dca6 | ||
|
de85c3a3d0 | ||
|
d3cef8f3f4 | ||
|
366bf02129 | ||
|
fcf1dc1633 | ||
|
7eb7da8e52 | ||
|
77573a04aa | ||
|
8b8b7467bf | ||
|
cd54a5e837 | ||
|
2d83c9d026 | ||
|
212ff817ca | ||
|
13197d7506 | ||
|
91132d6b27 | ||
|
972984521e | ||
|
51dc94df9c | ||
|
32466f5763 | ||
|
87ccb0b481 | ||
|
afe4666519 | ||
|
07708f6e61 | ||
|
970888356a | ||
|
613a37e7ca | ||
|
5ef2440102 | ||
|
27d2256494 | ||
|
34a64c3771 | ||
|
2bc452d8a3 | ||
|
fe36efc625 | ||
|
75abc39672 | ||
|
72821e7ebd | ||
|
f1e796193a | ||
|
58aa9808a4 | ||
|
3852b2f4fd | ||
|
028c3b6e15 | ||
|
c0d9424404 | ||
|
28ee92c656 | ||
|
2b0ea48258 | ||
|
b024426ee9 | ||
|
16c9ea4194 | ||
|
3343eeb1fb | ||
|
f03c7e4a2d | ||
|
a13f78144a | ||
|
47c6473680 | ||
|
c131e159b0 | ||
|
c73372b5fe | ||
|
50dbf86104 | ||
|
50150e3b4e | ||
|
abd60e9592 | ||
|
0445c77429 | ||
|
59a826e9a6 | ||
|
9529e3e13e | ||
|
04bc5fa4be | ||
|
03b1ade31c | ||
|
e63c51c7de | ||
|
188fdf7ceb | ||
|
c8c3c44064 | ||
|
92f155cc29 | ||
|
94aef47539 | ||
|
a77605f3ad | ||
|
5c64b63a47 | ||
|
d924253c91 | ||
|
1b5b090a5a | ||
|
f10448ffaf | ||
|
343fa701ed | ||
|
6e395ef151 | ||
|
c85aa4947a | ||
|
a557b5af56 | ||
|
6c69eb4021 | ||
|
dc7a2d20f8 | ||
|
c00d99d96e | ||
|
a9c29029d3 | ||
|
848932fbd8 | ||
|
7ab0bcbf8e | ||
|
33402cdf69 | ||
|
ec39297898 | ||
|
f4ca871977 | ||
|
efd63925d7 | ||
|
c12fa6b6fa | ||
|
3ae6c1a307 | ||
|
69fa86f81d | ||
|
604d25e238 | ||
|
2a0ba7258a | ||
|
db46249c44 | ||
|
6d4b9aadcf | ||
|
f2fc341c54 | ||
|
7c32220284 | ||
|
18f8aae1f5 | ||
|
41670375f8 | ||
|
c9207ef38f | ||
|
d0262b4f95 | ||
|
6db8d06778 | ||
|
38787f9507 | ||
|
76a051047e | ||
|
1a6e1660b1 | ||
|
850e926841 | ||
|
bede24ee04 | ||
|
a84d0b6bab | ||
|
596c9a71fa | ||
|
0af9bb58e1 | ||
|
d173d73f26 | ||
|
69daaaea46 | ||
|
15b9a1e6d5 | ||
|
53f88aa737 | ||
|
4f8b0c7e3e | ||
|
12b43d3902 | ||
|
081dd8d7f0 | ||
|
7f987d8bd5 | ||
|
f897f722e3 | ||
|
f1adc51ca4 | ||
|
5feaf7ffaa | ||
|
45e2533ebf | ||
|
de01c5ecb8 | ||
|
0ca64287f8 | ||
|
afee9d90b8 | ||
|
3f3f46d615 | ||
|
e799b3de67 | ||
|
49f488c855 | ||
|
211ff8ac53 | ||
|
2df17d56b9 | ||
|
11e0a4fc5e | ||
|
1c79aab50d | ||
|
9772069ade | ||
|
fa2940fa33 | ||
|
5ec1f39f4c | ||
|
266be57eed | ||
|
6f956279f8 | ||
|
8529d537ac | ||
|
f0765c556d | ||
|
40b99f7fc6 | ||
|
c67f69ce29 | ||
|
55fbb4c372 | ||
|
9d6543ea40 | ||
|
8050a66a8d | ||
|
ae04c6a16f | ||
|
ae41507317 | ||
|
b04a8a90f8 | ||
|
c6f7b8aa46 | ||
|
82005725c2 | ||
|
22dc39a8d7 | ||
|
8d82e24f95 | ||
|
87fc863c27 | ||
|
308d0b5f96 | ||
|
c62e0ed703 | ||
|
2c07d59092 | ||
|
d082bf07a9 | ||
|
295ecd9b87 | ||
|
bdeb45c2e2 | ||
|
848c017165 | ||
|
15de36f97b | ||
|
b2222ec0d3 | ||
|
10950d87f7 | ||
|
838f66be51 | ||
|
c63a3a46be | ||
|
c9630e3afa | ||
|
456896aa6b | ||
|
bb08b96b29 | ||
|
7de02e230c | ||
|
0b8d30efec | ||
|
4feb6662dc | ||
|
f5bad37873 | ||
|
d0973a46e6 | ||
|
97c40bf5bf | ||
|
66414b36fd | ||
|
8b693cd135 | ||
|
f2995dc15a | ||
|
33d7e170e6 | ||
|
cd1ef4db4f | ||
|
14a7096bda | ||
|
2e55a34c1c | ||
|
4f9b22fd00 | ||
|
5783a384f9 | ||
|
02f5f21fbf | ||
|
c75c987a64 | ||
|
8c71212bbd | ||
|
60c9347253 | ||
|
da317be412 | ||
|
8b67e2381a | ||
|
4454081240 | ||
|
bffe07264c | ||
|
dc0e17fa64 | ||
|
e684a7a159 | ||
|
cbf5a4050c | ||
|
c41547247b | ||
|
ecdd82ac34 | ||
|
281e067a62 | ||
|
49283c156d | ||
|
0fa6b3dcf4 | ||
|
75544c0af6 | ||
|
c325766423 | ||
|
df759d34eb | ||
|
7c6883d5db | ||
|
e75305dd42 | ||
|
9b6d4f542f | ||
|
6f4f36333b | ||
|
2ef4694c0a | ||
|
0997715cf8 | ||
|
119a23d2cf | ||
|
56598b65fa | ||
|
b49593c0c8 | ||
|
03b23f66d5 | ||
|
3653256b7f | ||
|
ec58e20d7e | ||
|
67f18f282a | ||
|
feadcc6869 | ||
|
904d3d628b | ||
|
ae0191d3b7 | ||
|
87b485b9bd | ||
|
2948ab16ea | ||
|
fea706df68 | ||
|
04b062ba71 | ||
|
a5a5ff0dab | ||
|
c34af8f514 | ||
|
e20ebd5a26 | ||
|
7f807cdd42 | ||
|
dcffd0035c | ||
|
f7b243c721 | ||
|
2741cf4f8a | ||
|
10819985db | ||
|
18fead0d4f | ||
|
aae0cc0702 | ||
|
54208c3a80 | ||
|
0e125ba4f9 | ||
|
8213f639cd | ||
|
2e487a246b | ||
|
9d8d9f3258 | ||
|
8133a6e2af | ||
|
0c6c9ec6a2 | ||
|
61d7831405 | ||
|
b36eaa3989 | ||
|
d75414372d | ||
|
0dc6ccbc5c | ||
|
bfd07607b2 | ||
|
9432a7136f | ||
|
4672843ae0 | ||
|
fbf948568d | ||
|
879912619a | ||
|
9d3c8bc058 | ||
|
a5a64671c7 | ||
|
ccc30c7e0d | ||
|
5c3203d38d | ||
|
fd91d1a668 | ||
|
60dd3b71bb | ||
|
1cdc197664 | ||
|
fadc5f7274 | ||
|
a0e949637d | ||
|
c3c5a6bd95 | ||
|
5776c58950 | ||
|
af152ff825 | ||
|
4d2dfbaf3e | ||
|
f638a6d98e | ||
|
dc72617cf2 | ||
|
2713444900 | ||
|
659bb338fe | ||
|
7a42679a98 | ||
|
a9870df180 | ||
|
03ad083057 | ||
|
aa0266b90b | ||
|
91f9cce4ce | ||
|
9479b55672 | ||
|
b61d67ff61 | ||
|
ff469d570b | ||
|
428821b675 | ||
|
17537273f0 | ||
|
459ae9334d | ||
|
a08ca88b24 | ||
|
e5d222867c | ||
|
54eebc4918 | ||
|
f3d0f70949 | ||
|
463a3d1f6a | ||
|
760c9d6a6a | ||
|
e14fe5f848 | ||
|
4139b6d029 | ||
|
78760fd3d8 | ||
|
d1bef7ea9a | ||
|
8984ea7b4d | ||
|
025ef096f7 | ||
|
010b9adb95 | ||
|
a95930282e | ||
|
e6fb3b4ea0 | ||
|
f5e52d209e | ||
|
f1fa472c9f | ||
|
ad4a011ebd | ||
|
d0962ccebe | ||
|
38c0d60047 | ||
|
2c12c9b010 | ||
|
d6d16aa17f | ||
|
7126a58f6f | ||
|
059acac8f9 | ||
|
f22bedf5af | ||
|
e71dfbb7db |
@ -16,12 +16,14 @@ set(QT_COPYRIGHT "Copyright (C) ${QT_COPYRIGHT_YEAR} The Qt Company Ltd and othe
|
|||||||
# Minimum requirement for building Qt
|
# Minimum requirement for building Qt
|
||||||
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_SHARED "3.16")
|
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_SHARED "3.16")
|
||||||
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_STATIC "3.21")
|
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_STATIC "3.21")
|
||||||
|
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_APPLE "3.21")
|
||||||
|
|
||||||
# Minimum requirement for consuming Qt in a user project.
|
# Minimum requirement for consuming Qt in a user project.
|
||||||
# This might be different in the future, e.g. be lower than the requirement for
|
# This might be different in the future, e.g. be lower than the requirement for
|
||||||
# building Qt.
|
# building Qt.
|
||||||
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_SHARED "3.16")
|
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_SHARED "3.16")
|
||||||
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_STATIC "3.21")
|
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_STATIC "3.21")
|
||||||
|
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_APPLE "3.21")
|
||||||
|
|
||||||
# Policy settings for commands defined by qtbase. These will also be injected
|
# Policy settings for commands defined by qtbase. These will also be injected
|
||||||
# into the top level policy scope of each Qt module when building Qt so that
|
# into the top level policy scope of each Qt module when building Qt so that
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -333,3 +333,4 @@ CTestTestfile.cmake
|
|||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
*_autogen
|
*_autogen
|
||||||
tst_*.xml
|
tst_*.xml
|
||||||
|
CMakeUserPresets.json
|
||||||
|
@ -128,7 +128,8 @@ check_cxx_source_compiles("
|
|||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
|
|
||||||
int main(int, char **) {
|
int main(int, char **) {
|
||||||
EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0;
|
[[maybe_unused]] EGLint x = 0;
|
||||||
|
EGLDisplay dpy = 0; EGLContext ctx = 0;
|
||||||
eglDestroyContext(dpy, ctx);
|
eglDestroyContext(dpy, ctx);
|
||||||
}" HAVE_EGL)
|
}" HAVE_EGL)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ set(gssapi_library_names
|
|||||||
gssapi # FreeBSD
|
gssapi # FreeBSD
|
||||||
gssapi_krb5
|
gssapi_krb5
|
||||||
)
|
)
|
||||||
if(VCPKG_TARGET_TRIPLET AND APPLE)
|
if(APPLE)
|
||||||
list(REMOVE_ITEM gssapi_library_names "gssapi_krb5")
|
list(REMOVE_ITEM gssapi_library_names "gssapi_krb5")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -5,18 +5,62 @@
|
|||||||
# FindMimer
|
# FindMimer
|
||||||
# ---------
|
# ---------
|
||||||
# Try to locate the Mimer SQL client library
|
# Try to locate the Mimer SQL client library
|
||||||
|
if(NOT DEFINED MimerSQL_ROOT)
|
||||||
|
if(DEFINED ENV{MIMERSQL_DEV_ROOT})
|
||||||
|
set(MimerSQL_ROOT "$ENV{MIMERSQL_DEV_ROOT}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(PkgConfig QUIET)
|
if(NOT DEFINED MimerSQL_ROOT)
|
||||||
pkg_check_modules(PC_Mimer QUIET mimctrl)
|
find_package(PkgConfig QUIET)
|
||||||
|
endif()
|
||||||
|
if(PkgConfig_FOUND AND NOT DEFINED MimerSQL_ROOT)
|
||||||
|
pkg_check_modules(PC_Mimer QUIET mimcontrol)
|
||||||
|
set(MimerSQL_include_dir_hints "${PC_MimerSQL_INCLUDEDIR}")
|
||||||
|
set(MimerSQL_library_hints "${PC_MimerSQL_LIBDIR}")
|
||||||
|
else()
|
||||||
|
if(DEFINED MimerSQL_ROOT)
|
||||||
|
if(WIN32)
|
||||||
|
set(MimerSQL_include_dir_hints "${MimerSQL_ROOT}\\include")
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86|X86)$")
|
||||||
|
set(MimerSQL_library_hints "${MimerSQL_ROOT}\\lib\\x86")
|
||||||
|
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd64|AMD64)$")
|
||||||
|
set(MimerSQL_library_hints "${MimerSQL_ROOT}\\lib\\amd64")
|
||||||
|
else()
|
||||||
|
set(MimerSQL_library_hints "")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(MimerSQL_include_dir_hints "${MimerSQL_ROOT}/include")
|
||||||
|
set(MimerSQL_library_hints "${MimerSQL_ROOT}/lib")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(WIN32)
|
||||||
|
set(MimerSQL_include_dir_hints "C:\\MimerSQLDev\\include")
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86|X86)$")
|
||||||
|
set(MimerSQL_library_hints "C:\\MimerSQLDev\\lib\\x86")
|
||||||
|
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd64|AMD64)$")
|
||||||
|
set(MimerSQL_library_hints "C:\\MimerSQLDev\\lib\\amd64")
|
||||||
|
else()
|
||||||
|
set(MimerSQL_library_hints "")
|
||||||
|
endif()
|
||||||
|
elseif(APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
set(MimerSQL_library_hints "/usr/local/lib")
|
||||||
|
set(MimerSQL_include_dir_hints "/usr/local/include")
|
||||||
|
else()
|
||||||
|
set(MimerSQL_include_dir_hints "")
|
||||||
|
set(MimerSQL_library_hints "")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
find_path(Mimer_INCLUDE_DIR
|
find_path(Mimer_INCLUDE_DIR
|
||||||
NAMES mimerapi.h
|
NAMES mimerapi.h
|
||||||
HINTS ${PC_Mimer_INCLUDEDIR})
|
HINTS ${MimerSQL_include_dir_hints})
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86|X86)$")
|
||||||
set(MIMER_LIBS_NAMES mimapi32)
|
set(MIMER_LIBS_NAMES mimapi32)
|
||||||
else()
|
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd64|AMD64)$")
|
||||||
set(MIMER_LIBS_NAMES mimapi64)
|
set(MIMER_LIBS_NAMES mimapi64)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
@ -25,7 +69,7 @@ endif()
|
|||||||
|
|
||||||
find_library(Mimer_LIBRARIES
|
find_library(Mimer_LIBRARIES
|
||||||
NAMES ${MIMER_LIBS_NAMES}
|
NAMES ${MIMER_LIBS_NAMES}
|
||||||
HINTS ${PC_Mimer_LIBDIR})
|
HINTS ${MimerSQL_library_hints})
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
@ -18,9 +18,7 @@ find_package_handle_standard_args(PPS DEFAULT_MSG PPS_INCLUDE_DIR PPS_LIBRARY)
|
|||||||
mark_as_advanced(PPS_INCLUDE_DIR PPS_LIBRARY)
|
mark_as_advanced(PPS_INCLUDE_DIR PPS_LIBRARY)
|
||||||
|
|
||||||
if(PPS_FOUND)
|
if(PPS_FOUND)
|
||||||
add_library(__PPS INTERFACE IMPORTED)
|
add_library(PPS::PPS INTERFACE IMPORTED)
|
||||||
target_link_libraries(__PPS INTERFACE "${PPS_LIBRARY}")
|
target_link_libraries(PPS::PPS INTERFACE "${PPS_LIBRARY}")
|
||||||
target_include_directories(__PPS INTERFACE "${PPS_INCLUDE_DIR}")
|
target_include_directories(PPS::PPS INTERFACE "${PPS_INCLUDE_DIR}")
|
||||||
|
|
||||||
add_library(PPS::PPS ALIAS __PPS)
|
|
||||||
endif()
|
endif()
|
||||||
|
@ -17,14 +17,18 @@ if (OpenGL_FOUND)
|
|||||||
|
|
||||||
add_library(WrapOpenGL::WrapOpenGL INTERFACE IMPORTED)
|
add_library(WrapOpenGL::WrapOpenGL INTERFACE IMPORTED)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
# CMake 3.27 and older:
|
||||||
# On Darwin platforms FindOpenGL sets IMPORTED_LOCATION to the absolute path of the library
|
# On Darwin platforms FindOpenGL sets IMPORTED_LOCATION to the absolute path of the library
|
||||||
# within the framework. This ends up as an absolute path link flag, which we don't want,
|
# within the framework. This ends up as an absolute path link flag, which we don't want,
|
||||||
# because that makes our .prl files un-relocatable.
|
# because that makes our .prl files un-relocatable.
|
||||||
# Extract the framework path instead, and use that in INTERFACE_LINK_LIBRARIES,
|
# Extract the framework path instead, and use that in INTERFACE_LINK_LIBRARIES,
|
||||||
# which CMake ends up transforming into a reloctable -framework flag.
|
# which CMake ends up transforming into a relocatable -framework flag.
|
||||||
# See https://gitlab.kitware.com/cmake/cmake/-/issues/20871 for details.
|
# See https://gitlab.kitware.com/cmake/cmake/-/issues/20871 for details.
|
||||||
|
#
|
||||||
|
# CMake 3.28 and above:
|
||||||
|
# IMPORTED_LOCATION is the absolute path the the OpenGL.framework folder.
|
||||||
get_target_property(__opengl_fw_lib_path OpenGL::GL IMPORTED_LOCATION)
|
get_target_property(__opengl_fw_lib_path OpenGL::GL IMPORTED_LOCATION)
|
||||||
if(__opengl_fw_lib_path)
|
if(__opengl_fw_lib_path AND NOT __opengl_fw_lib_path MATCHES "/([^/]+)\\.framework$")
|
||||||
get_filename_component(__opengl_fw_path "${__opengl_fw_lib_path}" DIRECTORY)
|
get_filename_component(__opengl_fw_path "${__opengl_fw_lib_path}" DIRECTORY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -48,6 +48,26 @@ if(Vulkan_INCLUDE_DIR)
|
|||||||
target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE
|
target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE
|
||||||
${__qt_molten_vk_homebrew_include_path})
|
${__qt_molten_vk_homebrew_include_path})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Check for homebrew vulkan-headers folder structure
|
||||||
|
# If instead of molten-vk folder, CMAKE_PREFIX_PATH points to Homebrew's
|
||||||
|
# vulkan-headers installation, then we will not be able to find molten-vk
|
||||||
|
# headers. If we assume that user has installed the molten-vk formula as
|
||||||
|
# well, then we might have a chance to pick it up like this.
|
||||||
|
if(Vulkan_INCLUDE_DIR MATCHES "/homebrew/Cellar/")
|
||||||
|
set(__qt_standalone_molten_vk_homebrew_include_path
|
||||||
|
"${Vulkan_INCLUDE_DIR}/../../../../opt/molten-vk/include")
|
||||||
|
else()
|
||||||
|
set(__qt_standalone_molten_vk_homebrew_include_path
|
||||||
|
"${Vulkan_INCLUDE_DIR}/../../molten-vk/include")
|
||||||
|
endif()
|
||||||
|
get_filename_component(
|
||||||
|
__qt_standalone_molten_vk_homebrew_include_path
|
||||||
|
"${__qt_standalone_molten_vk_homebrew_include_path}" ABSOLUTE)
|
||||||
|
if(EXISTS "${__qt_standalone_molten_vk_homebrew_include_path}")
|
||||||
|
target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE
|
||||||
|
${__qt_standalone_molten_vk_homebrew_include_path})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ function(qt_internal_add_app target)
|
|||||||
${arg_NO_UNITY_BUILD}
|
${arg_NO_UNITY_BUILD}
|
||||||
${forward_install_dir}
|
${forward_install_dir}
|
||||||
SOURCES ${arg_SOURCES}
|
SOURCES ${arg_SOURCES}
|
||||||
|
NO_PCH_SOURCES ${arg_NO_PCH_SOURCES}
|
||||||
NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}
|
NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}
|
||||||
INCLUDE_DIRECTORIES
|
INCLUDE_DIRECTORIES
|
||||||
${arg_INCLUDE_DIRECTORIES}
|
${arg_INCLUDE_DIRECTORIES}
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
# Make sure to not run detection when building standalone tests, because the detection was already
|
# Make sure to not run detection when building standalone tests, because the detection was already
|
||||||
# done when initially configuring qtbase.
|
# done when initially configuring qtbase.
|
||||||
|
|
||||||
|
# This needs to be here because QtAutoDetect loads before any other modules
|
||||||
|
option(QT_USE_VCPKG "Enable the use of vcpkg" ON)
|
||||||
|
|
||||||
function(qt_internal_ensure_static_qt_config)
|
function(qt_internal_ensure_static_qt_config)
|
||||||
if(NOT DEFINED BUILD_SHARED_LIBS)
|
if(NOT DEFINED BUILD_SHARED_LIBS)
|
||||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Qt statically or dynamically" FORCE)
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Qt statically or dynamically" FORCE)
|
||||||
@ -161,7 +164,7 @@ function(qt_auto_detect_android)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_auto_detect_vcpkg)
|
function(qt_auto_detect_vcpkg)
|
||||||
if(DEFINED ENV{VCPKG_ROOT})
|
if(QT_USE_VCPKG AND DEFINED ENV{VCPKG_ROOT})
|
||||||
set(vcpkg_toolchain_file "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
|
set(vcpkg_toolchain_file "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
|
||||||
get_filename_component(vcpkg_toolchain_file "${vcpkg_toolchain_file}" ABSOLUTE)
|
get_filename_component(vcpkg_toolchain_file "${vcpkg_toolchain_file}" ABSOLUTE)
|
||||||
|
|
||||||
@ -174,8 +177,8 @@ function(qt_auto_detect_vcpkg)
|
|||||||
endif()
|
endif()
|
||||||
set(CMAKE_TOOLCHAIN_FILE "${vcpkg_toolchain_file}" CACHE STRING "" FORCE)
|
set(CMAKE_TOOLCHAIN_FILE "${vcpkg_toolchain_file}" CACHE STRING "" FORCE)
|
||||||
message(STATUS "Using vcpkg from $ENV{VCPKG_ROOT}")
|
message(STATUS "Using vcpkg from $ENV{VCPKG_ROOT}")
|
||||||
if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
|
if(DEFINED ENV{QT_VCPKG_TARGET_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
|
||||||
set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "")
|
set(VCPKG_TARGET_TRIPLET "$ENV{QT_VCPKG_TARGET_TRIPLET}" CACHE STRING "")
|
||||||
message(STATUS "Using vcpkg triplet ${VCPKG_TARGET_TRIPLET}")
|
message(STATUS "Using vcpkg triplet ${VCPKG_TARGET_TRIPLET}")
|
||||||
endif()
|
endif()
|
||||||
unset(vcpkg_toolchain_file)
|
unset(vcpkg_toolchain_file)
|
||||||
@ -241,7 +244,15 @@ function(qt_auto_detect_ios)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_auto_detect_cmake_config)
|
function(qt_auto_detect_cmake_config)
|
||||||
if(CMAKE_CONFIGURATION_TYPES)
|
# If CMAKE_CONFIGURATION_TYPES are not set for the multi-config generator use Release and
|
||||||
|
# Debug configurations by default, instead of those are proposed by the CMake internal logic.
|
||||||
|
get_property(is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
if(is_multi)
|
||||||
|
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
set(CMAKE_CONFIGURATION_TYPES Release Debug)
|
||||||
|
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Allow users to specify this option.
|
# Allow users to specify this option.
|
||||||
if(NOT QT_MULTI_CONFIG_FIRST_CONFIG)
|
if(NOT QT_MULTI_CONFIG_FIRST_CONFIG)
|
||||||
list(GET CMAKE_CONFIGURATION_TYPES 0 first_config_type)
|
list(GET CMAKE_CONFIGURATION_TYPES 0 first_config_type)
|
||||||
@ -478,6 +489,12 @@ function(qt_auto_detect_integrity)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Save the build type before project() might set one.
|
||||||
|
# This allows us to determine if the user has set an explicit build type that we should use.
|
||||||
|
function(qt_auto_detect_cmake_build_type)
|
||||||
|
set(__qt_auto_detect_cmake_build_type_before_project_call "${CMAKE_BUILD_TYPE}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# Let CMake load our custom platform modules.
|
# Let CMake load our custom platform modules.
|
||||||
# CMake-provided platform modules take precedence.
|
# CMake-provided platform modules take precedence.
|
||||||
if(NOT QT_AVOID_CUSTOM_PLATFORM_MODULES)
|
if(NOT QT_AVOID_CUSTOM_PLATFORM_MODULES)
|
||||||
@ -497,3 +514,4 @@ qt_auto_detect_wasm()
|
|||||||
qt_auto_detect_win32_arm()
|
qt_auto_detect_win32_arm()
|
||||||
qt_auto_detect_linux_x86()
|
qt_auto_detect_linux_x86()
|
||||||
qt_auto_detect_integrity()
|
qt_auto_detect_integrity()
|
||||||
|
qt_auto_detect_cmake_build_type()
|
||||||
|
@ -216,6 +216,7 @@ qt_copy_or_install(FILES
|
|||||||
cmake/QtAndroidHelpers.cmake
|
cmake/QtAndroidHelpers.cmake
|
||||||
cmake/QtAppHelpers.cmake
|
cmake/QtAppHelpers.cmake
|
||||||
cmake/QtAutogenHelpers.cmake
|
cmake/QtAutogenHelpers.cmake
|
||||||
|
cmake/QtBaseTopLevelHelpers.cmake
|
||||||
cmake/QtBuild.cmake
|
cmake/QtBuild.cmake
|
||||||
cmake/QtBuildInformation.cmake
|
cmake/QtBuildInformation.cmake
|
||||||
cmake/QtCMakeHelpers.cmake
|
cmake/QtCMakeHelpers.cmake
|
||||||
@ -375,6 +376,10 @@ qt_copy_or_install(DIRECTORY cmake/
|
|||||||
FILES_MATCHING PATTERN "Find*.cmake"
|
FILES_MATCHING PATTERN "Find*.cmake"
|
||||||
PATTERN "tests" EXCLUDE
|
PATTERN "tests" EXCLUDE
|
||||||
PATTERN "3rdparty" EXCLUDE
|
PATTERN "3rdparty" EXCLUDE
|
||||||
|
PATTERN "macos" EXCLUDE
|
||||||
|
PATTERN "ios" EXCLUDE
|
||||||
|
PATTERN "platforms" EXCLUDE
|
||||||
|
PATTERN "QtBuildInternals" EXCLUDE
|
||||||
)
|
)
|
||||||
|
|
||||||
# In prefix builds we also need to copy the files into the build config directory, so that the
|
# In prefix builds we also need to copy the files into the build config directory, so that the
|
||||||
@ -385,6 +390,10 @@ if(QT_WILL_INSTALL)
|
|||||||
FILES_MATCHING PATTERN "Find*.cmake"
|
FILES_MATCHING PATTERN "Find*.cmake"
|
||||||
PATTERN "tests" EXCLUDE
|
PATTERN "tests" EXCLUDE
|
||||||
PATTERN "3rdparty" EXCLUDE
|
PATTERN "3rdparty" EXCLUDE
|
||||||
|
PATTERN "macos" EXCLUDE
|
||||||
|
PATTERN "ios" EXCLUDE
|
||||||
|
PATTERN "platforms" EXCLUDE
|
||||||
|
PATTERN "QtBuildInternals" EXCLUDE
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
85
cmake/QtBaseTopLevelHelpers.cmake
Normal file
85
cmake/QtBaseTopLevelHelpers.cmake
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
# Copyright (C) 2023 The Qt Company Ltd.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
# Depends on __qt6_qtbase_src_path being set in the top-level dir.
|
||||||
|
macro(qt_internal_top_level_setup_autodetect)
|
||||||
|
# Run platform auto-detection /before/ the first project() call and thus
|
||||||
|
# before the toolchain file is loaded.
|
||||||
|
# Don't run auto-detection when doing standalone tests. In that case, the detection
|
||||||
|
# results are taken from either QtBuildInternals or the qt.toolchain.cmake file.
|
||||||
|
|
||||||
|
if(NOT QT_BUILD_STANDALONE_TESTS)
|
||||||
|
set(__qt6_auto_detect_path "${__qt6_qtbase_src_path}/cmake/QtAutoDetect.cmake")
|
||||||
|
if(NOT EXISTS "${__qt6_auto_detect_path}")
|
||||||
|
message(FATAL_ERROR "Required file does not exist: '${__qt6_auto_detect_path}'")
|
||||||
|
endif()
|
||||||
|
include("${__qt6_auto_detect_path}")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(qt_internal_top_level_setup_after_project)
|
||||||
|
# TODO: Remove this variable once the top-level calls this function and
|
||||||
|
# qt_internal_qt_configure_end is not called in qt_print_build_instructions anymore.
|
||||||
|
set(__qt6_top_level_after_project_called TRUE)
|
||||||
|
|
||||||
|
qt_internal_top_level_setup_testing()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(qt_internal_top_level_setup_testing)
|
||||||
|
# Required so we can call ctest from the root build directory
|
||||||
|
enable_testing()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Depends on __qt6_qtbase_src_path being set in the top-level dir.
|
||||||
|
macro(qt_internal_top_level_setup_cmake_module_path)
|
||||||
|
if (NOT QT_BUILD_STANDALONE_TESTS)
|
||||||
|
set(__qt6_cmake_module_path "${__qt6_qtbase_src_path}/cmake")
|
||||||
|
if(NOT EXISTS "${__qt6_cmake_module_path}")
|
||||||
|
message(FATAL_ERROR "Required directory does not exist: '${__qt6_cmake_module_path}'")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${__qt6_cmake_module_path}")
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH
|
||||||
|
"${__qt6_cmake_module_path}/3rdparty/extra-cmake-modules/find-modules")
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${__qt6_cmake_module_path}/3rdparty/kwin")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(qt_internal_top_level_before_build_submodules)
|
||||||
|
qt_internal_top_level_setup_no_create_targets()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(qt_internal_top_level_setup_no_create_targets)
|
||||||
|
# Also make sure the CMake config files do not recreate the already-existing targets
|
||||||
|
if (NOT QT_BUILD_STANDALONE_TESTS)
|
||||||
|
set(QT_NO_CREATE_TARGETS TRUE)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(qt_internal_top_level_end)
|
||||||
|
qt_internal_print_top_level_info()
|
||||||
|
|
||||||
|
# Depends on QtBuildInternalsConfig being included, which is the case whenver any repo is
|
||||||
|
# configured.
|
||||||
|
qt_internal_qt_configure_end()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
function(qt_internal_print_top_level_info)
|
||||||
|
if(NOT QT_BUILD_STANDALONE_TESTS)
|
||||||
|
# Display a summary of everything
|
||||||
|
include(QtBuildInformation)
|
||||||
|
include(QtPlatformSupport)
|
||||||
|
qt_print_feature_summary()
|
||||||
|
qt_print_build_instructions()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
macro(qt_internal_top_level_after_add_subdirectory)
|
||||||
|
if(module STREQUAL "qtbase")
|
||||||
|
if (NOT QT_BUILD_STANDALONE_TESTS)
|
||||||
|
list(APPEND CMAKE_PREFIX_PATH "${QtBase_BINARY_DIR}/${INSTALL_LIBDIR}/cmake")
|
||||||
|
list(APPEND CMAKE_FIND_ROOT_PATH "${QtBase_BINARY_DIR}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
@ -281,7 +281,7 @@ qt_setup_tool_path_command()
|
|||||||
# Platform define path, etc.
|
# Platform define path, etc.
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(QT_DEFAULT_PLATFORM_DEFINITIONS WIN32 _ENABLE_EXTENDED_ALIGNED_STORAGE)
|
set(QT_DEFAULT_PLATFORM_DEFINITIONS WIN32 _ENABLE_EXTENDED_ALIGNED_STORAGE)
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
if(QT_64BIT)
|
||||||
list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS WIN64 _WIN64)
|
list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS WIN64 _WIN64)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -467,6 +467,7 @@ set(__default_private_args
|
|||||||
DISABLE_AUTOGEN_TOOLS
|
DISABLE_AUTOGEN_TOOLS
|
||||||
ENABLE_AUTOGEN_TOOLS
|
ENABLE_AUTOGEN_TOOLS
|
||||||
PLUGIN_TYPES
|
PLUGIN_TYPES
|
||||||
|
NO_PCH_SOURCES
|
||||||
NO_UNITY_BUILD_SOURCES
|
NO_UNITY_BUILD_SOURCES
|
||||||
)
|
)
|
||||||
set(__default_public_args
|
set(__default_public_args
|
||||||
|
@ -111,6 +111,13 @@ from the build directory")
|
|||||||
if(QT_SUPERBUILD)
|
if(QT_SUPERBUILD)
|
||||||
qt_internal_save_previously_visited_packages()
|
qt_internal_save_previously_visited_packages()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# TODO: Abuse qt_print_build_instructions being called as the last command in a top-level build.
|
||||||
|
# Instead we should call this explicitly at the end of the top-level project.
|
||||||
|
# TODO: Remove this once the top-level calls qt_internal_top_level_setup_after_project
|
||||||
|
if(QT_SUPERBUILD AND NOT __qt6_top_level_after_project_called)
|
||||||
|
qt_internal_qt_configure_end()
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_configure_print_summary_helper summary_reports force_show)
|
function(qt_configure_print_summary_helper summary_reports force_show)
|
||||||
|
@ -105,6 +105,30 @@ endif()
|
|||||||
# build.
|
# build.
|
||||||
include(QtPlatformSupport)
|
include(QtPlatformSupport)
|
||||||
|
|
||||||
|
# Set FEATURE_${feature} if INPUT_${feature} is set in certain circumstances.
|
||||||
|
#
|
||||||
|
# Needs to be in QtBuildInternalsConfig.cmake instead of QtFeature.cmake because it's used in
|
||||||
|
# qt_build_internals_disable_pkg_config_if_needed.
|
||||||
|
function(qt_internal_compute_feature_value_from_possible_input feature)
|
||||||
|
# If FEATURE_ is not defined try to use the INPUT_ variable to enable/disable feature.
|
||||||
|
# If FEATURE_ is defined and the configure script is being used (so
|
||||||
|
# QT_INTERNAL_CALLED_FROM_CONFIGURE is TRUE), ignore the FEATURE_ variable, and take into
|
||||||
|
# account the INPUT_ variable instead, because a command line argument takes priority over
|
||||||
|
# a pre-cached FEATURE_ variable.
|
||||||
|
if((NOT DEFINED FEATURE_${feature} OR QT_INTERNAL_CALLED_FROM_CONFIGURE)
|
||||||
|
AND DEFINED INPUT_${feature}
|
||||||
|
AND NOT "${INPUT_${feature}}" STREQUAL "undefined"
|
||||||
|
AND NOT "${INPUT_${feature}}" STREQUAL "")
|
||||||
|
if(INPUT_${feature})
|
||||||
|
set(FEATURE_${feature} ON)
|
||||||
|
else()
|
||||||
|
set(FEATURE_${feature} OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(FEATURE_${feature} "${FEATURE_${feature}}" PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(qt_build_internals_disable_pkg_config_if_needed)
|
function(qt_build_internals_disable_pkg_config_if_needed)
|
||||||
# pkg-config should not be used by default on Darwin and Windows platforms (and QNX), as defined
|
# pkg-config should not be used by default on Darwin and Windows platforms (and QNX), as defined
|
||||||
# in the qtbase/configure.json. Unfortunately by the time the feature is evaluated there are
|
# in the qtbase/configure.json. Unfortunately by the time the feature is evaluated there are
|
||||||
@ -131,15 +155,7 @@ function(qt_build_internals_disable_pkg_config_if_needed)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Features won't have been evaluated yet if this is the first run, have to evaluate this here
|
# Features won't have been evaluated yet if this is the first run, have to evaluate this here
|
||||||
if ((NOT DEFINED "FEATURE_pkg_config") AND (DEFINED "INPUT_pkg_config")
|
qt_internal_compute_feature_value_from_possible_input(pkg_config)
|
||||||
AND (NOT "${INPUT_pkg_config}" STREQUAL "undefined")
|
|
||||||
AND (NOT "${INPUT_pkg_config}" STREQUAL ""))
|
|
||||||
if(INPUT_pkg_config)
|
|
||||||
set(FEATURE_pkg_config ON)
|
|
||||||
else()
|
|
||||||
set(FEATURE_pkg_config OFF)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# If user explicitly specified a value for the feature, honor it, even if it might break
|
# If user explicitly specified a value for the feature, honor it, even if it might break
|
||||||
# the build.
|
# the build.
|
||||||
@ -328,24 +344,19 @@ function(qt_build_internals_add_toplevel_targets)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
macro(qt_enable_cmake_languages)
|
macro(qt_enable_cmake_languages)
|
||||||
include(CheckLanguage)
|
|
||||||
set(__qt_required_language_list C CXX)
|
set(__qt_required_language_list C CXX)
|
||||||
set(__qt_optional_language_list )
|
set(__qt_platform_required_language_list )
|
||||||
|
|
||||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/20545
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
list(APPEND __qt_optional_language_list OBJC OBJCXX)
|
list(APPEND __qt_platform_required_language_list OBJC OBJCXX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(__qt_lang ${__qt_required_language_list})
|
foreach(__qt_lang ${__qt_required_language_list})
|
||||||
enable_language(${__qt_lang})
|
enable_language(${__qt_lang})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
foreach(__qt_lang ${__qt_optional_language_list})
|
foreach(__qt_lang ${__qt_platform_required_language_list})
|
||||||
check_language(${__qt_lang})
|
enable_language(${__qt_lang})
|
||||||
if(CMAKE_${__qt_lang}_COMPILER)
|
|
||||||
enable_language(${__qt_lang})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# The qtbase call is handled in qtbase/CMakeLists.txt.
|
# The qtbase call is handled in qtbase/CMakeLists.txt.
|
||||||
@ -454,6 +465,12 @@ macro(qt_build_repo_begin)
|
|||||||
add_custom_target(sync_headers)
|
add_custom_target(sync_headers)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# The special target that we use to sync 3rd-party headers before the gn run when building
|
||||||
|
# qtwebengine in top-level builds.
|
||||||
|
if(NOT TARGET thirdparty_sync_headers)
|
||||||
|
add_custom_target(thirdparty_sync_headers)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add global qt_plugins, qpa_plugins and qpa_default_plugins convenience custom targets.
|
# Add global qt_plugins, qpa_plugins and qpa_default_plugins convenience custom targets.
|
||||||
# Internal executables will add a dependency on the qpa_default_plugins target,
|
# Internal executables will add a dependency on the qpa_default_plugins target,
|
||||||
# so that building and running a test ensures it won't fail at runtime due to a missing qpa
|
# so that building and running a test ensures it won't fail at runtime due to a missing qpa
|
||||||
@ -589,9 +606,27 @@ macro(qt_build_repo_end)
|
|||||||
set(QT_INTERNAL_FRESH_REQUESTED "FALSE" CACHE INTERNAL "")
|
set(QT_INTERNAL_FRESH_REQUESTED "FALSE" CACHE INTERNAL "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT QT_SUPERBUILD)
|
||||||
|
qt_internal_qt_configure_end()
|
||||||
|
endif()
|
||||||
|
|
||||||
list(POP_BACK CMAKE_MESSAGE_CONTEXT)
|
list(POP_BACK CMAKE_MESSAGE_CONTEXT)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
# Function called either at the end of per-repo configuration, or at the end of configuration of
|
||||||
|
# a super build.
|
||||||
|
# At the moment it is called before examples are configured in a per-repo build. We might want
|
||||||
|
# to change that at some point if needed.
|
||||||
|
function(qt_internal_qt_configure_end)
|
||||||
|
# If Qt is configued via the configure script, remove the marker variable, so that any future
|
||||||
|
# reconfigurations that are done by calling cmake directly don't trigger configure specific
|
||||||
|
# logic.
|
||||||
|
unset(QT_INTERNAL_CALLED_FROM_CONFIGURE CACHE)
|
||||||
|
|
||||||
|
# Clean up stale feature input values.
|
||||||
|
qt_internal_clean_feature_inputs()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
macro(qt_build_repo)
|
macro(qt_build_repo)
|
||||||
qt_build_repo_begin(${ARGN})
|
qt_build_repo_begin(${ARGN})
|
||||||
|
|
||||||
@ -999,19 +1034,118 @@ set(CMAKE_INSTALL_PREFIX \"\${_qt_internal_examples_cmake_install_prefix_backup}
|
|||||||
set(CMAKE_UNITY_BUILD ${QT_UNITY_BUILD})
|
set(CMAKE_UNITY_BUILD ${QT_UNITY_BUILD})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
# Allows building an example either as an ExternalProject or in-tree with the Qt build.
|
||||||
|
# Also allows installing the example sources.
|
||||||
function(qt_internal_add_example subdir)
|
function(qt_internal_add_example subdir)
|
||||||
if(NOT QT_IS_EXTERNAL_EXAMPLES_BUILD)
|
# Pre-compute unique example name based on the subdir, in case of target name clashes.
|
||||||
qt_internal_add_example_in_tree(${ARGV})
|
qt_internal_get_example_unique_name(unique_example_name "${subdir}")
|
||||||
else()
|
|
||||||
qt_internal_add_example_external_project(${ARGV})
|
# QT_INTERNAL_NO_CONFIGURE_EXAMPLES is not meant to be used by Qt builders, it's here for faster
|
||||||
|
# testing of the source installation code path for build system engineers.
|
||||||
|
if(NOT QT_INTERNAL_NO_CONFIGURE_EXAMPLES)
|
||||||
|
if(NOT QT_IS_EXTERNAL_EXAMPLES_BUILD)
|
||||||
|
qt_internal_add_example_in_tree("${subdir}")
|
||||||
|
else()
|
||||||
|
qt_internal_add_example_external_project("${subdir}"
|
||||||
|
NAME "${unique_example_name}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(QT_INSTALL_EXAMPLES_SOURCES)
|
||||||
|
string(TOLOWER ${PROJECT_NAME} project_name_lower)
|
||||||
|
|
||||||
|
qt_internal_install_example_sources("${subdir}"
|
||||||
|
NAME "${unique_example_name}"
|
||||||
|
REPO_NAME "${project_name_lower}")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Gets the install prefix where an example should be installed.
|
||||||
|
# Used for computing the final installation path.
|
||||||
|
function(qt_internal_get_example_install_prefix out_var)
|
||||||
|
# Allow customizing the installation path of the examples. Will be used in CI.
|
||||||
|
if(QT_INTERNAL_EXAMPLES_INSTALL_PREFIX)
|
||||||
|
set(qt_example_install_prefix "${QT_INTERNAL_EXAMPLES_INSTALL_PREFIX}")
|
||||||
|
else()
|
||||||
|
set(qt_example_install_prefix "${CMAKE_INSTALL_PREFIX}/${INSTALL_EXAMPLESDIR}")
|
||||||
|
endif()
|
||||||
|
file(TO_CMAKE_PATH "${qt_example_install_prefix}" qt_example_install_prefix)
|
||||||
|
set(${out_var} "${qt_example_install_prefix}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Gets the install prefix where an example's sources should be installed.
|
||||||
|
# Used for computing the final installation path.
|
||||||
|
function(qt_internal_get_examples_sources_install_prefix out_var)
|
||||||
|
# Allow customizing the installation path of the examples source specifically.
|
||||||
|
if(QT_INTERNAL_EXAMPLES_SOURCES_INSTALL_PREFIX)
|
||||||
|
set(qt_example_install_prefix "${QT_INTERNAL_EXAMPLES_SOURCES_INSTALL_PREFIX}")
|
||||||
|
else()
|
||||||
|
qt_internal_get_example_install_prefix(qt_example_install_prefix)
|
||||||
|
endif()
|
||||||
|
file(TO_CMAKE_PATH "${qt_example_install_prefix}" qt_example_install_prefix)
|
||||||
|
set(${out_var} "${qt_example_install_prefix}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Gets the relative path of an example, relative to the current repo's examples source dir.
|
||||||
|
# QT_EXAMPLE_BASE_DIR is meant to be already set in a parent scope.
|
||||||
|
function(qt_internal_get_example_rel_path out_var subdir)
|
||||||
|
file(RELATIVE_PATH example_rel_path
|
||||||
|
"${QT_EXAMPLE_BASE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}")
|
||||||
|
set(${out_var} "${example_rel_path}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Gets the install path where an example should be installed.
|
||||||
|
function(qt_internal_get_example_install_path out_var subdir)
|
||||||
|
qt_internal_get_example_install_prefix(qt_example_install_prefix)
|
||||||
|
qt_internal_get_example_rel_path(example_rel_path "${subdir}")
|
||||||
|
set(example_install_path "${qt_example_install_prefix}/${example_rel_path}")
|
||||||
|
|
||||||
|
set(${out_var} "${example_install_path}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Gets the install path where an example's sources should be installed.
|
||||||
|
function(qt_internal_get_examples_sources_install_path out_var subdir)
|
||||||
|
qt_internal_get_examples_sources_install_prefix(qt_example_install_prefix)
|
||||||
|
qt_internal_get_example_rel_path(example_rel_path "${subdir}")
|
||||||
|
set(example_install_path "${qt_example_install_prefix}/${example_rel_path}")
|
||||||
|
|
||||||
|
set(${out_var} "${example_install_path}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Get the unique name of an example project based on its subdir or explicitly given name.
|
||||||
|
# Makes the name unique by appending a short sha1 hash of the relative path of the example
|
||||||
|
# if a target of the same name already exist.
|
||||||
|
function(qt_internal_get_example_unique_name out_var subdir)
|
||||||
|
qt_internal_get_example_rel_path(example_rel_path "${subdir}")
|
||||||
|
|
||||||
|
set(name "${subdir}")
|
||||||
|
|
||||||
|
# qtdeclarative has calls like qt_internal_add_example(imagine/automotive)
|
||||||
|
# so passing a nested subdirectory. Custom targets (and thus ExternalProjects) can't contain
|
||||||
|
# slashes, so extract the last part of the path to be used as a name.
|
||||||
|
if(name MATCHES "/")
|
||||||
|
string(REPLACE "/" ";" exploded_path "${name}")
|
||||||
|
list(POP_BACK exploded_path last_dir)
|
||||||
|
if(NOT last_dir)
|
||||||
|
message(FATAL_ERROR "Example subdirectory must have a name.")
|
||||||
|
else()
|
||||||
|
set(name "${last_dir}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Likely a clash with an example subdir ExternalProject custom target of the same name in a
|
||||||
|
# top-level build.
|
||||||
|
if(TARGET "${name}")
|
||||||
|
string(SHA1 rel_path_hash "${example_rel_path}")
|
||||||
|
string(SUBSTRING "${rel_path_hash}" 0 4 short_hash)
|
||||||
|
set(name "${name}-${short_hash}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${out_var} "${name}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Use old non-ExternalProject approach, aka build in-tree with the Qt build.
|
# Use old non-ExternalProject approach, aka build in-tree with the Qt build.
|
||||||
function(qt_internal_add_example_in_tree subdir)
|
function(qt_internal_add_example_in_tree subdir)
|
||||||
file(RELATIVE_PATH example_rel_path
|
|
||||||
"${QT_EXAMPLE_BASE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}")
|
|
||||||
|
|
||||||
# Unset the default CMAKE_INSTALL_PREFIX that's generated in
|
# Unset the default CMAKE_INSTALL_PREFIX that's generated in
|
||||||
# ${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake
|
# ${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake
|
||||||
# so we can override it with a different value in
|
# so we can override it with a different value in
|
||||||
@ -1025,15 +1159,8 @@ unset(CMAKE_INSTALL_PREFIX)
|
|||||||
|
|
||||||
# Override the install prefix in the subdir cmake_install.cmake, so that
|
# Override the install prefix in the subdir cmake_install.cmake, so that
|
||||||
# relative install(TARGETS DESTINATION) calls in example projects install where we tell them to.
|
# relative install(TARGETS DESTINATION) calls in example projects install where we tell them to.
|
||||||
# Allow customizing the installation path of the examples. Will be used in CI.
|
qt_internal_get_example_install_path(example_install_path "${subdir}")
|
||||||
if(QT_INTERNAL_EXAMPLES_INSTALL_PREFIX)
|
set(CMAKE_INSTALL_PREFIX "${example_install_path}")
|
||||||
set(qt_example_install_prefix "${QT_INTERNAL_EXAMPLES_INSTALL_PREFIX}")
|
|
||||||
else()
|
|
||||||
set(qt_example_install_prefix "${CMAKE_INSTALL_PREFIX}/${INSTALL_EXAMPLESDIR}")
|
|
||||||
endif()
|
|
||||||
file(TO_CMAKE_PATH "${qt_example_install_prefix}" qt_example_install_prefix)
|
|
||||||
|
|
||||||
set(CMAKE_INSTALL_PREFIX "${qt_example_install_prefix}/${example_rel_path}")
|
|
||||||
|
|
||||||
# Make sure unclean example projects have their INSTALL_EXAMPLEDIR set to "."
|
# Make sure unclean example projects have their INSTALL_EXAMPLEDIR set to "."
|
||||||
# Won't have any effect on example projects that don't use INSTALL_EXAMPLEDIR.
|
# Won't have any effect on example projects that don't use INSTALL_EXAMPLEDIR.
|
||||||
@ -1043,7 +1170,7 @@ unset(CMAKE_INSTALL_PREFIX)
|
|||||||
# TODO: Remove once all repositories use qt_internal_add_example instead of add_subdirectory.
|
# TODO: Remove once all repositories use qt_internal_add_example instead of add_subdirectory.
|
||||||
set(QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT ON)
|
set(QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT ON)
|
||||||
|
|
||||||
add_subdirectory(${subdir} ${ARGN})
|
add_subdirectory(${subdir})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_internal_add_example_external_project subdir)
|
function(qt_internal_add_example_external_project subdir)
|
||||||
@ -1053,33 +1180,6 @@ function(qt_internal_add_example_external_project subdir)
|
|||||||
|
|
||||||
cmake_parse_arguments(PARSE_ARGV 1 arg "${options}" "${singleOpts}" "${multiOpts}")
|
cmake_parse_arguments(PARSE_ARGV 1 arg "${options}" "${singleOpts}" "${multiOpts}")
|
||||||
|
|
||||||
file(RELATIVE_PATH example_rel_path
|
|
||||||
"${QT_EXAMPLE_BASE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}")
|
|
||||||
|
|
||||||
if(NOT arg_NAME)
|
|
||||||
set(arg_NAME "${subdir}")
|
|
||||||
|
|
||||||
# qtdeclarative has calls like qt_internal_add_example(imagine/automotive)
|
|
||||||
# so passing a nested subdirectory. Custom targets (and thus ExternalProjects) can't contain
|
|
||||||
# slashes, so extract the last part of the path to be used as a name.
|
|
||||||
if(arg_NAME MATCHES "/")
|
|
||||||
string(REPLACE "/" ";" exploded_path "${arg_NAME}")
|
|
||||||
list(POP_BACK exploded_path last_dir)
|
|
||||||
if(NOT last_dir)
|
|
||||||
message(FATAL_ERROR "Example subdirectory must have a name.")
|
|
||||||
else()
|
|
||||||
set(arg_NAME "${last_dir}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Likely a clash with an example subdir ExternalProject custom target of the same name.
|
|
||||||
if(TARGET "${arg_NAME}")
|
|
||||||
string(SHA1 rel_path_hash "${example_rel_path}")
|
|
||||||
string(SUBSTRING "${rel_path_hash}" 0 4 short_hash)
|
|
||||||
set(arg_NAME "${arg_NAME}-${short_hash}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# TODO: Fix example builds when using Conan / install prefixes are different for each repo.
|
# TODO: Fix example builds when using Conan / install prefixes are different for each repo.
|
||||||
if(QT_SUPERBUILD OR QtBase_BINARY_DIR)
|
if(QT_SUPERBUILD OR QtBase_BINARY_DIR)
|
||||||
# When doing a top-level build or when building qtbase,
|
# When doing a top-level build or when building qtbase,
|
||||||
@ -1300,15 +1400,7 @@ function(qt_internal_add_example_external_project subdir)
|
|||||||
# example_source_dir, use _qt_internal_override_example_install_dir_to_dot to ensure
|
# example_source_dir, use _qt_internal_override_example_install_dir_to_dot to ensure
|
||||||
# INSTALL_EXAMPLEDIR does not interfere.
|
# INSTALL_EXAMPLEDIR does not interfere.
|
||||||
|
|
||||||
# Allow customizing the installation path of the examples. Will be used in CI.
|
qt_internal_get_example_install_path(example_install_path "${subdir}")
|
||||||
if(QT_INTERNAL_EXAMPLES_INSTALL_PREFIX)
|
|
||||||
set(qt_example_install_prefix "${QT_INTERNAL_EXAMPLES_INSTALL_PREFIX}")
|
|
||||||
else()
|
|
||||||
set(qt_example_install_prefix "${CMAKE_INSTALL_PREFIX}/${INSTALL_EXAMPLESDIR}")
|
|
||||||
endif()
|
|
||||||
file(TO_CMAKE_PATH "${qt_example_install_prefix}" qt_example_install_prefix)
|
|
||||||
|
|
||||||
set(example_install_prefix "${qt_example_install_prefix}/${example_rel_path}")
|
|
||||||
|
|
||||||
set(ep_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
|
set(ep_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
|
||||||
|
|
||||||
@ -1323,7 +1415,7 @@ function(qt_internal_add_example_external_project subdir)
|
|||||||
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/${subdir}-ep"
|
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/${subdir}-ep"
|
||||||
STAMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/${subdir}-ep/stamp"
|
STAMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/${subdir}-ep/stamp"
|
||||||
BINARY_DIR "${ep_binary_dir}"
|
BINARY_DIR "${ep_binary_dir}"
|
||||||
INSTALL_DIR "${example_install_prefix}"
|
INSTALL_DIR "${example_install_path}"
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
${build_command}
|
${build_command}
|
||||||
TEST_COMMAND ""
|
TEST_COMMAND ""
|
||||||
@ -1377,6 +1469,54 @@ execute_process(
|
|||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(qt_internal_install_example_sources subdir)
|
||||||
|
set(options "")
|
||||||
|
set(single_args NAME REPO_NAME)
|
||||||
|
set(multi_args "")
|
||||||
|
|
||||||
|
cmake_parse_arguments(PARSE_ARGV 1 arg "${options}" "${single_args}" "${multi_args}")
|
||||||
|
|
||||||
|
qt_internal_get_examples_sources_install_path(example_install_path "${subdir}")
|
||||||
|
|
||||||
|
# The trailing slash is important to avoid duplicate nested directory names.
|
||||||
|
set(example_source_dir "${subdir}/")
|
||||||
|
|
||||||
|
# Allow controlling whether sources should be part of the default install target.
|
||||||
|
if(QT_INSTALL_EXAMPLES_SOURCES_BY_DEFAULT)
|
||||||
|
set(exclude_from_all "")
|
||||||
|
else()
|
||||||
|
set(exclude_from_all "EXCLUDE_FROM_ALL")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Create an install component for all example sources. Can also be part of the default
|
||||||
|
# install target if EXCLUDE_FROM_ALL is not passed.
|
||||||
|
install(
|
||||||
|
DIRECTORY "${example_source_dir}"
|
||||||
|
DESTINATION "${example_install_path}"
|
||||||
|
COMPONENT "examples_sources"
|
||||||
|
USE_SOURCE_PERMISSIONS
|
||||||
|
${exclude_from_all}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Also create a specific install component just for this repo's examples.
|
||||||
|
install(
|
||||||
|
DIRECTORY "${example_source_dir}"
|
||||||
|
DESTINATION "${example_install_path}"
|
||||||
|
COMPONENT "examples_sources_${arg_REPO_NAME}"
|
||||||
|
USE_SOURCE_PERMISSIONS
|
||||||
|
EXCLUDE_FROM_ALL
|
||||||
|
)
|
||||||
|
|
||||||
|
# Also create a specific install component just for the current example's sources.
|
||||||
|
install(
|
||||||
|
DIRECTORY "${example_source_dir}"
|
||||||
|
DESTINATION "${example_install_path}"
|
||||||
|
COMPONENT "examples_sources_${arg_NAME}"
|
||||||
|
USE_SOURCE_PERMISSIONS
|
||||||
|
EXCLUDE_FROM_ALL
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
if ("STANDALONE_TEST" IN_LIST Qt6BuildInternals_FIND_COMPONENTS)
|
if ("STANDALONE_TEST" IN_LIST Qt6BuildInternals_FIND_COMPONENTS)
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/QtStandaloneTestTemplateProject/Main.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/QtStandaloneTestTemplateProject/Main.cmake)
|
||||||
if (NOT PROJECT_VERSION_MAJOR)
|
if (NOT PROJECT_VERSION_MAJOR)
|
||||||
@ -1442,12 +1582,6 @@ function(qt_internal_get_filename_path_mode out_var)
|
|||||||
set(mode REALPATH)
|
set(mode REALPATH)
|
||||||
if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS)
|
if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS)
|
||||||
set(mode ABSOLUTE)
|
set(mode ABSOLUTE)
|
||||||
message(WARNING
|
|
||||||
"QT_ALLOW_SYMLINK_IN_PATHS is enabled. "
|
|
||||||
"This is not recommended, and it may lead to unexpected issues. "
|
|
||||||
"E.g., When building QtWebEngine, enabling this option may result in build "
|
|
||||||
"issues in certain platforms. See https://bugreports.qt.io/browse/QTBUG-59769."
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
set(${out_var} ${mode} PARENT_SCOPE)
|
set(${out_var} ${mode} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -103,6 +103,9 @@ set(QT_BUILD_EXAMPLES_AS_EXTERNAL "@QT_BUILD_EXAMPLES_AS_EXTERNAL@" CACHE BOOL
|
|||||||
# Propagate usage of ccache.
|
# Propagate usage of ccache.
|
||||||
set(QT_USE_CCACHE @QT_USE_CCACHE@ CACHE BOOL "Enable the use of ccache")
|
set(QT_USE_CCACHE @QT_USE_CCACHE@ CACHE BOOL "Enable the use of ccache")
|
||||||
|
|
||||||
|
# Propagate usage of vcpkg, ON by default.
|
||||||
|
set(QT_USE_VCPKG @QT_USE_VCPKG@ CACHE BOOL "Enable the use of vcpkg")
|
||||||
|
|
||||||
# Propagate usage of unity build.
|
# Propagate usage of unity build.
|
||||||
set(QT_UNITY_BUILD @QT_UNITY_BUILD@ CACHE BOOL "Enable unity (jumbo) build")
|
set(QT_UNITY_BUILD @QT_UNITY_BUILD@ CACHE BOOL "Enable unity (jumbo) build")
|
||||||
set(QT_UNITY_BUILD_BATCH_SIZE "@QT_UNITY_BUILD_BATCH_SIZE@" CACHE STRING "Unity build batch size")
|
set(QT_UNITY_BUILD_BATCH_SIZE "@QT_UNITY_BUILD_BATCH_SIZE@" CACHE STRING "Unity build batch size")
|
||||||
@ -163,6 +166,7 @@ function(qt_internal_force_set_cmake_build_type_conditionally value)
|
|||||||
AND NOT QT_NO_FORCE_SET_CMAKE_BUILD_TYPE
|
AND NOT QT_NO_FORCE_SET_CMAKE_BUILD_TYPE
|
||||||
AND NOT __qt_internal_extras_is_multi_config)
|
AND NOT __qt_internal_extras_is_multi_config)
|
||||||
set(CMAKE_BUILD_TYPE "${value}" CACHE STRING "Choose the type of build." FORCE)
|
set(CMAKE_BUILD_TYPE "${value}" CACHE STRING "Choose the type of build." FORCE)
|
||||||
|
set(__qt_build_internals_cmake_build_type "${value}" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ function(qt_internal_get_supported_min_cmake_version_for_building_qt out_var)
|
|||||||
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT}")
|
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT}")
|
||||||
|
|
||||||
# We're building qtbase so the values come from .cmake.conf.
|
# We're building qtbase so the values come from .cmake.conf.
|
||||||
|
elseif(APPLE)
|
||||||
|
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_APPLE}")
|
||||||
elseif(BUILD_SHARED_LIBS)
|
elseif(BUILD_SHARED_LIBS)
|
||||||
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_SHARED}")
|
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_SHARED}")
|
||||||
else()
|
else()
|
||||||
@ -30,7 +32,9 @@ function(qt_internal_get_supported_min_cmake_version_for_using_qt out_var)
|
|||||||
"It should have been set by this point.")
|
"It should have been set by this point.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_SHARED_LIBS)
|
if(APPLE)
|
||||||
|
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_APPLE}")
|
||||||
|
elseif(BUILD_SHARED_LIBS)
|
||||||
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_SHARED}")
|
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_SHARED}")
|
||||||
else()
|
else()
|
||||||
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_STATIC}")
|
set(supported_version "${QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT_STATIC}")
|
||||||
|
@ -30,6 +30,7 @@ function(qt_internal_add_executable name)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
_qt_internal_create_executable(${name})
|
_qt_internal_create_executable(${name})
|
||||||
|
qt_internal_mark_as_internal_target(${name})
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
_qt_internal_android_executable_finalizer(${name})
|
_qt_internal_android_executable_finalizer(${name})
|
||||||
endif()
|
endif()
|
||||||
@ -119,6 +120,7 @@ function(qt_internal_add_executable name)
|
|||||||
qt_internal_extend_target("${name}"
|
qt_internal_extend_target("${name}"
|
||||||
${arg_NO_UNITY_BUILD}
|
${arg_NO_UNITY_BUILD}
|
||||||
SOURCES ${arg_SOURCES}
|
SOURCES ${arg_SOURCES}
|
||||||
|
NO_PCH_SOURCES ${arg_NO_PCH_SOURCES}
|
||||||
NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}
|
NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}
|
||||||
INCLUDE_DIRECTORIES ${private_includes}
|
INCLUDE_DIRECTORIES ${private_includes}
|
||||||
DEFINES ${arg_DEFINES}
|
DEFINES ${arg_DEFINES}
|
||||||
@ -369,6 +371,7 @@ function(qt_internal_add_configure_time_executable target)
|
|||||||
set(target_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/configure_time_bins")
|
set(target_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/configure_time_bins")
|
||||||
if(arg_CONFIG)
|
if(arg_CONFIG)
|
||||||
set(CMAKE_TRY_COMPILE_CONFIGURATION "${arg_CONFIG}")
|
set(CMAKE_TRY_COMPILE_CONFIGURATION "${arg_CONFIG}")
|
||||||
|
string(TOUPPER "_${arg_CONFIG}" config_suffix)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG)
|
get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG)
|
||||||
@ -419,7 +422,7 @@ function(qt_internal_add_configure_time_executable target)
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(should_build_at_configure_time TRUE)
|
set(should_build_at_configure_time TRUE)
|
||||||
if(EXISTS "${target_binary_path}")
|
if(EXISTS "${target_binary_path}" AND EXISTS "${timestamp_file}")
|
||||||
set(last_ts 0)
|
set(last_ts 0)
|
||||||
foreach(source IN LISTS sources)
|
foreach(source IN LISTS sources)
|
||||||
file(TIMESTAMP "${source}" ts "%s")
|
file(TIMESTAMP "${source}" ts "%s")
|
||||||
@ -462,6 +465,29 @@ function(qt_internal_add_configure_time_executable target)
|
|||||||
set(cmake_flags_arg CMAKE_FLAGS "${arg_CMAKE_FLAGS}")
|
set(cmake_flags_arg CMAKE_FLAGS "${arg_CMAKE_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
configure_file("${template}" "${target_binary_dir}/CMakeLists.txt" @ONLY)
|
configure_file("${template}" "${target_binary_dir}/CMakeLists.txt" @ONLY)
|
||||||
|
|
||||||
|
qt_internal_get_enabled_languages_for_flag_manipulation(enabled_languages)
|
||||||
|
foreach(lang IN LISTS enabled_languages)
|
||||||
|
set(compiler_flags_var "CMAKE_${lang}_FLAGS")
|
||||||
|
list(APPEND cmake_flags_arg "-D${compiler_flags_var}:STRING=${${compiler_flags_var}}")
|
||||||
|
if(arg_CONFIG)
|
||||||
|
set(compiler_flags_var_config "${compiler_flags_var}${config_suffix}")
|
||||||
|
list(APPEND cmake_flags_arg
|
||||||
|
"-D${compiler_flags_var_config}:STRING=${${compiler_flags_var_config}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
qt_internal_get_target_link_types_for_flag_manipulation(target_link_types)
|
||||||
|
foreach(linker_type IN LISTS target_link_types)
|
||||||
|
set(linker_flags_var "CMAKE_${linker_type}_LINKER_FLAGS")
|
||||||
|
list(APPEND cmake_flags_arg "-D${linker_flags_var}:STRING=${${linker_flags_var}}")
|
||||||
|
if(arg_CONFIG)
|
||||||
|
set(linker_flags_var_config "${linker_flags_var}${config_suffix}")
|
||||||
|
list(APPEND cmake_flags_arg
|
||||||
|
"-D${linker_flags_var_config}:STRING=${${linker_flags_var_config}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
try_compile(result
|
try_compile(result
|
||||||
"${target_binary_dir}"
|
"${target_binary_dir}"
|
||||||
"${target_binary_dir}"
|
"${target_binary_dir}"
|
||||||
|
@ -177,15 +177,20 @@ function(qt_evaluate_config_expression resultVar)
|
|||||||
set(${resultVar} ${result} PARENT_SCOPE)
|
set(${resultVar} ${result} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(_qt_internal_get_feature_condition_keywords out_var)
|
||||||
|
set(keywords "EQUAL" "LESS" "LESS_EQUAL" "GREATER" "GREATER_EQUAL" "STREQUAL" "STRLESS"
|
||||||
|
"STRLESS_EQUAL" "STRGREATER" "STRGREATER_EQUAL" "VERSION_EQUAL" "VERSION_LESS"
|
||||||
|
"VERSION_LESS_EQUAL" "VERSION_GREATER" "VERSION_GREATER_EQUAL" "MATCHES"
|
||||||
|
"EXISTS" "COMMAND" "DEFINED" "NOT" "AND" "OR" "TARGET" "EXISTS" "IN_LIST" "(" ")")
|
||||||
|
set(${out_var} "${keywords}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(_qt_internal_dump_expression_values expression_dump expression)
|
function(_qt_internal_dump_expression_values expression_dump expression)
|
||||||
set(dump "")
|
set(dump "")
|
||||||
set(skipNext FALSE)
|
set(skipNext FALSE)
|
||||||
set(isTargetExpression FALSE)
|
set(isTargetExpression FALSE)
|
||||||
|
|
||||||
set(keywords "EQUAL" "LESS" "LESS_EQUAL" "GREATER" "GREATER_EQUAL" "STREQUAL" "STRLESS"
|
_qt_internal_get_feature_condition_keywords(keywords)
|
||||||
"STRLESS_EQUAL" "STRGREATER" "STRGREATER_EQUAL" "VERSION_EQUAL" "VERSION_LESS"
|
|
||||||
"VERSION_LESS_EQUAL" "VERSION_GREATER" "VERSION_GREATER_EQUAL" "MATCHES"
|
|
||||||
"EXISTS" "COMMAND" "DEFINED" "NOT" "AND" "OR" "TARGET" "EXISTS" "IN_LIST" "(" ")")
|
|
||||||
|
|
||||||
list(LENGTH expression length)
|
list(LENGTH expression length)
|
||||||
math(EXPR length "${length}-1")
|
math(EXPR length "${length}-1")
|
||||||
@ -239,19 +244,44 @@ endfunction()
|
|||||||
# ${computed} is also stored when reconfiguring and the condition does not align with the user
|
# ${computed} is also stored when reconfiguring and the condition does not align with the user
|
||||||
# provided value.
|
# provided value.
|
||||||
#
|
#
|
||||||
function(qt_feature_check_and_save_user_provided_value resultVar feature condition computed label)
|
function(qt_feature_check_and_save_user_provided_value
|
||||||
|
resultVar feature condition condition_expression computed label)
|
||||||
if (DEFINED "FEATURE_${feature}")
|
if (DEFINED "FEATURE_${feature}")
|
||||||
# Revisit new user provided value
|
# Revisit new user provided value
|
||||||
set(user_value "${FEATURE_${feature}}")
|
set(user_value "${FEATURE_${feature}}")
|
||||||
string(TOUPPER "${user_value}" result)
|
string(TOUPPER "${user_value}" user_value_upper)
|
||||||
|
set(result "${user_value_upper}")
|
||||||
|
|
||||||
# If the build is marked as dirty and the user_value doesn't meet the new condition,
|
# If ${feature} depends on another dirty feature, reset the ${feature} value to
|
||||||
# reset it to the computed one.
|
# ${computed}.
|
||||||
get_property(dirty_build GLOBAL PROPERTY _qt_dirty_build)
|
get_property(dirty_build GLOBAL PROPERTY _qt_dirty_build)
|
||||||
if(NOT condition AND result AND dirty_build)
|
if(dirty_build)
|
||||||
set(result "${computed}")
|
_qt_internal_feature_compute_feature_dependencies(deps "${feature}")
|
||||||
message(WARNING "Reset FEATURE_${feature} value to ${result}, because it doesn't \
|
if(deps)
|
||||||
meet its condition after reconfiguration.")
|
get_property(dirty_features GLOBAL PROPERTY _qt_dirty_features)
|
||||||
|
foreach(dirty_feature ${dirty_features})
|
||||||
|
if(dirty_feature IN_LIST deps AND NOT "${result}" STREQUAL "${computed}")
|
||||||
|
set(result "${computed}")
|
||||||
|
message(WARNING
|
||||||
|
"Auto-resetting 'FEATURE_${feature}' from '${user_value_upper}' to "
|
||||||
|
"'${computed}', "
|
||||||
|
"because the dependent feature '${dirty_feature}' was marked dirty.")
|
||||||
|
|
||||||
|
# Append ${feature} as a new dirty feature.
|
||||||
|
set_property(GLOBAL APPEND PROPERTY _qt_dirty_features "${feature}")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# If the build is marked as dirty and the feature doesn't meet its condition,
|
||||||
|
# reset its value to the computed one, which is likely OFF.
|
||||||
|
if(NOT condition AND result)
|
||||||
|
set(result "${computed}")
|
||||||
|
message(WARNING "Resetting 'FEATURE_${feature}' from '${user_value_upper}' to "
|
||||||
|
"'${computed}' because it doesn't meet its condition after reconfiguration. "
|
||||||
|
"Condition expression is: '${condition_expression}'")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(bool_values OFF NO FALSE N ON YES TRUE Y)
|
set(bool_values OFF NO FALSE N ON YES TRUE Y)
|
||||||
@ -299,6 +329,14 @@ condition:\n ${conditionString}\nCondition values dump:\n ${conditionDump}
|
|||||||
set(QT_KNOWN_FEATURES "${QT_KNOWN_FEATURES}" CACHE INTERNAL "" FORCE)
|
set(QT_KNOWN_FEATURES "${QT_KNOWN_FEATURES}" CACHE INTERNAL "" FORCE)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(_qt_internal_parse_feature_definition feature)
|
||||||
|
cmake_parse_arguments(arg
|
||||||
|
"PRIVATE;PUBLIC"
|
||||||
|
"LABEL;PURPOSE;SECTION;"
|
||||||
|
"AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF"
|
||||||
|
${_QT_FEATURE_DEFINITION_${feature}})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
# The build system stores 2 CMake cache variables for each feature, to allow detecting value changes
|
# The build system stores 2 CMake cache variables for each feature, to allow detecting value changes
|
||||||
# during subsequent reconfigurations.
|
# during subsequent reconfigurations.
|
||||||
@ -334,9 +372,7 @@ function(qt_evaluate_feature feature)
|
|||||||
message(FATAL_ERROR "Attempting to evaluate feature ${feature} but its definition is missing. Either the feature does not exist or a dependency to the module that defines it is missing")
|
message(FATAL_ERROR "Attempting to evaluate feature ${feature} but its definition is missing. Either the feature does not exist or a dependency to the module that defines it is missing")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_parse_arguments(arg
|
_qt_internal_parse_feature_definition("${feature}")
|
||||||
"PRIVATE;PUBLIC"
|
|
||||||
"LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${_QT_FEATURE_DEFINITION_${feature}})
|
|
||||||
|
|
||||||
if("${arg_ENABLE}" STREQUAL "")
|
if("${arg_ENABLE}" STREQUAL "")
|
||||||
set(arg_ENABLE OFF)
|
set(arg_ENABLE OFF)
|
||||||
@ -374,16 +410,7 @@ function(qt_evaluate_feature feature)
|
|||||||
qt_evaluate_config_expression(emit_if ${arg_EMIT_IF})
|
qt_evaluate_config_expression(emit_if ${arg_EMIT_IF})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If FEATURE_ is not defined trying to use INPUT_ variable to enable/disable feature.
|
qt_internal_compute_feature_value_from_possible_input("${feature}")
|
||||||
if ((NOT DEFINED "FEATURE_${feature}") AND (DEFINED "INPUT_${feature}")
|
|
||||||
AND (NOT "${INPUT_${feature}}" STREQUAL "undefined")
|
|
||||||
AND (NOT "${INPUT_${feature}}" STREQUAL ""))
|
|
||||||
if(INPUT_${feature})
|
|
||||||
set(FEATURE_${feature} ON)
|
|
||||||
else()
|
|
||||||
set(FEATURE_${feature} OFF)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Warn about a feature which is not emitted, but the user explicitly provided a value for it.
|
# Warn about a feature which is not emitted, but the user explicitly provided a value for it.
|
||||||
if(NOT emit_if AND DEFINED FEATURE_${feature})
|
if(NOT emit_if AND DEFINED FEATURE_${feature})
|
||||||
@ -401,7 +428,8 @@ function(qt_evaluate_feature feature)
|
|||||||
# Only save the user provided value if the feature was emitted.
|
# Only save the user provided value if the feature was emitted.
|
||||||
if(emit_if)
|
if(emit_if)
|
||||||
qt_feature_check_and_save_user_provided_value(
|
qt_feature_check_and_save_user_provided_value(
|
||||||
saved_user_value "${feature}" "${condition}" "${computed}" "${arg_LABEL}")
|
saved_user_value
|
||||||
|
"${feature}" "${condition}" "${arg_CONDITION}" "${computed}" "${arg_LABEL}")
|
||||||
else()
|
else()
|
||||||
# Make sure the feature internal value is OFF if not emitted.
|
# Make sure the feature internal value is OFF if not emitted.
|
||||||
set(saved_user_value OFF)
|
set(saved_user_value OFF)
|
||||||
@ -414,6 +442,60 @@ function(qt_evaluate_feature feature)
|
|||||||
set(QT_FEATURE_LABEL_${feature} "${arg_LABEL}" CACHE INTERNAL "")
|
set(QT_FEATURE_LABEL_${feature} "${arg_LABEL}" CACHE INTERNAL "")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Collect feature names that ${feature} depends on, by inspecting the given expression.
|
||||||
|
function(_qt_internal_feature_extract_feature_dependencies_from_expression out_var expression)
|
||||||
|
list(LENGTH expression length)
|
||||||
|
math(EXPR length "${length}-1")
|
||||||
|
|
||||||
|
if(length LESS 0)
|
||||||
|
set(${out_var} "" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(deps "")
|
||||||
|
|
||||||
|
foreach(memberIdx RANGE ${length})
|
||||||
|
list(GET expression ${memberIdx} member)
|
||||||
|
if(member MATCHES "^QT_FEATURE_(.+)")
|
||||||
|
list(APPEND deps "${CMAKE_MATCH_1}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(${out_var} "${deps}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Collect feature names that ${feature} depends on, based on feature names that appear
|
||||||
|
# in the ${feature}'s condition expressions.
|
||||||
|
function(_qt_internal_feature_compute_feature_dependencies out_var feature)
|
||||||
|
# Only compute the deps once per feature.
|
||||||
|
get_property(deps_computed GLOBAL PROPERTY _qt_feature_deps_computed_${feature})
|
||||||
|
if(deps_computed)
|
||||||
|
get_property(deps GLOBAL PROPERTY _qt_feature_deps_${feature})
|
||||||
|
set(${out_var} "${deps}" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
_qt_internal_parse_feature_definition("${feature}")
|
||||||
|
|
||||||
|
set(options_to_check AUTODETECT CONDITION ENABLE DISABLE EMIT_IF)
|
||||||
|
set(deps "")
|
||||||
|
|
||||||
|
# Go through each option that takes condition expressions and collect the feature names.
|
||||||
|
foreach(option ${options_to_check})
|
||||||
|
set(option_value "${arg_${option}}")
|
||||||
|
if(option_value)
|
||||||
|
_qt_internal_feature_extract_feature_dependencies_from_expression(
|
||||||
|
option_deps "${option_value}")
|
||||||
|
if(option_deps)
|
||||||
|
list(APPEND deps ${option_deps})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set_property(GLOBAL PROPERTY _qt_feature_deps_computed_${feature} TRUE)
|
||||||
|
set_property(GLOBAL PROPERTY _qt_feature_deps_${feature} "${deps}")
|
||||||
|
set(${out_var} "${deps}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(qt_feature_config feature config_var_name)
|
function(qt_feature_config feature config_var_name)
|
||||||
qt_feature_normalize_name("${feature}" feature)
|
qt_feature_normalize_name("${feature}" feature)
|
||||||
cmake_parse_arguments(PARSE_ARGV 2 arg
|
cmake_parse_arguments(PARSE_ARGV 2 arg
|
||||||
@ -786,6 +868,49 @@ function(qt_feature_copy_global_config_features_to_core target)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(qt_internal_detect_dirty_features)
|
||||||
|
# We need to clean up QT_FEATURE_*, but only once per configuration cycle
|
||||||
|
get_property(qt_feature_clean GLOBAL PROPERTY _qt_feature_clean)
|
||||||
|
if(NOT qt_feature_clean AND NOT QT_NO_FEATURE_AUTO_RESET)
|
||||||
|
message(STATUS "Checking for feature set changes")
|
||||||
|
set_property(GLOBAL PROPERTY _qt_feature_clean TRUE)
|
||||||
|
foreach(feature ${QT_KNOWN_FEATURES})
|
||||||
|
qt_internal_compute_feature_value_from_possible_input("${feature}")
|
||||||
|
|
||||||
|
if(DEFINED "FEATURE_${feature}" AND
|
||||||
|
NOT "${QT_FEATURE_${feature}}" STREQUAL "${FEATURE_${feature}}")
|
||||||
|
message(" '${feature}' was changed from ${QT_FEATURE_${feature}} "
|
||||||
|
"to ${FEATURE_${feature}}")
|
||||||
|
set(dirty_build TRUE)
|
||||||
|
set_property(GLOBAL APPEND PROPERTY _qt_dirty_features "${feature}")
|
||||||
|
endif()
|
||||||
|
unset("QT_FEATURE_${feature}" CACHE)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(QT_KNOWN_FEATURES "" CACHE INTERNAL "" FORCE)
|
||||||
|
|
||||||
|
if(dirty_build)
|
||||||
|
set_property(GLOBAL PROPERTY _qt_dirty_build TRUE)
|
||||||
|
message(WARNING
|
||||||
|
"Due to detected feature set changes, dependent features "
|
||||||
|
"will be re-computed automatically. This might cause a lot of files to be rebuilt. "
|
||||||
|
"To disable this behavior, configure with -DQT_NO_FEATURE_AUTO_RESET=ON")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(qt_internal_clean_feature_inputs)
|
||||||
|
foreach(feature IN LISTS QT_KNOWN_FEATURES)
|
||||||
|
# Unset the INPUT_foo cache variables after they were used in feature evaluation, to
|
||||||
|
# ensure stale values don't influence features upon reconfiguration when
|
||||||
|
# QT_INTERNAL_CALLED_FROM_CONFIGURE is TRUE and the INPUT_foo variable is not passed.
|
||||||
|
# e.g. first configure -no-gui, then manually toggle FEATURE_gui to ON in
|
||||||
|
# CMakeCache.txt, then reconfigure (with the configure script) without -no-gui.
|
||||||
|
# Without this unset(), we'd have switched FEATURE_gui to OFF again.
|
||||||
|
unset(INPUT_${feature} CACHE)
|
||||||
|
endforeach()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(qt_config_compile_test name)
|
function(qt_config_compile_test name)
|
||||||
if(DEFINED "TEST_${name}")
|
if(DEFINED "TEST_${name}")
|
||||||
return()
|
return()
|
||||||
|
@ -80,6 +80,11 @@ function(qt_internal_add_link_flags_no_undefined target)
|
|||||||
if (NOT QT_BUILD_SHARED_LIBS OR WASM)
|
if (NOT QT_BUILD_SHARED_LIBS OR WASM)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||||
|
# ld64 defaults to -undefined,error, and in Xcode 15
|
||||||
|
# passing this option is deprecated, causing a warning.
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
if ((GCC OR CLANG) AND NOT MSVC)
|
if ((GCC OR CLANG) AND NOT MSVC)
|
||||||
if(CLANG AND QT_FEATURE_sanitizer)
|
if(CLANG AND QT_FEATURE_sanitizer)
|
||||||
return()
|
return()
|
||||||
@ -117,11 +122,20 @@ endfunction()
|
|||||||
|
|
||||||
function(qt_internal_apply_gc_binaries target visibility)
|
function(qt_internal_apply_gc_binaries target visibility)
|
||||||
set(possible_visibilities PRIVATE INTERFACE PUBLIC)
|
set(possible_visibilities PRIVATE INTERFACE PUBLIC)
|
||||||
list(FIND possible_visibilities "${visibility}" known_visibility)
|
if(NOT visibility IN_LIST possible_visibilities)
|
||||||
if (known_visibility EQUAL "-1")
|
|
||||||
message(FATAL_ERROR "Visibitily setting must be one of PRIVATE, INTERFACE or PUBLIC.")
|
message(FATAL_ERROR "Visibitily setting must be one of PRIVATE, INTERFACE or PUBLIC.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
string(JOIN "" clang_or_gcc_begin
|
||||||
|
"$<$<OR:"
|
||||||
|
"$<CXX_COMPILER_ID:GNU>,"
|
||||||
|
"$<CXX_COMPILER_ID:Clang>,"
|
||||||
|
"$<CXX_COMPILER_ID:AppleClang>,"
|
||||||
|
"$<CXX_COMPILER_ID:IntelLLVM>"
|
||||||
|
">:"
|
||||||
|
)
|
||||||
|
set(clang_or_gcc_end ">")
|
||||||
|
|
||||||
if ((GCC OR CLANG) AND NOT WASM AND NOT UIKIT AND NOT MSVC)
|
if ((GCC OR CLANG) AND NOT WASM AND NOT UIKIT AND NOT MSVC)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(gc_sections_flag "-Wl,-dead_strip")
|
set(gc_sections_flag "-Wl,-dead_strip")
|
||||||
@ -130,16 +144,26 @@ function(qt_internal_apply_gc_binaries target visibility)
|
|||||||
elseif(LINUX OR BSD OR WIN32 OR ANDROID)
|
elseif(LINUX OR BSD OR WIN32 OR ANDROID)
|
||||||
set(gc_sections_flag "-Wl,--gc-sections")
|
set(gc_sections_flag "-Wl,--gc-sections")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Save the flag value with and without genex wrapping, so we can remove the wrapping
|
||||||
|
# when generating .pc pkgconfig files.
|
||||||
|
set_property(GLOBAL PROPERTY _qt_internal_gc_sections_without_genex "${gc_sections_flag}")
|
||||||
|
|
||||||
|
set(gc_sections_flag
|
||||||
|
"${clang_or_gcc_begin}${gc_sections_flag}${clang_or_gcc_end}")
|
||||||
|
|
||||||
|
set_property(GLOBAL PROPERTY _qt_internal_gc_sections_with_genex "${gc_sections_flag}")
|
||||||
endif()
|
endif()
|
||||||
if(gc_sections_flag)
|
if(gc_sections_flag)
|
||||||
target_link_options("${target}" ${visibility} "${gc_sections_flag}")
|
target_link_options("${target}" ${visibility} "${gc_sections_flag}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if((GCC OR CLANG) AND NOT WASM AND NOT UIKIT AND NOT MSVC)
|
if((GCC OR CLANG) AND NOT WASM AND NOT UIKIT AND NOT MSVC)
|
||||||
set(split_sections_flags "-ffunction-sections" "-fdata-sections")
|
set(split_sections_flags
|
||||||
|
"${clang_or_gcc_begin}-ffunction-sections;-fdata-sections${clang_or_gcc_end}")
|
||||||
endif()
|
endif()
|
||||||
if(split_sections_flags)
|
if(split_sections_flags)
|
||||||
target_compile_options("${target}" ${visibility} ${split_sections_flags})
|
target_compile_options("${target}" ${visibility} "${split_sections_flags}")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@ -149,13 +173,17 @@ function(qt_internal_apply_intel_cet target visibility)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(possible_visibilities PRIVATE INTERFACE PUBLIC)
|
set(possible_visibilities PRIVATE INTERFACE PUBLIC)
|
||||||
list(FIND possible_visibilities "${visibility}" known_visibility)
|
if(NOT visibility IN_LIST possible_visibilities)
|
||||||
if (known_visibility EQUAL "-1")
|
|
||||||
message(FATAL_ERROR "Visibitily setting must be one of PRIVATE, INTERFACE or PUBLIC.")
|
message(FATAL_ERROR "Visibitily setting must be one of PRIVATE, INTERFACE or PUBLIC.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GCC)
|
if(GCC)
|
||||||
set(flags "-mshstk")
|
string(JOIN "" flags
|
||||||
|
"$<$<OR:"
|
||||||
|
"$<CXX_COMPILER_ID:GNU>,"
|
||||||
|
"$<CXX_COMPILER_ID:Clang>,"
|
||||||
|
"$<CXX_COMPILER_ID:AppleClang>"
|
||||||
|
">:-mshstk>")
|
||||||
endif()
|
endif()
|
||||||
if(flags)
|
if(flags)
|
||||||
target_compile_options("${target}" ${visibility} "${flags}")
|
target_compile_options("${target}" ${visibility} "${flags}")
|
||||||
@ -993,6 +1021,26 @@ function(qt_internal_set_up_config_optimizations_like_in_qmake)
|
|||||||
IN_CACHE)
|
IN_CACHE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Legacy Android toolchain file adds the `-g` flag to CMAKE_<LANG>_FLAGS, as a
|
||||||
|
# result, our release build ends up containing debug symbols. To avoid that, we
|
||||||
|
# remove the flag from CMAKE_<LANGL>_FLAGS and add
|
||||||
|
# it to CMAKE_<LANG>_FLAGS_DEBUG.
|
||||||
|
#
|
||||||
|
# Note:
|
||||||
|
# The new `android.toolchain.cmake` file does not have this problem, but
|
||||||
|
# it has other issues, eg., https://github.com/android/ndk/issues/1693, so we
|
||||||
|
# cannot force it. While we do load the new toolchain, it automatically falls
|
||||||
|
# back to the legacy toolchain, ie., `android-legacy.toolchain.cmake` which
|
||||||
|
# has the problem described above.
|
||||||
|
#
|
||||||
|
# Todo:
|
||||||
|
# When the new toolchain is fixed, and it doesn't fall back to the legacy
|
||||||
|
# anymore by default, then we should be able to remove this workaround.
|
||||||
|
if(ANDROID AND ANDROID_COMPILER_FLAGS MATCHES "(^| )-g")
|
||||||
|
qt_internal_remove_compiler_flags("-g")
|
||||||
|
qt_internal_add_compiler_flags(FLAGS "-g" CONFIGS DEBUG RELWITHDEBINFO)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Update all relevant flags in the calling scope
|
# Update all relevant flags in the calling scope
|
||||||
foreach(lang ${enabled_languages})
|
foreach(lang ${enabled_languages})
|
||||||
set(flag_var_name "CMAKE_${lang}_FLAGS")
|
set(flag_var_name "CMAKE_${lang}_FLAGS")
|
||||||
|
@ -182,7 +182,7 @@ function(qt_internal_add_headersclean_target module_target module_headers)
|
|||||||
)
|
)
|
||||||
set(input_header_path_type ABSOLUTE)
|
set(input_header_path_type ABSOLUTE)
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
set(hcleanFLAGS -std:c++latest -Zc:__cplusplus -Za -WX -W3 -EHsc)
|
set(hcleanFLAGS -std:c++latest -Zc:__cplusplus -WX -W3 -EHsc)
|
||||||
|
|
||||||
# Because we now add `-DNOMINMAX` to `PlatformCommonInternal`.
|
# Because we now add `-DNOMINMAX` to `PlatformCommonInternal`.
|
||||||
set(hcleanUDEFS -UNOMINMAX)
|
set(hcleanUDEFS -UNOMINMAX)
|
||||||
|
@ -102,7 +102,7 @@ function(qt_internal_add_global_definition definition)
|
|||||||
set(optional_args)
|
set(optional_args)
|
||||||
set(single_value_args VALUE)
|
set(single_value_args VALUE)
|
||||||
set(multi_value_args SCOPE)
|
set(multi_value_args SCOPE)
|
||||||
cmake_parse_arguments(args
|
cmake_parse_arguments(arg
|
||||||
"${optional_args}"
|
"${optional_args}"
|
||||||
"${single_value_args}"
|
"${single_value_args}"
|
||||||
"${multi_value_args}"
|
"${multi_value_args}"
|
||||||
@ -209,6 +209,14 @@ function(qt_internal_apply_bitcode_flags target)
|
|||||||
target_compile_options("${target}" INTERFACE ${bitcode_flags})
|
target_compile_options("${target}" INTERFACE ${bitcode_flags})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Function guards linker options that are applicable for internal Qt targets only from propagating
|
||||||
|
# them to user projects.
|
||||||
|
function(qt_internal_platform_link_options target scope)
|
||||||
|
set(options ${ARGN})
|
||||||
|
set(is_internal_target_genex "$<BOOL:$<TARGET_PROPERTY:_qt_is_internal_target>>")
|
||||||
|
target_link_options(${target} ${scope} "$<${is_internal_target_genex}:${options}>")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# Apple deprecated the entire OpenGL API in favor of Metal, which
|
# Apple deprecated the entire OpenGL API in favor of Metal, which
|
||||||
# we are aware of, so silence the deprecation warnings in code.
|
# we are aware of, so silence the deprecation warnings in code.
|
||||||
# This does not apply to user-code, which will need to silence
|
# This does not apply to user-code, which will need to silence
|
||||||
@ -287,7 +295,7 @@ if (MSVC)
|
|||||||
$<$<NOT:$<CONFIG:Debug>>:-guard:cf -Gw>
|
$<$<NOT:$<CONFIG:Debug>>:-guard:cf -Gw>
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_options(PlatformCommonInternal INTERFACE
|
qt_internal_platform_link_options(PlatformCommonInternal INTERFACE
|
||||||
-DYNAMICBASE -NXCOMPAT -LARGEADDRESSAWARE
|
-DYNAMICBASE -NXCOMPAT -LARGEADDRESSAWARE
|
||||||
$<$<NOT:$<CONFIG:Debug>>:-OPT:REF -OPT:ICF -GUARD:CF>
|
$<$<NOT:$<CONFIG:Debug>>:-OPT:REF -OPT:ICF -GUARD:CF>
|
||||||
)
|
)
|
||||||
@ -303,7 +311,7 @@ endif()
|
|||||||
|
|
||||||
if(QT_FEATURE_intelcet)
|
if(QT_FEATURE_intelcet)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_options(PlatformCommonInternal INTERFACE
|
qt_internal_platform_link_options(PlatformCommonInternal INTERFACE
|
||||||
-CETCOMPAT
|
-CETCOMPAT
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
@ -332,22 +340,23 @@ endif()
|
|||||||
if(DEFINED QT_EXTRA_FRAMEWORKPATHS AND APPLE)
|
if(DEFINED QT_EXTRA_FRAMEWORKPATHS AND APPLE)
|
||||||
list(TRANSFORM QT_EXTRA_FRAMEWORKPATHS PREPEND "-F" OUTPUT_VARIABLE __qt_fw_flags)
|
list(TRANSFORM QT_EXTRA_FRAMEWORKPATHS PREPEND "-F" OUTPUT_VARIABLE __qt_fw_flags)
|
||||||
target_compile_options(PlatformCommonInternal INTERFACE ${__qt_fw_flags})
|
target_compile_options(PlatformCommonInternal INTERFACE ${__qt_fw_flags})
|
||||||
target_link_options(PlatformCommonInternal INTERFACE ${__qt_fw_flags})
|
qt_internal_platform_link_options(PlatformCommonInternal INTERFACE ${__qt_fw_flags})
|
||||||
unset(__qt_fw_flags)
|
unset(__qt_fw_flags)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_internal_get_active_linker_flags(__qt_internal_active_linker_flags)
|
qt_internal_get_active_linker_flags(__qt_internal_active_linker_flags)
|
||||||
if(__qt_internal_active_linker_flags)
|
if(__qt_internal_active_linker_flags)
|
||||||
target_link_options(PlatformCommonInternal INTERFACE "${__qt_internal_active_linker_flags}")
|
qt_internal_platform_link_options(PlatformCommonInternal INTERFACE
|
||||||
|
"${__qt_internal_active_linker_flags}")
|
||||||
endif()
|
endif()
|
||||||
unset(__qt_internal_active_linker_flags)
|
unset(__qt_internal_active_linker_flags)
|
||||||
|
|
||||||
if(QT_FEATURE_enable_gdb_index)
|
if(QT_FEATURE_enable_gdb_index)
|
||||||
target_link_options(PlatformCommonInternal INTERFACE "-Wl,--gdb-index")
|
qt_internal_platform_link_options(PlatformCommonInternal INTERFACE "-Wl,--gdb-index")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(QT_FEATURE_enable_new_dtags)
|
if(QT_FEATURE_enable_new_dtags)
|
||||||
target_link_options(PlatformCommonInternal INTERFACE "-Wl,--enable-new-dtags")
|
qt_internal_platform_link_options(PlatformCommonInternal INTERFACE "-Wl,--enable-new-dtags")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(qt_get_implicit_sse2_genex_condition out_var)
|
function(qt_get_implicit_sse2_genex_condition out_var)
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
# This function can be used to compile java sources into a jar package.
|
# This function can be used to compile java sources into a jar package.
|
||||||
|
|
||||||
function(qt_internal_add_jar target)
|
function(qt_internal_add_jar target)
|
||||||
|
set(options)
|
||||||
|
set(oneValueArgs OUTPUT_DIR)
|
||||||
|
set(multiValueArgs INCLUDE_JARS SOURCES)
|
||||||
|
cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
set(javac_target_version "${QT_ANDROID_JAVAC_TARGET}")
|
set(javac_target_version "${QT_ANDROID_JAVAC_TARGET}")
|
||||||
if (NOT javac_target_version)
|
if (NOT javac_target_version)
|
||||||
@ -18,4 +22,8 @@ function(qt_internal_add_jar target)
|
|||||||
set(CMAKE_JAVA_COMPILE_FLAGS -source "${javac_source_version}" -target "${javac_target_version}" -Xlint:unchecked -bootclasspath "${QT_ANDROID_JAR}")
|
set(CMAKE_JAVA_COMPILE_FLAGS -source "${javac_source_version}" -target "${javac_target_version}" -Xlint:unchecked -bootclasspath "${QT_ANDROID_JAR}")
|
||||||
add_jar(${ARGV})
|
add_jar(${ARGV})
|
||||||
|
|
||||||
|
foreach(f IN LISTS arg_SOURCES)
|
||||||
|
_qt_internal_expose_source_file_to_ide(${target} "${f}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -38,7 +38,6 @@ macro(qt_internal_get_internal_add_module_keywords option_args single_args multi
|
|||||||
QMAKE_MODULE_CONFIG
|
QMAKE_MODULE_CONFIG
|
||||||
EXTRA_CMAKE_FILES
|
EXTRA_CMAKE_FILES
|
||||||
EXTRA_CMAKE_INCLUDES
|
EXTRA_CMAKE_INCLUDES
|
||||||
NO_PCH_SOURCES
|
|
||||||
EXTERNAL_HEADERS
|
EXTERNAL_HEADERS
|
||||||
POLICIES
|
POLICIES
|
||||||
${__default_private_args}
|
${__default_private_args}
|
||||||
@ -469,6 +468,8 @@ function(qt_internal_add_module target)
|
|||||||
# If EXTERNAL_HEADERS_DIR is set we install the specified directory and keep the structure
|
# If EXTERNAL_HEADERS_DIR is set we install the specified directory and keep the structure
|
||||||
# without taking into the account the CMake source tree and syncqt outputs.
|
# without taking into the account the CMake source tree and syncqt outputs.
|
||||||
if(arg_EXTERNAL_HEADERS_DIR)
|
if(arg_EXTERNAL_HEADERS_DIR)
|
||||||
|
set_property(TARGET ${target}
|
||||||
|
PROPERTY _qt_external_headers_dir "${arg_EXTERNAL_HEADERS_DIR}")
|
||||||
qt_install(DIRECTORY "${arg_EXTERNAL_HEADERS_DIR}/"
|
qt_install(DIRECTORY "${arg_EXTERNAL_HEADERS_DIR}/"
|
||||||
DESTINATION "${module_install_interface_include_dir}"
|
DESTINATION "${module_install_interface_include_dir}"
|
||||||
)
|
)
|
||||||
@ -487,6 +488,8 @@ function(qt_internal_add_module target)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
qt_internal_library_deprecation_level(deprecation_define)
|
||||||
|
|
||||||
if(NOT arg_HEADER_MODULE)
|
if(NOT arg_HEADER_MODULE)
|
||||||
qt_autogen_tools_initial_setup(${target})
|
qt_autogen_tools_initial_setup(${target})
|
||||||
endif()
|
endif()
|
||||||
@ -576,6 +579,7 @@ function(qt_internal_add_module target)
|
|||||||
QT_DEPRECATED_WARNINGS
|
QT_DEPRECATED_WARNINGS
|
||||||
QT_BUILDING_QT
|
QT_BUILDING_QT
|
||||||
QT_BUILD_${module_define_infix}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore
|
QT_BUILD_${module_define_infix}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore
|
||||||
|
${deprecation_define}
|
||||||
)
|
)
|
||||||
list(APPEND arg_LIBRARIES Qt::PlatformModuleInternal)
|
list(APPEND arg_LIBRARIES Qt::PlatformModuleInternal)
|
||||||
endif()
|
endif()
|
||||||
@ -1235,10 +1239,13 @@ function(qt_internal_collect_module_headers out_var target)
|
|||||||
get_target_property(target_type ${target} TYPE)
|
get_target_property(target_type ${target} TYPE)
|
||||||
if(target_type STREQUAL "INTERFACE_LIBRARY")
|
if(target_type STREQUAL "INTERFACE_LIBRARY")
|
||||||
set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}")
|
set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set(binary_dir "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
else()
|
else()
|
||||||
get_target_property(source_dir ${target} SOURCE_DIR)
|
get_target_property(source_dir ${target} SOURCE_DIR)
|
||||||
|
get_target_property(binary_dir ${target} BINARY_DIR)
|
||||||
endif()
|
endif()
|
||||||
get_filename_component(source_dir "${source_dir}" ABSOLUTE)
|
get_filename_component(source_dir "${source_dir}" ABSOLUTE)
|
||||||
|
get_filename_component(binary_dir "${binary_dir}" ABSOLUTE)
|
||||||
|
|
||||||
get_target_property(is_3rdparty_library ${target} _qt_module_is_3rdparty_header_library)
|
get_target_property(is_3rdparty_library ${target} _qt_module_is_3rdparty_header_library)
|
||||||
|
|
||||||
@ -1282,7 +1289,14 @@ function(qt_internal_collect_module_headers out_var target)
|
|||||||
"\nCondition:\n ${condition_string}")
|
"\nCondition:\n ${condition_string}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(file_path MATCHES "3rdparty/.+" AND NOT is_3rdparty_library)
|
if(is_outside_module_source_dir)
|
||||||
|
set(base_dir "${binary_dir}")
|
||||||
|
else()
|
||||||
|
set(base_dir "${source_dir}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(RELATIVE_PATH file_path_rel "${base_dir}" "${file_path}")
|
||||||
|
if(file_path_rel MATCHES "3rdparty/.+" AND NOT is_3rdparty_library)
|
||||||
set(is_3rdparty_header TRUE)
|
set(is_3rdparty_header TRUE)
|
||||||
else()
|
else()
|
||||||
set(is_3rdparty_header FALSE)
|
set(is_3rdparty_header FALSE)
|
||||||
|
@ -51,6 +51,17 @@ function(qt_internal_generate_pkg_config_file module)
|
|||||||
list(TRANSFORM loose_include_dirs REPLACE "${INSTALL_INCLUDEDIR}" "\${includedir}")
|
list(TRANSFORM loose_include_dirs REPLACE "${INSTALL_INCLUDEDIR}" "\${includedir}")
|
||||||
list(TRANSFORM loose_include_dirs REPLACE "${INSTALL_MKSPECSDIR}" "\${mkspecsdir}")
|
list(TRANSFORM loose_include_dirs REPLACE "${INSTALL_MKSPECSDIR}" "\${mkspecsdir}")
|
||||||
|
|
||||||
|
# Remove genex wrapping around gc_sections flag because we can't evaluate genexes like
|
||||||
|
# $<CXX_COMPILER_ID> in file(GENERATE). And given that .pc files don't support dynamic
|
||||||
|
# evaluation like the $<CXX_COMPILER_ID> genex, distros will be expected to patch the .pc
|
||||||
|
# files according to which compiler they intend to be used with.
|
||||||
|
get_property(gc_sections_with_genex GLOBAL PROPERTY _qt_internal_gc_sections_with_genex)
|
||||||
|
get_property(gc_sections_without_genex GLOBAL PROPERTY _qt_internal_gc_sections_without_genex)
|
||||||
|
if(loose_link_options AND gc_sections_with_genex AND gc_sections_without_genex)
|
||||||
|
string(REPLACE "${gc_sections_with_genex}" "${gc_sections_without_genex}"
|
||||||
|
loose_link_options "${loose_link_options}")
|
||||||
|
endif()
|
||||||
|
|
||||||
qt_internal_set_pkg_config_cpp_flags(link_options "${loose_link_options}" "")
|
qt_internal_set_pkg_config_cpp_flags(link_options "${loose_link_options}" "")
|
||||||
qt_internal_set_pkg_config_cpp_flags(compile_defs "${loose_compile_defs}" -D)
|
qt_internal_set_pkg_config_cpp_flags(compile_defs "${loose_compile_defs}" -D)
|
||||||
qt_internal_set_pkg_config_cpp_flags(include_dirs "${loose_include_dirs}" -I)
|
qt_internal_set_pkg_config_cpp_flags(include_dirs "${loose_include_dirs}" -I)
|
||||||
|
@ -63,10 +63,6 @@ function(qt_internal_setup_public_platform_target)
|
|||||||
|
|
||||||
# Generate a pkgconfig for Qt::Platform.
|
# Generate a pkgconfig for Qt::Platform.
|
||||||
qt_internal_generate_pkg_config_file(Platform)
|
qt_internal_generate_pkg_config_file(Platform)
|
||||||
|
|
||||||
# Make sure Qt users use the same symbols as how we build Qt.
|
|
||||||
qt_internal_library_deprecation_level(deprecation_defines)
|
|
||||||
target_compile_definitions(Platform INTERFACE ${deprecation_defines})
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_internal_get_platform_definition_include_dir install_interface build_interface)
|
function(qt_internal_get_platform_definition_include_dir install_interface build_interface)
|
||||||
|
@ -336,6 +336,8 @@ function(qt_internal_add_plugin target)
|
|||||||
qt_internal_extend_target("${target}"
|
qt_internal_extend_target("${target}"
|
||||||
${arg_NO_UNITY_BUILD}
|
${arg_NO_UNITY_BUILD}
|
||||||
SOURCES ${arg_SOURCES}
|
SOURCES ${arg_SOURCES}
|
||||||
|
NO_PCH_SOURCES
|
||||||
|
${arg_NO_PCH_SOURCES}
|
||||||
NO_UNITY_BUILD_SOURCES
|
NO_UNITY_BUILD_SOURCES
|
||||||
${arg_NO_UNITY_BUILD_SOURCES}
|
${arg_NO_UNITY_BUILD_SOURCES}
|
||||||
INCLUDE_DIRECTORIES
|
INCLUDE_DIRECTORIES
|
||||||
|
@ -26,9 +26,14 @@ function(qt_generate_qmake_libraries_pri_content module_name output_root_dir out
|
|||||||
set(lib_incdir "")
|
set(lib_incdir "")
|
||||||
set(lib_libdir "")
|
set(lib_libdir "")
|
||||||
set(lib_libs "")
|
set(lib_libs "")
|
||||||
|
set(seen_targets "")
|
||||||
while(lib_targets)
|
while(lib_targets)
|
||||||
list(POP_BACK lib_targets lib_target)
|
list(POP_BACK lib_targets lib_target)
|
||||||
if(TARGET ${lib_target})
|
if(TARGET ${lib_target})
|
||||||
|
if(${lib_target} IN_LIST seen_targets)
|
||||||
|
continue()
|
||||||
|
endif()
|
||||||
|
list(APPEND seen_targets ${lib_target})
|
||||||
get_target_property(lib_target_type ${lib_target} TYPE)
|
get_target_property(lib_target_type ${lib_target} TYPE)
|
||||||
if(lib_target_type STREQUAL "INTERFACE_LIBRARY")
|
if(lib_target_type STREQUAL "INTERFACE_LIBRARY")
|
||||||
get_target_property(iface_libs ${lib_target} INTERFACE_LINK_LIBRARIES)
|
get_target_property(iface_libs ${lib_target} INTERFACE_LINK_LIBRARIES)
|
||||||
|
@ -55,7 +55,10 @@ if("${MODULE_ROOT}" STREQUAL "")
|
|||||||
set(qtbase_or_top_level_build TRUE)
|
set(qtbase_or_top_level_build TRUE)
|
||||||
else()
|
else()
|
||||||
# If MODULE_ROOT is passed without drive letter, we try to add it to the path.
|
# If MODULE_ROOT is passed without drive letter, we try to add it to the path.
|
||||||
get_filename_component(MODULE_ROOT "." REALPATH BASE_DIR "${MODULE_ROOT}")
|
# The check is necessary; otherwise, `get_filename_component` returns an empty string.
|
||||||
|
if(NOT MODULE_ROOT STREQUAL ".")
|
||||||
|
get_filename_component(MODULE_ROOT "." REALPATH BASE_DIR "${MODULE_ROOT}")
|
||||||
|
endif()
|
||||||
set(qtbase_or_top_level_build FALSE)
|
set(qtbase_or_top_level_build FALSE)
|
||||||
endif()
|
endif()
|
||||||
set(configure_filename "configure.cmake")
|
set(configure_filename "configure.cmake")
|
||||||
@ -136,13 +139,6 @@ while(NOT "${configure_args}" STREQUAL "")
|
|||||||
list(POP_FRONT configure_args version)
|
list(POP_FRONT configure_args version)
|
||||||
is_valid_qt_hex_version("${arg}" "${version}")
|
is_valid_qt_hex_version("${arg}" "${version}")
|
||||||
push("-DQT_DISABLE_DEPRECATED_UP_TO=${version}")
|
push("-DQT_DISABLE_DEPRECATED_UP_TO=${version}")
|
||||||
elseif(arg STREQUAL "-unity-build")
|
|
||||||
push("-DQT_UNITY_BUILD=ON")
|
|
||||||
# QT_UNITY_BUILD_BATCH_SIZE will be set to 8, CMake's default.
|
|
||||||
elseif(arg STREQUAL "-unity-build-batch-size")
|
|
||||||
list(POP_FRONT configure_args unity_build_batch_size)
|
|
||||||
is_non_empty_valid_arg("${arg}" "${unity_build_batch_size}")
|
|
||||||
push("-DQT_UNITY_BUILD_BATCH_SIZE=${unity_build_batch_size}")
|
|
||||||
elseif(arg STREQUAL "--")
|
elseif(arg STREQUAL "--")
|
||||||
# Everything after this argument will be passed to CMake verbatim.
|
# Everything after this argument will be passed to CMake verbatim.
|
||||||
list(APPEND cmake_args "${configure_args}")
|
list(APPEND cmake_args "${configure_args}")
|
||||||
@ -152,6 +148,41 @@ while(NOT "${configure_args}" STREQUAL "")
|
|||||||
endif()
|
endif()
|
||||||
endwhile()
|
endwhile()
|
||||||
|
|
||||||
|
# Read the specified manually generator value from CMake command line.
|
||||||
|
# The '-cmake-generator' argument has higher priority than CMake command line.
|
||||||
|
if(NOT generator)
|
||||||
|
set(is_next_arg_generator_name FALSE)
|
||||||
|
foreach(arg IN LISTS cmake_args)
|
||||||
|
if(is_next_arg_generator_name)
|
||||||
|
set(is_next_arg_generator_name FALSE)
|
||||||
|
if(NOT arg MATCHES "^-.*")
|
||||||
|
set(generator "${arg}")
|
||||||
|
set(auto_detect_generator FALSE)
|
||||||
|
endif()
|
||||||
|
elseif(arg MATCHES "^-G(.*)")
|
||||||
|
set(generator "${CMAKE_MATCH_1}")
|
||||||
|
if(generator)
|
||||||
|
set(auto_detect_generator FALSE)
|
||||||
|
else()
|
||||||
|
set(is_next_arg_generator_name TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Attempt to detect the generator type, either single or multi-config
|
||||||
|
if("${generator}" STREQUAL "Xcode"
|
||||||
|
OR "${generator}" STREQUAL "Ninja Multi-Config"
|
||||||
|
OR "${generator}" MATCHES "^Visual Studio")
|
||||||
|
set(multi_config ON)
|
||||||
|
else()
|
||||||
|
set(multi_config OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Tell the build system we are configuring via the configure script so we can act on that.
|
||||||
|
# The cache variable is unset at the end of configuration.
|
||||||
|
push("-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE")
|
||||||
|
|
||||||
if(FRESH_REQUESTED)
|
if(FRESH_REQUESTED)
|
||||||
push("-DQT_INTERNAL_FRESH_REQUESTED:BOOL=TRUE")
|
push("-DQT_INTERNAL_FRESH_REQUESTED:BOOL=TRUE")
|
||||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24")
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24")
|
||||||
@ -827,7 +858,10 @@ endfunction()
|
|||||||
drop_input(commercial)
|
drop_input(commercial)
|
||||||
drop_input(confirm-license)
|
drop_input(confirm-license)
|
||||||
translate_boolean_input(precompile_header BUILD_WITH_PCH)
|
translate_boolean_input(precompile_header BUILD_WITH_PCH)
|
||||||
|
translate_boolean_input(unity_build QT_UNITY_BUILD)
|
||||||
|
translate_string_input(unity_build_batch_size QT_UNITY_BUILD_BATCH_SIZE)
|
||||||
translate_boolean_input(ccache QT_USE_CCACHE)
|
translate_boolean_input(ccache QT_USE_CCACHE)
|
||||||
|
translate_boolean_input(vcpkg QT_USE_VCPKG)
|
||||||
translate_boolean_input(shared BUILD_SHARED_LIBS)
|
translate_boolean_input(shared BUILD_SHARED_LIBS)
|
||||||
translate_boolean_input(warnings_are_errors WARNINGS_ARE_ERRORS)
|
translate_boolean_input(warnings_are_errors WARNINGS_ARE_ERRORS)
|
||||||
translate_string_input(qt_namespace QT_NAMESPACE)
|
translate_string_input(qt_namespace QT_NAMESPACE)
|
||||||
@ -877,6 +911,7 @@ endif()
|
|||||||
|
|
||||||
drop_input(make)
|
drop_input(make)
|
||||||
drop_input(nomake)
|
drop_input(nomake)
|
||||||
|
translate_boolean_input(install-examples-sources QT_INSTALL_EXAMPLES_SOURCES)
|
||||||
|
|
||||||
check_qt_build_parts(nomake)
|
check_qt_build_parts(nomake)
|
||||||
check_qt_build_parts(make)
|
check_qt_build_parts(make)
|
||||||
@ -898,9 +933,9 @@ if(INPUT_force_debug_info)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(LENGTH build_configs nr_of_build_configs)
|
list(LENGTH build_configs nr_of_build_configs)
|
||||||
if(nr_of_build_configs EQUAL 1)
|
if(nr_of_build_configs EQUAL 1 AND NOT multi_config)
|
||||||
push("-DCMAKE_BUILD_TYPE=${build_configs}")
|
push("-DCMAKE_BUILD_TYPE=${build_configs}")
|
||||||
elseif(nr_of_build_configs GREATER 1)
|
elseif(nr_of_build_configs GREATER 1 OR multi_config)
|
||||||
set(multi_config ON)
|
set(multi_config ON)
|
||||||
string(REPLACE ";" "[[;]]" escaped_build_configs "${build_configs}")
|
string(REPLACE ";" "[[;]]" escaped_build_configs "${build_configs}")
|
||||||
# We must not use the push macro here to avoid variable expansion.
|
# We must not use the push macro here to avoid variable expansion.
|
||||||
|
@ -283,13 +283,15 @@ function(_qt_internal_get_default_apple_bundle_identifier target out_var)
|
|||||||
string(APPEND prefix ".${infix}")
|
string(APPEND prefix ".${infix}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(WARNING
|
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
||||||
"No organization bundle identifier prefix could be retrieved from Xcode preferences. \
|
message(WARNING
|
||||||
This can lead to code signing issues due to a non-unique bundle \
|
"No organization bundle identifier prefix could be retrieved from Xcode preferences. \
|
||||||
identifier. Please set up an organization prefix by creating a new project within \
|
This can lead to code signing issues due to a non-unique bundle \
|
||||||
Xcode, or consider providing a custom bundle identifier by specifying the \
|
identifier. Please set up an organization prefix by creating a new project within \
|
||||||
MACOSX_BUNDLE_GUI_IDENTIFIER or XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER property."
|
Xcode, or consider providing a custom bundle identifier by specifying the \
|
||||||
)
|
MACOSX_BUNDLE_GUI_IDENTIFIER or XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER property."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Escape the prefix according to rfc 1034, it's important for code-signing. If an invalid
|
# Escape the prefix according to rfc 1034, it's important for code-signing. If an invalid
|
||||||
@ -300,7 +302,7 @@ function(_qt_internal_get_default_apple_bundle_identifier target out_var)
|
|||||||
_qt_internal_escape_rfc_1034_identifier("${prefix}" prefix)
|
_qt_internal_escape_rfc_1034_identifier("${prefix}" prefix)
|
||||||
|
|
||||||
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
||||||
set(identifier "${prefix}.\${PRODUCT_NAME:rfc1034identifier}")
|
set(identifier "${prefix}.$(PRODUCT_NAME:rfc1034identifier)")
|
||||||
else()
|
else()
|
||||||
set(identifier "${prefix}.${target}")
|
set(identifier "${prefix}.${target}")
|
||||||
endif()
|
endif()
|
||||||
@ -450,7 +452,7 @@ function(_qt_internal_set_apple_bundle_identifier target)
|
|||||||
set_target_properties("${target}"
|
set_target_properties("${target}"
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${bundle_id}"
|
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${bundle_id}"
|
||||||
MACOSX_BUNDLE_GUI_IDENTIFIER "\${PRODUCT_BUNDLE_IDENTIFIER}")
|
MACOSX_BUNDLE_GUI_IDENTIFIER "$(PRODUCT_BUNDLE_IDENTIFIER)")
|
||||||
else()
|
else()
|
||||||
set_target_properties("${target}"
|
set_target_properties("${target}"
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
@ -524,7 +526,7 @@ function(_qt_internal_set_xcode_bundle_name target)
|
|||||||
if(CMAKE_GENERATOR STREQUAL Xcode)
|
if(CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
set_target_properties("${target}"
|
set_target_properties("${target}"
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
MACOSX_BUNDLE_BUNDLE_NAME "\${PRODUCT_NAME}")
|
MACOSX_BUNDLE_BUNDLE_NAME "$(PRODUCT_NAME)")
|
||||||
else()
|
else()
|
||||||
set_target_properties("${target}"
|
set_target_properties("${target}"
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
|
@ -307,7 +307,17 @@ function(_qt_internal_set_up_static_runtime_library target)
|
|||||||
set_property(TARGET ${target} PROPERTY
|
set_property(TARGET ${target} PROPERTY
|
||||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
target_link_options(${target} INTERFACE "LINKER:-Bstatic")
|
get_target_property(target_type ${target} TYPE)
|
||||||
|
if(target_type STREQUAL "EXECUTABLE")
|
||||||
|
set(link_option PRIVATE)
|
||||||
|
else()
|
||||||
|
set(link_option INTERFACE)
|
||||||
|
endif()
|
||||||
|
if(CLANG)
|
||||||
|
target_link_options(${target} ${link_option} "LINKER:-Bstatic")
|
||||||
|
else()
|
||||||
|
target_link_options(${target} ${link_option} "-static")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -53,7 +53,7 @@ endfunction()
|
|||||||
|
|
||||||
function(__qt_internal_get_emcc_recommended_version out_var)
|
function(__qt_internal_get_emcc_recommended_version out_var)
|
||||||
# This version of Qt needs this version of emscripten.
|
# This version of Qt needs this version of emscripten.
|
||||||
set(QT_EMCC_RECOMMENDED_VERSION "3.1.25")
|
set(QT_EMCC_RECOMMENDED_VERSION "3.1.37")
|
||||||
set(${out_var} "${QT_EMCC_RECOMMENDED_VERSION}" PARENT_SCOPE)
|
set(${out_var} "${QT_EMCC_RECOMMENDED_VERSION}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@ -81,12 +81,16 @@ function(__qt_internal_get_qt_build_emsdk_version out_var)
|
|||||||
endif()
|
endif()
|
||||||
if(EXISTS "${WASM_BUILD_DIR}/src/corelib/global/qconfig.h")
|
if(EXISTS "${WASM_BUILD_DIR}/src/corelib/global/qconfig.h")
|
||||||
file(READ "${WASM_BUILD_DIR}/src/corelib/global/qconfig.h" ver)
|
file(READ "${WASM_BUILD_DIR}/src/corelib/global/qconfig.h" ver)
|
||||||
else()
|
elseif(EXISTS "${WASM_BUILD_DIR}/include/QtCore/qconfig.h")
|
||||||
file(READ "${WASM_BUILD_DIR}/include/QtCore/qconfig.h" ver)
|
file(READ "${WASM_BUILD_DIR}/include/QtCore/qconfig.h" ver)
|
||||||
|
else()
|
||||||
|
message("qconfig.h not found, unable to determine Qt build Emscripten version")
|
||||||
|
endif()
|
||||||
|
if (ver)
|
||||||
|
string(REGEX MATCH "#define QT_EMCC_VERSION.\"[0-9]+\\.[0-9]+\\.[0-9]+\"" emOutput ${ver})
|
||||||
|
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" build_emcc_version "${emOutput}")
|
||||||
|
set(${out_var} "${build_emcc_version}" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
string(REGEX MATCH "#define QT_EMCC_VERSION.\"[0-9]+\\.[0-9]+\\.[0-9]+\"" emOutput ${ver})
|
|
||||||
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" build_emcc_version "${emOutput}")
|
|
||||||
set(${out_var} "${build_emcc_version}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(_qt_test_emscripten_version)
|
function(_qt_test_emscripten_version)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
function(qt_internal_get_relative_rpath_base_token out_var)
|
function(qt_internal_get_relative_rpath_base_token out_var)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(rpath_rel_base "@loader_path")
|
set(rpath_rel_base "@loader_path")
|
||||||
elseif(LINUX OR SOLARIS OR FREEBSD OR HURD)
|
elseif(LINUX OR SOLARIS OR FREEBSD OR HURD OR OPENBSD)
|
||||||
set(rpath_rel_base "$ORIGIN")
|
set(rpath_rel_base "$ORIGIN")
|
||||||
else()
|
else()
|
||||||
set(rpath_rel_base "NO_KNOWN_RPATH_REL_BASE")
|
set(rpath_rel_base "NO_KNOWN_RPATH_REL_BASE")
|
||||||
|
@ -201,7 +201,11 @@ endfunction()
|
|||||||
# Enable separate debug information for the given target
|
# Enable separate debug information for the given target
|
||||||
function(qt_enable_separate_debug_info target installDestination)
|
function(qt_enable_separate_debug_info target installDestination)
|
||||||
set(flags QT_EXECUTABLE)
|
set(flags QT_EXECUTABLE)
|
||||||
set(options)
|
if(APPLE)
|
||||||
|
set(options DSYM_OUTPUT_DIR)
|
||||||
|
else()
|
||||||
|
set(options)
|
||||||
|
endif()
|
||||||
set(multiopts ADDITIONAL_INSTALL_ARGS)
|
set(multiopts ADDITIONAL_INSTALL_ARGS)
|
||||||
cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN})
|
cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN})
|
||||||
|
|
||||||
@ -248,12 +252,20 @@ function(qt_enable_separate_debug_info target installDestination)
|
|||||||
get_target_property(is_framework ${target} FRAMEWORK)
|
get_target_property(is_framework ${target} FRAMEWORK)
|
||||||
if(is_framework)
|
if(is_framework)
|
||||||
qt_internal_get_framework_info(fw ${target})
|
qt_internal_get_framework_info(fw ${target})
|
||||||
set(debug_info_bundle_dir "$<TARGET_BUNDLE_DIR:${target}>.${debug_info_suffix}")
|
|
||||||
set(BUNDLE_ID ${fw_name})
|
set(BUNDLE_ID ${fw_name})
|
||||||
else()
|
else()
|
||||||
set(debug_info_bundle_dir "$<TARGET_FILE:${target}>.${debug_info_suffix}")
|
|
||||||
set(BUNDLE_ID ${target})
|
set(BUNDLE_ID ${target})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT "x${arg_DSYM_OUTPUT_DIR}" STREQUAL "x")
|
||||||
|
set(debug_info_bundle_dir "${arg_DSYM_OUTPUT_DIR}/${target}")
|
||||||
|
elseif(is_framework)
|
||||||
|
set(debug_info_bundle_dir "$<TARGET_BUNDLE_DIR:${target}>")
|
||||||
|
else()
|
||||||
|
set(debug_info_bundle_dir "$<TARGET_FILE:${target}>")
|
||||||
|
endif()
|
||||||
|
set(debug_info_bundle_dir "${debug_info_bundle_dir}.${debug_info_suffix}")
|
||||||
|
|
||||||
set(debug_info_contents_dir "${debug_info_bundle_dir}/Contents")
|
set(debug_info_contents_dir "${debug_info_bundle_dir}/Contents")
|
||||||
set(debug_info_target_dir "${debug_info_contents_dir}/Resources/DWARF")
|
set(debug_info_target_dir "${debug_info_contents_dir}/Resources/DWARF")
|
||||||
configure_file(
|
configure_file(
|
||||||
|
@ -5,21 +5,17 @@
|
|||||||
|
|
||||||
# Set the QT_IS_BUILDING_QT variable so we can verify whether we are building
|
# Set the QT_IS_BUILDING_QT variable so we can verify whether we are building
|
||||||
# Qt from source
|
# Qt from source
|
||||||
set(QT_BUILDING_QT TRUE CACHE
|
set(QT_BUILDING_QT TRUE CACHE BOOL
|
||||||
TYPE STRING "When this is present and set to true, it signals that we are building Qt from source.")
|
"When this is present and set to true, it signals that we are building Qt from source.")
|
||||||
|
|
||||||
# Pre-calculate the developer_build feature if it's set by the user via INPUT_developer_build
|
# Pre-calculate the developer_build feature if it's set by the user via the INPUT_developer_build
|
||||||
if(NOT FEATURE_developer_build AND INPUT_developer_build
|
# variable when using the configure script. When not using configure, don't take the INPUT variable
|
||||||
AND NOT "${INPUT_developer_build}" STREQUAL "undefined")
|
# into account, so that users can toggle the feature directly in the cache or via IDE.
|
||||||
set(FEATURE_developer_build ON)
|
qt_internal_compute_feature_value_from_possible_input(developer_build)
|
||||||
endif()
|
|
||||||
|
|
||||||
# Pre-calculate the no_prefix feature if it's set by configure via INPUT_no_prefix.
|
# Pre-calculate the no_prefix feature if it's set by configure via INPUT_no_prefix.
|
||||||
# This needs to be done before qtbase/configure.cmake is processed.
|
# This needs to be done before qtbase/configure.cmake is processed.
|
||||||
if(NOT FEATURE_no_prefix AND INPUT_no_prefix
|
qt_internal_compute_feature_value_from_possible_input(no_prefix)
|
||||||
AND NOT "${INPUT_no_prefix}" STREQUAL "undefined")
|
|
||||||
set(FEATURE_no_prefix ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(_default_build_type "Release")
|
set(_default_build_type "Release")
|
||||||
if(FEATURE_developer_build)
|
if(FEATURE_developer_build)
|
||||||
@ -49,7 +45,20 @@ unset(QT_EXTRA_BUILD_INTERNALS_VARS)
|
|||||||
# Save the global property in a variable to make it available to feature conditions.
|
# Save the global property in a variable to make it available to feature conditions.
|
||||||
get_property(QT_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
get_property(QT_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
# Try to detect if an explicit CMAKE_BUILD_TYPE was set by the user.
|
||||||
|
# CMake sets CMAKE_BUILD_TYPE_INIT to Debug on most Windows platforms and doesn't set
|
||||||
|
# anything for UNIXes. CMake assigns CMAKE_BUILD_TYPE_INIT to CMAKE_BUILD_TYPE during
|
||||||
|
# first project() if CMAKE_BUILD_TYPE has no previous value.
|
||||||
|
# We use extra information about the state of CMAKE_BUILD_TYPE before the first
|
||||||
|
# project() call that's set in QtAutodetect.
|
||||||
|
# STREQUAL check needs to have expanded variables because an undefined var is not equal
|
||||||
|
# to an empty defined var.
|
||||||
|
# See also qt_internal_force_set_cmake_build_type_conditionally which is used
|
||||||
|
# to set the build type when building other repos or tests.
|
||||||
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "${CMAKE_BUILD_TYPE_INIT}"
|
||||||
|
AND NOT __qt_auto_detect_cmake_build_type_before_project_call
|
||||||
|
AND NOT __qt_build_internals_cmake_build_type
|
||||||
|
AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
message(STATUS "Setting build type to '${_default_build_type}' as none was specified.")
|
message(STATUS "Setting build type to '${_default_build_type}' as none was specified.")
|
||||||
set(CMAKE_BUILD_TYPE "${_default_build_type}" CACHE STRING "Choose the type of build." FORCE)
|
set(CMAKE_BUILD_TYPE "${_default_build_type}" CACHE STRING "Choose the type of build." FORCE)
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE
|
set_property(CACHE CMAKE_BUILD_TYPE
|
||||||
@ -193,6 +202,8 @@ else()
|
|||||||
set(QT_INTERNAL_CONFIGURE_FROM_IDE FALSE CACHE INTERNAL "Configuring Qt Project from IDE")
|
set(QT_INTERNAL_CONFIGURE_FROM_IDE FALSE CACHE INTERNAL "Configuring Qt Project from IDE")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(_qt_sync_headers_at_configure_time_default ${QT_INTERNAL_CONFIGURE_FROM_IDE})
|
||||||
|
|
||||||
if(FEATURE_developer_build)
|
if(FEATURE_developer_build)
|
||||||
if(DEFINED QT_CMAKE_EXPORT_COMPILE_COMMANDS)
|
if(DEFINED QT_CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ${QT_CMAKE_EXPORT_COMPILE_COMMANDS})
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ${QT_CMAKE_EXPORT_COMPILE_COMMANDS})
|
||||||
@ -213,11 +224,26 @@ if(FEATURE_developer_build)
|
|||||||
if (CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE STREQUAL Debug)
|
if (CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||||
set(__build_benchmarks OFF)
|
set(__build_benchmarks OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Sync headers during the initial configuration of a -developer-build to facilitate code
|
||||||
|
# navigation for code editors that use an LSP-based code model.
|
||||||
|
set(_qt_sync_headers_at_configure_time_default TRUE)
|
||||||
else()
|
else()
|
||||||
set(_qt_build_tests_default OFF)
|
set(_qt_build_tests_default OFF)
|
||||||
set(__build_benchmarks OFF)
|
set(__build_benchmarks OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Sync Qt header files at configure time
|
||||||
|
option(QT_SYNC_HEADERS_AT_CONFIGURE_TIME "Run syncqt at configure time already"
|
||||||
|
${_qt_sync_headers_at_configure_time_default})
|
||||||
|
unset(_qt_sync_headers_at_configure_time_default)
|
||||||
|
|
||||||
|
# In static Ninja Multi-Config builds the sync_headers dependencies(and other autogen dependencies
|
||||||
|
# are not added to '_autogen/timestamp' targets. See QTBUG-113974.
|
||||||
|
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config" AND NOT QT_BUILD_SHARED_LIBS)
|
||||||
|
set(QT_SYNC_HEADERS_AT_CONFIGURE_TIME TRUE CACHE BOOL "" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Build Benchmarks
|
# Build Benchmarks
|
||||||
option(QT_BUILD_BENCHMARKS "Build Qt Benchmarks" ${__build_benchmarks})
|
option(QT_BUILD_BENCHMARKS "Build Qt Benchmarks" ${__build_benchmarks})
|
||||||
if(QT_BUILD_BENCHMARKS)
|
if(QT_BUILD_BENCHMARKS)
|
||||||
@ -285,6 +311,9 @@ enable_testing()
|
|||||||
|
|
||||||
option(QT_BUILD_EXAMPLES "Build Qt examples" OFF)
|
option(QT_BUILD_EXAMPLES "Build Qt examples" OFF)
|
||||||
option(QT_BUILD_EXAMPLES_BY_DEFAULT "Should examples be built as part of the default 'all' target." ON)
|
option(QT_BUILD_EXAMPLES_BY_DEFAULT "Should examples be built as part of the default 'all' target." ON)
|
||||||
|
option(QT_INSTALL_EXAMPLES_SOURCES "Install example sources" OFF)
|
||||||
|
option(QT_INSTALL_EXAMPLES_SOURCES_BY_DEFAULT
|
||||||
|
"Install example sources as part of the default 'install' target" ON)
|
||||||
|
|
||||||
# FIXME: Support prefix builds as well QTBUG-96232
|
# FIXME: Support prefix builds as well QTBUG-96232
|
||||||
if(QT_WILL_INSTALL)
|
if(QT_WILL_INSTALL)
|
||||||
@ -354,29 +383,7 @@ endif()
|
|||||||
|
|
||||||
option(QT_ALLOW_SYMLINK_IN_PATHS "Allows symlinks in paths." OFF)
|
option(QT_ALLOW_SYMLINK_IN_PATHS "Allows symlinks in paths." OFF)
|
||||||
|
|
||||||
# We need to clean up QT_FEATURE_*, but only once per configuration cycle
|
qt_internal_detect_dirty_features()
|
||||||
get_property(qt_feature_clean GLOBAL PROPERTY _qt_feature_clean)
|
|
||||||
if(NOT qt_feature_clean)
|
|
||||||
message(STATUS "Check for feature set changes")
|
|
||||||
set_property(GLOBAL PROPERTY _qt_feature_clean TRUE)
|
|
||||||
foreach(feature ${QT_KNOWN_FEATURES})
|
|
||||||
if(DEFINED "FEATURE_${feature}" AND
|
|
||||||
NOT "${QT_FEATURE_${feature}}" STREQUAL "${FEATURE_${feature}}")
|
|
||||||
message(" '${feature}' is changed from ${QT_FEATURE_${feature}} \
|
|
||||||
to ${FEATURE_${feature}}")
|
|
||||||
set(dirty_build TRUE)
|
|
||||||
endif()
|
|
||||||
unset("QT_FEATURE_${feature}" CACHE)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
set(QT_KNOWN_FEATURES "" CACHE INTERNAL "" FORCE)
|
|
||||||
|
|
||||||
if(dirty_build)
|
|
||||||
set_property(GLOBAL PROPERTY _qt_dirty_build TRUE)
|
|
||||||
message(WARNING "Re-configuring in existing build folder. \
|
|
||||||
Some features will be re-evaluated automatically.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT QT_BUILD_EXAMPLES)
|
if(NOT QT_BUILD_EXAMPLES)
|
||||||
# Disable deployment setup to avoid warnings about missing patchelf with CMake < 3.21.
|
# Disable deployment setup to avoid warnings about missing patchelf with CMake < 3.21.
|
||||||
|
@ -158,6 +158,21 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge
|
|||||||
set(syncqt_args_rsp "${binary_dir_real}/${target}_syncqt_args")
|
set(syncqt_args_rsp "${binary_dir_real}/${target}_syncqt_args")
|
||||||
qt_configure_file(OUTPUT "${syncqt_args_rsp}" CONTENT "${syncqt_args_string}")
|
qt_configure_file(OUTPUT "${syncqt_args_rsp}" CONTENT "${syncqt_args_string}")
|
||||||
|
|
||||||
|
get_target_property(external_headers_dir ${target} _qt_external_headers_dir)
|
||||||
|
if(external_headers_dir)
|
||||||
|
if(NOT IS_ABSOLUTE "${external_headers_dir}")
|
||||||
|
get_filename_component(external_headers_dir "${external_headers_dir}" ABSOLUTE)
|
||||||
|
endif()
|
||||||
|
if(EXISTS "${external_headers_dir}")
|
||||||
|
set(external_headers_dir_copy_cmd
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND}
|
||||||
|
-E copy_directory
|
||||||
|
"${external_headers_dir}"
|
||||||
|
"${module_build_interface_include_dir}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT
|
OUTPUT
|
||||||
${syncqt_outputs}
|
${syncqt_outputs}
|
||||||
@ -165,6 +180,7 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge
|
|||||||
${QT_CMAKE_EXPORT_NAMESPACE}::syncqt
|
${QT_CMAKE_EXPORT_NAMESPACE}::syncqt
|
||||||
"@${syncqt_args_rsp}"
|
"@${syncqt_args_rsp}"
|
||||||
${build_time_syncqt_arguments}
|
${build_time_syncqt_arguments}
|
||||||
|
${external_headers_dir_copy_cmd}
|
||||||
COMMAND
|
COMMAND
|
||||||
${CMAKE_COMMAND} -E touch "${syncqt_timestamp}"
|
${CMAKE_COMMAND} -E touch "${syncqt_timestamp}"
|
||||||
DEPENDS
|
DEPENDS
|
||||||
@ -176,7 +192,14 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge
|
|||||||
"Running syncqt.cpp for module: ${module}"
|
"Running syncqt.cpp for module: ${module}"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(add_sync_headers_to_all "")
|
||||||
|
if(is_interface_lib)
|
||||||
|
set(add_sync_headers_to_all ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_target(${target}_sync_headers
|
add_custom_target(${target}_sync_headers
|
||||||
|
${add_sync_headers_to_all}
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${syncqt_outputs}
|
${syncqt_outputs}
|
||||||
)
|
)
|
||||||
@ -184,6 +207,9 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge
|
|||||||
set_target_properties(${target}
|
set_target_properties(${target}
|
||||||
PROPERTIES _qt_internal_sync_headers_target ${target}_sync_headers)
|
PROPERTIES _qt_internal_sync_headers_target ${target}_sync_headers)
|
||||||
|
|
||||||
|
if(is_3rd_party_library)
|
||||||
|
add_dependencies(thirdparty_sync_headers ${target}_sync_headers)
|
||||||
|
endif()
|
||||||
# This target is required when building docs, to make all header files and their aliases
|
# This target is required when building docs, to make all header files and their aliases
|
||||||
# available for qdoc.
|
# available for qdoc.
|
||||||
# ${target}_sync_headers is added as dependency to make sure that
|
# ${target}_sync_headers is added as dependency to make sure that
|
||||||
@ -196,6 +222,7 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge
|
|||||||
COMMAND
|
COMMAND
|
||||||
${QT_CMAKE_EXPORT_NAMESPACE}::syncqt
|
${QT_CMAKE_EXPORT_NAMESPACE}::syncqt
|
||||||
"@${syncqt_all_args_rsp}"
|
"@${syncqt_all_args_rsp}"
|
||||||
|
${external_headers_dir_copy_cmd}
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${module_headers}
|
${module_headers}
|
||||||
${syncqt_all_args_rsp}
|
${syncqt_all_args_rsp}
|
||||||
@ -231,7 +258,7 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge
|
|||||||
# Run sync Qt first time at configure step to make all header files available for the code model
|
# Run sync Qt first time at configure step to make all header files available for the code model
|
||||||
# of IDEs.
|
# of IDEs.
|
||||||
get_property(synced_modules GLOBAL PROPERTY _qt_synced_modules)
|
get_property(synced_modules GLOBAL PROPERTY _qt_synced_modules)
|
||||||
if(NOT "${module}" IN_LIST synced_modules)
|
if(NOT "${module}" IN_LIST synced_modules AND QT_SYNC_HEADERS_AT_CONFIGURE_TIME)
|
||||||
message(STATUS "Running syncqt.cpp for module: ${module}")
|
message(STATUS "Running syncqt.cpp for module: ${module}")
|
||||||
get_target_property(syncqt_location ${QT_CMAKE_EXPORT_NAMESPACE}::syncqt LOCATION)
|
get_target_property(syncqt_location ${QT_CMAKE_EXPORT_NAMESPACE}::syncqt LOCATION)
|
||||||
execute_process(
|
execute_process(
|
||||||
|
@ -51,7 +51,6 @@ function(qt_internal_extend_target target)
|
|||||||
CONDITION
|
CONDITION
|
||||||
CONDITION_INDEPENDENT_SOURCES
|
CONDITION_INDEPENDENT_SOURCES
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
NO_PCH_SOURCES
|
|
||||||
)
|
)
|
||||||
|
|
||||||
cmake_parse_arguments(PARSE_ARGV 1 arg
|
cmake_parse_arguments(PARSE_ARGV 1 arg
|
||||||
@ -119,6 +118,10 @@ function(qt_internal_extend_target target)
|
|||||||
# heuristic way of building the dependency tree between the _sync_headers targets of
|
# heuristic way of building the dependency tree between the _sync_headers targets of
|
||||||
# different Qt modules.
|
# different Qt modules.
|
||||||
if(TARGET "${lib}")
|
if(TARGET "${lib}")
|
||||||
|
get_target_property(is_private ${lib} _qt_is_private_module)
|
||||||
|
if(is_private)
|
||||||
|
get_target_property(lib ${lib} _qt_public_module_target_name)
|
||||||
|
endif()
|
||||||
set(out_genex "$<TARGET_PROPERTY:${lib},_qt_internal_sync_headers_target>")
|
set(out_genex "$<TARGET_PROPERTY:${lib},_qt_internal_sync_headers_target>")
|
||||||
set_property(TARGET ${target}
|
set_property(TARGET ${target}
|
||||||
APPEND PROPERTY _qt_internal_sync_headers_deps "${out_genex}")
|
APPEND PROPERTY _qt_internal_sync_headers_deps "${out_genex}")
|
||||||
@ -1021,6 +1024,15 @@ endfunction()
|
|||||||
# Needed to allow selectively applying certain flags via PlatformXInternal targets.
|
# Needed to allow selectively applying certain flags via PlatformXInternal targets.
|
||||||
function(qt_internal_mark_as_internal_library target)
|
function(qt_internal_mark_as_internal_library target)
|
||||||
set_target_properties(${target} PROPERTIES _qt_is_internal_library TRUE)
|
set_target_properties(${target} PROPERTIES _qt_is_internal_library TRUE)
|
||||||
|
qt_internal_mark_as_internal_target(${target})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Marks a target with a property that it was built using the internal Qt API (qt_internal_*) as
|
||||||
|
# opposed to it being a user project library or executable(qt_add_*, etc).
|
||||||
|
#
|
||||||
|
# Needed to allow selectively applying certain flags via PlatformXInternal targets.
|
||||||
|
function(qt_internal_mark_as_internal_target target)
|
||||||
|
set_target_properties(${target} PROPERTIES _qt_is_internal_target TRUE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Marks a target with a property to skip it adding it as a dependency when building examples as
|
# Marks a target with a property to skip it adding it as a dependency when building examples as
|
||||||
|
@ -214,6 +214,7 @@ function(qt_internal_get_test_arg_definitions optional_args single_value_args mu
|
|||||||
MANUAL
|
MANUAL
|
||||||
NO_BATCH
|
NO_BATCH
|
||||||
NO_INSTALL
|
NO_INSTALL
|
||||||
|
BUNDLE_ANDROID_OPENSSL_LIBS
|
||||||
PARENT_SCOPE
|
PARENT_SCOPE
|
||||||
)
|
)
|
||||||
set(${single_value_args}
|
set(${single_value_args}
|
||||||
@ -579,6 +580,21 @@ function(qt_internal_add_test name)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
|
if(arg_BUNDLE_ANDROID_OPENSSL_LIBS)
|
||||||
|
if(NOT OPENSSL_ROOT_DIR)
|
||||||
|
message(WARNING "The argument BUNDLE_ANDROID_OPENSSL_LIBS is set "
|
||||||
|
"but OPENSSL_ROOT_DIR parameter is not set.")
|
||||||
|
else()
|
||||||
|
if(EXISTS "${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so")
|
||||||
|
set_property(TARGET ${name} APPEND PROPERTY QT_ANDROID_EXTRA_LIBS
|
||||||
|
"${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so"
|
||||||
|
"${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libssl_3.so")
|
||||||
|
else()
|
||||||
|
message(STATUS "Test should bundle OpenSSL libraries but they are not found."
|
||||||
|
" This is fine if OpenSSL was built statically.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
qt_internal_android_test_arguments("${name}" test_executable extra_test_args)
|
qt_internal_android_test_arguments("${name}" test_executable extra_test_args)
|
||||||
set(test_working_dir "${CMAKE_CURRENT_BINARY_DIR}")
|
set(test_working_dir "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
elseif(QNX)
|
elseif(QNX)
|
||||||
@ -602,10 +618,13 @@ function(qt_internal_add_test name)
|
|||||||
list(APPEND extra_test_args "--browser_args=\"--password-store=basic\"")
|
list(APPEND extra_test_args "--browser_args=\"--password-store=basic\"")
|
||||||
list(APPEND extra_test_args "--kill_exit")
|
list(APPEND extra_test_args "--kill_exit")
|
||||||
|
|
||||||
# We always want to enable asyncify for tests, as some of them use exec
|
# Tests may require asyncify if they use exec(). Enable asyncify for
|
||||||
|
# batched tests since this is the configuration used on the CI system.
|
||||||
# Optimize for size (-Os), since asyncify tends to make the resulting
|
# Optimize for size (-Os), since asyncify tends to make the resulting
|
||||||
# binary very large
|
# binary very large
|
||||||
target_link_options("${name}" PRIVATE "SHELL:-s ASYNCIFY" "-Os")
|
if(batch_current_test)
|
||||||
|
target_link_options("${name}" PRIVATE "SHELL:-s ASYNCIFY" "-Os")
|
||||||
|
endif()
|
||||||
|
|
||||||
# This tells cmake to run the tests with this script, since wasm files can't be
|
# This tells cmake to run the tests with this script, since wasm files can't be
|
||||||
# executed directly
|
# executed directly
|
||||||
|
@ -18,7 +18,10 @@
|
|||||||
# TRY_RUN
|
# TRY_RUN
|
||||||
# On Windows, it creates a helper batch script that tests whether the tool can be executed
|
# On Windows, it creates a helper batch script that tests whether the tool can be executed
|
||||||
# successfully or not. If not, build halts and an error will be show, with tips on what
|
# successfully or not. If not, build halts and an error will be show, with tips on what
|
||||||
# might be cause, and how to fix it.
|
# might be cause, and how to fix it. TRY_RUN is disabled when cross-compiling.
|
||||||
|
# TRY_RUN_FLAGS
|
||||||
|
# Command line flags that are going to be passed to the tool for testing its correctness.
|
||||||
|
# If no flags were given, we default to `-v`.
|
||||||
#
|
#
|
||||||
# One-value Arguments:
|
# One-value Arguments:
|
||||||
# EXTRA_CMAKE_FILES
|
# EXTRA_CMAKE_FILES
|
||||||
@ -52,6 +55,7 @@ function(qt_internal_add_tool target_name)
|
|||||||
TOOLS_TARGET
|
TOOLS_TARGET
|
||||||
INSTALL_DIR
|
INSTALL_DIR
|
||||||
CORE_LIBRARY
|
CORE_LIBRARY
|
||||||
|
TRY_RUN_FLAGS
|
||||||
${__default_target_info_args})
|
${__default_target_info_args})
|
||||||
set(multi_value_keywords
|
set(multi_value_keywords
|
||||||
EXTRA_CMAKE_FILES
|
EXTRA_CMAKE_FILES
|
||||||
@ -110,6 +114,7 @@ function(qt_internal_add_tool target_name)
|
|||||||
NO_INSTALL
|
NO_INSTALL
|
||||||
${arg_NO_UNITY_BUILD}
|
${arg_NO_UNITY_BUILD}
|
||||||
SOURCES ${arg_SOURCES}
|
SOURCES ${arg_SOURCES}
|
||||||
|
NO_PCH_SOURCES ${arg_NO_PCH_SOURCES}
|
||||||
NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}
|
NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}
|
||||||
INCLUDE_DIRECTORIES
|
INCLUDE_DIRECTORIES
|
||||||
${arg_INCLUDE_DIRECTORIES}
|
${arg_INCLUDE_DIRECTORIES}
|
||||||
@ -229,15 +234,18 @@ function(qt_internal_add_tool target_name)
|
|||||||
qt_internal_apply_staging_prefix_build_rpath_workaround()
|
qt_internal_apply_staging_prefix_build_rpath_workaround()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(arg_TRY_RUN AND WIN32)
|
if(arg_TRY_RUN AND WIN32 AND NOT CMAKE_CROSSCOMPILING)
|
||||||
_qt_internal_add_try_run_post_build(${target_name})
|
if(NOT arg_TRY_RUN_FLAGS)
|
||||||
|
set(arg_TRY_RUN_FLAGS "-v")
|
||||||
|
endif()
|
||||||
|
_qt_internal_add_try_run_post_build("${target_name}" "${arg_TRY_RUN_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_enable_separate_debug_info(${target_name} "${install_dir}" QT_EXECUTABLE)
|
qt_enable_separate_debug_info(${target_name} "${install_dir}" QT_EXECUTABLE)
|
||||||
qt_internal_install_pdb_files(${target_name} "${install_dir}")
|
qt_internal_install_pdb_files(${target_name} "${install_dir}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(_qt_internal_add_try_run_post_build target)
|
function(_qt_internal_add_try_run_post_build target try_run_flags)
|
||||||
qt_internal_get_upper_case_main_cmake_configuration(main_cmake_configuration)
|
qt_internal_get_upper_case_main_cmake_configuration(main_cmake_configuration)
|
||||||
get_target_property(target_out_dir ${target}
|
get_target_property(target_out_dir ${target}
|
||||||
RUNTIME_OUTPUT_DIRECTORY_${main_cmake_configuration})
|
RUNTIME_OUTPUT_DIRECTORY_${main_cmake_configuration})
|
||||||
@ -251,7 +259,7 @@ function(_qt_internal_add_try_run_post_build target)
|
|||||||
qt_configure_file(OUTPUT "${try_run_scripts_path}"
|
qt_configure_file(OUTPUT "${try_run_scripts_path}"
|
||||||
CONTENT "@echo off
|
CONTENT "@echo off
|
||||||
|
|
||||||
${target_out_dir}/${target}.exe -h > nul 2>&1
|
${target_out_dir}/${target}.exe ${try_run_flags} > nul 2>&1
|
||||||
|
|
||||||
if \"%errorlevel%\" == \"-1073741515\" (
|
if \"%errorlevel%\" == \"-1073741515\" (
|
||||||
echo
|
echo
|
||||||
@ -271,7 +279,8 @@ echo. > ${target_bin_dir}/${target}_try_run_passed"
|
|||||||
DEPENDS
|
DEPENDS
|
||||||
${target}
|
${target}
|
||||||
COMMAND
|
COMMAND
|
||||||
cmd /c ${try_run_scripts_path}
|
${CMAKE_COMMAND} -E env QT_COMMAND_LINE_PARSER_NO_GUI_MESSAGE_BOXES=1
|
||||||
|
${try_run_scripts_path}
|
||||||
COMMENT
|
COMMENT
|
||||||
"Testing ${target} by trying to run it."
|
"Testing ${target} by trying to run it."
|
||||||
VERBATIM
|
VERBATIM
|
||||||
@ -340,7 +349,7 @@ function(qt_export_tools module_name)
|
|||||||
string(REGEX REPLACE "_native$" "" tool_name ${tool_name})
|
string(REGEX REPLACE "_native$" "" tool_name ${tool_name})
|
||||||
endif()
|
endif()
|
||||||
set(extra_cmake_statements "${extra_cmake_statements}
|
set(extra_cmake_statements "${extra_cmake_statements}
|
||||||
if (NOT QT_NO_CREATE_TARGETS)
|
if(NOT QT_NO_CREATE_TARGETS AND ${INSTALL_CMAKE_NAMESPACE}${target}_FOUND)
|
||||||
__qt_internal_promote_target_to_global(${INSTALL_CMAKE_NAMESPACE}::${tool_name})
|
__qt_internal_promote_target_to_global(${INSTALL_CMAKE_NAMESPACE}::${tool_name})
|
||||||
endif()
|
endif()
|
||||||
")
|
")
|
||||||
|
@ -129,14 +129,14 @@ set(__qt_chainload_toolchain_file \"\${__qt_initially_configured_toolchain_file}
|
|||||||
endif()
|
endif()
|
||||||
if(__qt_embed_toolchain_compilers)
|
if(__qt_embed_toolchain_compilers)
|
||||||
list(APPEND init_platform "
|
list(APPEND init_platform "
|
||||||
set(__qt_initial_c_compiler \"${CMAKE_C_COMPILER}\")
|
set(__qt_initial_c_compiler \"${CMAKE_C_COMPILER}\")
|
||||||
set(__qt_initial_cxx_compiler \"${CMAKE_CXX_COMPILER}\")
|
set(__qt_initial_cxx_compiler \"${CMAKE_CXX_COMPILER}\")
|
||||||
if(NOT DEFINED CMAKE_C_COMPILER AND EXISTS \"\${__qt_initial_c_compiler}\")
|
if(NOT DEFINED CMAKE_C_COMPILER AND EXISTS \"\${__qt_initial_c_compiler}\")
|
||||||
set(CMAKE_C_COMPILER \"\${__qt_initial_c_compiler}\" CACHE STRING \"\")
|
set(CMAKE_C_COMPILER \"\${__qt_initial_c_compiler}\" CACHE STRING \"\")
|
||||||
endif()
|
endif()
|
||||||
if(NOT DEFINED CMAKE_CXX_COMPILER AND EXISTS \"\${__qt_initial_cxx_compiler}\")
|
if(NOT DEFINED CMAKE_CXX_COMPILER AND EXISTS \"\${__qt_initial_cxx_compiler}\")
|
||||||
set(CMAKE_CXX_COMPILER \"\${__qt_initial_cxx_compiler}\" CACHE STRING \"\")
|
set(CMAKE_CXX_COMPILER \"\${__qt_initial_cxx_compiler}\" CACHE STRING \"\")
|
||||||
endif()")
|
endif()")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
unset(init_additional_used_variables)
|
unset(init_additional_used_variables)
|
||||||
|
@ -19,8 +19,15 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
|
|
||||||
# Read arguments from IN_FILE and separate them.
|
# Read arguments from IN_FILE and separate them.
|
||||||
file(READ "${IN_FILE}" raw_args)
|
file(READ "${IN_FILE}" raw_args)
|
||||||
|
# To catch cases where the path ends with an `\`, e.g., `-prefix "C:\Path\"`
|
||||||
|
string(REPLACE "\\\"" "\"" raw_args "${raw_args}")
|
||||||
|
string(REPLACE ";" "[[;]]" raw_args "${raw_args}")
|
||||||
|
|
||||||
separate_arguments(args NATIVE_COMMAND "${raw_args}")
|
separate_arguments(args NATIVE_COMMAND "${raw_args}")
|
||||||
|
|
||||||
|
string(REPLACE "\;" ";" args "${args}")
|
||||||
|
string(REPLACE "[[;]]" "\;" args "${args}")
|
||||||
|
|
||||||
if(DEFINED REDO_FILE)
|
if(DEFINED REDO_FILE)
|
||||||
file(READ "${REDO_FILE}" raw_redo_args)
|
file(READ "${REDO_FILE}" raw_redo_args)
|
||||||
separate_arguments(redo_args NATIVE_COMMAND "${raw_redo_args}")
|
separate_arguments(redo_args NATIVE_COMMAND "${raw_redo_args}")
|
||||||
@ -65,7 +72,6 @@ if(DEFINED REDO_FILE)
|
|||||||
else()
|
else()
|
||||||
list(APPEND args "${redo_args}")
|
list(APPEND args "${redo_args}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Skip arguments if requested
|
# Skip arguments if requested
|
||||||
|
@ -77,6 +77,7 @@ The following table describes the mapping of configure options to CMake argument
|
|||||||
| -unity-build-batch-size <int> | -DQT_UNITY_BUILD_BATCH_SIZE=<int> | |
|
| -unity-build-batch-size <int> | -DQT_UNITY_BUILD_BATCH_SIZE=<int> | |
|
||||||
| -warnings-are-errors | -DWARNINGS_ARE_ERRORS=ON | |
|
| -warnings-are-errors | -DWARNINGS_ARE_ERRORS=ON | |
|
||||||
| -no-pkg-config | -DFEATURE_pkg_config=OFF | |
|
| -no-pkg-config | -DFEATURE_pkg_config=OFF | |
|
||||||
|
| -no-vcpkg | -DQT_USE_VCPKG=OFF | |
|
||||||
| -D <string> | -DQT_EXTRA_DEFINES=<string1>;<string2> | |
|
| -D <string> | -DQT_EXTRA_DEFINES=<string1>;<string2> | |
|
||||||
| -I <string> | -DQT_EXTRA_INCLUDEPATHS=<string1>;<string2> | |
|
| -I <string> | -DQT_EXTRA_INCLUDEPATHS=<string1>;<string2> | |
|
||||||
| -L <string> | -DQT_EXTRA_LIBDIRS=<string1>;<string2> | |
|
| -L <string> | -DQT_EXTRA_LIBDIRS=<string1>;<string2> | |
|
||||||
@ -102,6 +103,7 @@ The following table describes the mapping of configure options to CMake argument
|
|||||||
| | | build them separately, after configuration. |
|
| | | build them separately, after configuration. |
|
||||||
| -nomake <part> | -DQT_BUILD_TESTS=OFF | A way to turn off tools explicitly is missing. |
|
| -nomake <part> | -DQT_BUILD_TESTS=OFF | A way to turn off tools explicitly is missing. |
|
||||||
| | -DQT_BUILD_EXAMPLES=OFF | |
|
| | -DQT_BUILD_EXAMPLES=OFF | |
|
||||||
|
| -install-examples-sources | -DQT_INSTALL_EXAMPLES_SOURCES=ON | |
|
||||||
| -no-gui | -DFEATURE_gui=OFF | |
|
| -no-gui | -DFEATURE_gui=OFF | |
|
||||||
| -no-widgets | -DFEATURE_widgets=OFF | |
|
| -no-widgets | -DFEATURE_widgets=OFF | |
|
||||||
| -no-dbus | -DFEATURE_dbus=OFF | |
|
| -no-dbus | -DFEATURE_dbus=OFF | |
|
||||||
|
@ -19,22 +19,22 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(QT_BUILD_@module_define_infix@_LIB) && !defined(QT_STATIC)
|
#if !defined(QT_BUILD_@module_define_infix@_LIB) && !defined(QT_STATIC)
|
||||||
/* outside library → inline decl + defi */
|
/* outside library -> inline decl + defi */
|
||||||
/* static builds treat everything as part of the library, so they never inline */
|
/* static builds treat everything as part of the library, so they never inline */
|
||||||
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) inline
|
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) inline
|
||||||
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1
|
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1
|
||||||
#elif defined(QT_@module_define_infix@_BUILD_REMOVED_API)
|
#elif defined(QT_@module_define_infix@_BUILD_REMOVED_API)
|
||||||
/* inside library, inside removed_api.cpp:
|
/* inside library, inside removed_api.cpp:
|
||||||
* keep deprecated API → non-inline decl;
|
* keep deprecated API -> non-inline decl;
|
||||||
* remove deprecated API → inline decl;
|
* remove deprecated API -> inline decl;
|
||||||
* definition is always available */
|
* definition is always available */
|
||||||
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) \
|
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) \
|
||||||
QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */)
|
QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */)
|
||||||
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1
|
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1
|
||||||
#else
|
#else
|
||||||
/* inside library, outside removed_api.cpp:
|
/* inside library, outside removed_api.cpp:
|
||||||
* keep deprecated API → non-inline decl, no defi;
|
* keep deprecated API -> non-inline decl, no defi;
|
||||||
* remove deprecated API → inline decl, defi */
|
* remove deprecated API -> inline decl, defi */
|
||||||
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) \
|
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) \
|
||||||
QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */)
|
QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */)
|
||||||
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) \
|
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) \
|
||||||
|
@ -13,6 +13,11 @@ instructions:
|
|||||||
variableValue: "{{.Env.COMMON_TEST_CMAKE_ARGS}}"
|
variableValue: "{{.Env.COMMON_TEST_CMAKE_ARGS}}"
|
||||||
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml"
|
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml"
|
||||||
disable_if:
|
disable_if:
|
||||||
condition: property
|
condition: or
|
||||||
property: features
|
conditions:
|
||||||
contains_value: DisableTests
|
- condition: property
|
||||||
|
property: features
|
||||||
|
contains_value: DisableTests
|
||||||
|
- condition: property
|
||||||
|
property: features
|
||||||
|
contains_value: DoNotBuildTests
|
||||||
|
@ -34,6 +34,11 @@ instructions:
|
|||||||
variableValue: "{{.Env.COMMON_TARGET_TEST_CMAKE_ARGS}}"
|
variableValue: "{{.Env.COMMON_TARGET_TEST_CMAKE_ARGS}}"
|
||||||
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml"
|
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml"
|
||||||
disable_if:
|
disable_if:
|
||||||
condition: property
|
condition: or
|
||||||
property: features
|
conditions:
|
||||||
contains_value: DisableTests
|
- condition: property
|
||||||
|
property: features
|
||||||
|
contains_value: DisableTests
|
||||||
|
- condition: property
|
||||||
|
property: features
|
||||||
|
contains_value: DoNotBuildTests
|
||||||
|
@ -61,9 +61,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR
|
variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR
|
||||||
variableValue: "{{.InstallDir}}{{.Env.CI_PATH_SEP}}host{{.Env.CI_PATH_SEP}}bin"
|
variableValue: "{{.InstallDir}}{{.Env.CI_PATH_SEP}}host{{.Env.CI_PATH_SEP}}bin"
|
||||||
@ -73,9 +78,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- !include "{{qt/qtbase}}/call_host_install.yaml"
|
- !include "{{qt/qtbase}}/call_host_install.yaml"
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: DESTDIR
|
variableName: DESTDIR
|
||||||
@ -123,9 +133,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR
|
variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR
|
||||||
variableValue: "{{.InstallDir}}{{.Env.CI_PATH_SEP}}target{{.Env.CI_PATH_SEP}}bin"
|
variableValue: "{{.InstallDir}}{{.Env.CI_PATH_SEP}}target{{.Env.CI_PATH_SEP}}bin"
|
||||||
@ -135,9 +150,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- !include "{{qt/qtbase}}/call_target_install.yaml"
|
- !include "{{qt/qtbase}}/call_target_install.yaml"
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: DESTDIR
|
variableName: DESTDIR
|
||||||
|
@ -47,9 +47,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR
|
variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR
|
||||||
variableValue: "{{.BuildDir}}{{.Env.CI_PATH_SEP}}bin"
|
variableValue: "{{.BuildDir}}{{.Env.CI_PATH_SEP}}bin"
|
||||||
@ -59,9 +64,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- !include "{{qt/qtbase}}/call_host_install.yaml"
|
- !include "{{qt/qtbase}}/call_host_install.yaml"
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: DESTDIR
|
variableName: DESTDIR
|
||||||
@ -124,9 +134,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR
|
variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR
|
||||||
variableValue: "{{.Env.COIN_CMAKE_BUILD_DIR}}{{.Env.CI_PATH_SEP}}bin"
|
variableValue: "{{.Env.COIN_CMAKE_BUILD_DIR}}{{.Env.CI_PATH_SEP}}bin"
|
||||||
@ -136,9 +151,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- !include "{{qt/qtbase}}/call_target_install.yaml"
|
- !include "{{qt/qtbase}}/call_target_install.yaml"
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: DESTDIR
|
variableName: DESTDIR
|
||||||
|
@ -41,9 +41,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR
|
variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR
|
||||||
variableValue: "{{.Env.COIN_CMAKE_BUILD_DIR}}{{.Env.CI_PATH_SEP}}bin"
|
variableValue: "{{.Env.COIN_CMAKE_BUILD_DIR}}{{.Env.CI_PATH_SEP}}bin"
|
||||||
@ -53,9 +58,14 @@ instructions:
|
|||||||
- condition: property
|
- condition: property
|
||||||
property: host.os
|
property: host.os
|
||||||
equals_value: Windows
|
equals_value: Windows
|
||||||
- condition: property
|
- condition: and
|
||||||
property: target.osVersion
|
conditions:
|
||||||
not_in_values: [WebAssembly, Android_ANY]
|
- condition: property
|
||||||
|
property: target.os
|
||||||
|
not_equals_value: QNX
|
||||||
|
- condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
not_in_values: [WebAssembly, Android_ANY]
|
||||||
- !include "{{qt/qtbase}}/call_host_install.yaml"
|
- !include "{{qt/qtbase}}/call_host_install.yaml"
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: DESTDIR
|
variableName: DESTDIR
|
||||||
|
@ -32,6 +32,28 @@ instructions:
|
|||||||
condition: runtime
|
condition: runtime
|
||||||
env_var: COIN_SKIP_DEBIAN
|
env_var: COIN_SKIP_DEBIAN
|
||||||
contains_value: "MISSING_DEBIAN_INST"
|
contains_value: "MISSING_DEBIAN_INST"
|
||||||
|
- type: ChangeDirectory
|
||||||
|
directory: "qt6-{{.Env.TESTED_MODULE_PLAIN_COIN}}"
|
||||||
|
disable_if:
|
||||||
|
condition: runtime
|
||||||
|
env_var: COIN_SKIP_DEBIAN
|
||||||
|
contains_value: "MISSING_DEBIAN_INST"
|
||||||
|
- type: ExecuteCommand
|
||||||
|
command: "git checkout {{.Env.DEBIAN_RULES_REF}}"
|
||||||
|
maxTimeInSeconds: 900
|
||||||
|
maxTimeBetweenOutput: 900
|
||||||
|
userMessageOnFailure: "Failed to checkout debian rules branch"
|
||||||
|
disable_if:
|
||||||
|
condition: or
|
||||||
|
conditions:
|
||||||
|
- condition: runtime
|
||||||
|
env_var: DEBIAN_RULES_REF
|
||||||
|
equals_value: null
|
||||||
|
- condition: runtime
|
||||||
|
env_var: COIN_SKIP_DEBIAN
|
||||||
|
contains_value: "MISSING_DEBIAN_INST"
|
||||||
|
- type: ChangeDirectory
|
||||||
|
directory: "{{.AgentWorkingDir}}"
|
||||||
- type: ExecuteCommand
|
- type: ExecuteCommand
|
||||||
command: "wget -q {{.CoinDownloadURL}}/{{.Env.MODULE_SOURCES_RELATIVE_STORAGE_PATH}}"
|
command: "wget -q {{.CoinDownloadURL}}/{{.Env.MODULE_SOURCES_RELATIVE_STORAGE_PATH}}"
|
||||||
maxTimeInSeconds: 900
|
maxTimeInSeconds: 900
|
||||||
@ -81,15 +103,16 @@ instructions:
|
|||||||
contains_value: "MISSING_DEBIAN_INST"
|
contains_value: "MISSING_DEBIAN_INST"
|
||||||
- type: ExecuteCommand
|
- type: ExecuteCommand
|
||||||
command: ["sbuild",
|
command: ["sbuild",
|
||||||
"--build-dep-resolver=aptitude",
|
"--build-dep-resolver=apt",
|
||||||
"-sAd", "tqtc-focal",
|
"-sAd", "tqtc-focal",
|
||||||
"-c", "{{.Env.COIN_SBUILD_CHROOT}}",
|
"-c", "{{.Env.COIN_SBUILD_CHROOT}}",
|
||||||
"--build-dir", "output/debian_packages",
|
"--build-dir", "output/debian_packages",
|
||||||
|
"--extra-repository={{.Env.COIN_EXTRA_DEBIAN_REPO}}",
|
||||||
|
"--extra-package={{.Env.COIN_EXTRA_DEBIAN_PACKAGES}}",
|
||||||
"--extra-package={{.AgentWorkingDir}}/debian_packages/",
|
"--extra-package={{.AgentWorkingDir}}/debian_packages/",
|
||||||
"--extra-package={{.AgentWorkingDir}}/output/debian_packages/",
|
|
||||||
"qt-{{.Env.QT_REPO_MODULE_VERSION}}-{{.Env.TESTED_MODULE_PLAIN_COIN}}-src_{{.Env.QT_REPO_MODULE_VERSION}}-1.dsc"]
|
"qt-{{.Env.QT_REPO_MODULE_VERSION}}-{{.Env.TESTED_MODULE_PLAIN_COIN}}-src_{{.Env.QT_REPO_MODULE_VERSION}}-1.dsc"]
|
||||||
maxTimeInSeconds: 18000
|
maxTimeInSeconds: 18000
|
||||||
maxTimeBetweenOutput: 1800
|
maxTimeBetweenOutput: 18000
|
||||||
userMessageOnFailure: "Failed build debian packages"
|
userMessageOnFailure: "Failed build debian packages"
|
||||||
disable_if:
|
disable_if:
|
||||||
condition: runtime
|
condition: runtime
|
||||||
|
@ -8,16 +8,26 @@ instructions:
|
|||||||
variableName: COIN_SBUILD_CHROOT
|
variableName: COIN_SBUILD_CHROOT
|
||||||
variableValue: "stable-arm64-sbuild"
|
variableValue: "stable-arm64-sbuild"
|
||||||
enable_if:
|
enable_if:
|
||||||
condition: property
|
condition: and
|
||||||
property: target.arch
|
conditions:
|
||||||
equals_value: AARCH64
|
- condition: runtime
|
||||||
|
env_var: COIN_SBUILD_CHROOT
|
||||||
|
equals_value: null
|
||||||
|
- condition: property
|
||||||
|
property: target.arch
|
||||||
|
equals_value: AARCH64
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: COIN_SBUILD_CHROOT
|
variableName: COIN_SBUILD_CHROOT
|
||||||
variableValue: "stable-amd64-sbuild"
|
variableValue: "stable-amd64-sbuild"
|
||||||
disable_if:
|
enable_if:
|
||||||
condition: property
|
condition: and
|
||||||
property: target.arch
|
conditions:
|
||||||
equals_value: AARCH64
|
- condition: runtime
|
||||||
|
env_var: COIN_SBUILD_CHROOT
|
||||||
|
equals_value: null
|
||||||
|
- condition: property
|
||||||
|
property: target.arch
|
||||||
|
equals_value: X86_64
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: COIN_SBUILD_DISTRO
|
variableName: COIN_SBUILD_DISTRO
|
||||||
variableValue: "arm64-focal"
|
variableValue: "arm64-focal"
|
||||||
@ -39,36 +49,9 @@ instructions:
|
|||||||
enable_if:
|
enable_if:
|
||||||
condition: or
|
condition: or
|
||||||
conditions:
|
conditions:
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qtquick3dphysics"
|
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qtquickeffectmaker"
|
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qtspeech"
|
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qtlocation"
|
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qthttpserver"
|
|
||||||
- condition: runtime
|
- condition: runtime
|
||||||
env_var: TESTED_MODULE_COIN
|
env_var: TESTED_MODULE_COIN
|
||||||
equals_value: "qtactiveqt"
|
equals_value: "qtactiveqt"
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qtcoap"
|
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qtmqtt"
|
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qtopcua"
|
|
||||||
- condition: runtime
|
|
||||||
env_var: TESTED_MODULE_COIN
|
|
||||||
equals_value: "qtgrpc"
|
|
||||||
- condition: runtime
|
- condition: runtime
|
||||||
env_var: TESTED_MODULE_COIN
|
env_var: TESTED_MODULE_COIN
|
||||||
equals_value: "qtqa"
|
equals_value: "qtqa"
|
||||||
|
@ -305,6 +305,14 @@ instructions:
|
|||||||
condition: property
|
condition: property
|
||||||
property: target.osVersion
|
property: target.osVersion
|
||||||
in_values: [QEMU]
|
in_values: [QEMU]
|
||||||
|
# This fixes an issue where binfmts is sometimes disabled on the test VMs
|
||||||
|
- type: ExecuteCommand
|
||||||
|
command: sudo update-binfmts --enable
|
||||||
|
userMessageOnFailure: "Failed to enable binfmts"
|
||||||
|
enable_if:
|
||||||
|
condition: property
|
||||||
|
property: target.osVersion
|
||||||
|
equals_value: QEMU
|
||||||
|
|
||||||
# Windows on Arm, cross-compilation with MSVC
|
# Windows on Arm, cross-compilation with MSVC
|
||||||
- type: Group
|
- type: Group
|
||||||
|
300
conanfile.py
300
conanfile.py
@ -1,300 +0,0 @@
|
|||||||
# Copyright (C) 2021 The Qt Company Ltd.
|
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
from conans import ConanFile, tools
|
|
||||||
from conans.errors import ConanInvalidConfiguration
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import shutil
|
|
||||||
from functools import lru_cache
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Dict, Union
|
|
||||||
|
|
||||||
|
|
||||||
class QtConanError(Exception):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def add_cmake_prefix_path(conan_file: ConanFile, dep: str) -> None:
|
|
||||||
if dep not in conan_file.deps_cpp_info.deps:
|
|
||||||
raise QtConanError("Unable to find dependency: {0}".format(dep))
|
|
||||||
dep_cpp_info = conan_file.deps_cpp_info[dep]
|
|
||||||
cmake_args_str = str(conan_file.options.get_safe("cmake_args_qtbase", default=""))
|
|
||||||
formatted_cmake_args_str = conan_file._shared.append_cmake_arg(
|
|
||||||
cmake_args_str, "CMAKE_PREFIX_PATH", dep_cpp_info.rootpath
|
|
||||||
)
|
|
||||||
print("Adjusted cmake args for qtbase build: {0}".format(formatted_cmake_args_str))
|
|
||||||
setattr(conan_file.options, "cmake_args_qtbase", formatted_cmake_args_str)
|
|
||||||
|
|
||||||
|
|
||||||
def _build_qtbase(conan_file: ConanFile):
|
|
||||||
# we call the Qt's configure(.bat) directly
|
|
||||||
script = Path("configure.bat") if tools.os_info.is_windows else Path("configure")
|
|
||||||
configure = Path(conan_file.build_folder).joinpath(script).resolve(strict=True)
|
|
||||||
|
|
||||||
if conan_file.options.get_safe("icu", default=False):
|
|
||||||
# we need to tell Qt build system where to find the ICU
|
|
||||||
add_cmake_prefix_path(conan_file, dep="icu")
|
|
||||||
|
|
||||||
# convert the Conan options to Qt configure(.bat) arguments
|
|
||||||
parser = conan_file._qt_option_parser
|
|
||||||
qt_configure_options = parser.convert_conan_options_to_qt_options(conan_file.options)
|
|
||||||
cmd = " ".join(
|
|
||||||
[str(configure), " ".join(qt_configure_options), "-prefix", conan_file.package_folder]
|
|
||||||
)
|
|
||||||
cmake_args = parser.get_cmake_args_for_configure(conan_file.options)
|
|
||||||
if cmake_args:
|
|
||||||
cmd += " -- {0}".format(" ".join(cmake_args))
|
|
||||||
conan_file.output.info("Calling: {0}".format(cmd))
|
|
||||||
conan_file.run(cmd)
|
|
||||||
|
|
||||||
cmd = " ".join(["cmake", "--build", ".", "--parallel"])
|
|
||||||
conan_file.output.info("Calling: {0}".format(cmd))
|
|
||||||
conan_file.run(cmd)
|
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=8)
|
|
||||||
def _parse_qt_version_by_key(key: str) -> str:
|
|
||||||
with open(Path(__file__).parent.resolve() / ".cmake.conf") as f:
|
|
||||||
m = re.search(fr'{key} .*"(.*)"', f.read())
|
|
||||||
return m.group(1) if m else ""
|
|
||||||
|
|
||||||
|
|
||||||
def _get_qt_minor_version() -> str:
|
|
||||||
return ".".join(_parse_qt_version_by_key("QT_REPO_MODULE_VERSION").split(".")[:2])
|
|
||||||
|
|
||||||
|
|
||||||
class QtBase(ConanFile):
|
|
||||||
name = "qtbase"
|
|
||||||
license = "LGPL-3.0, GPL-2.0+, Commercial Qt License Agreement"
|
|
||||||
author = "The Qt Company <https://www.qt.io/contact-us>"
|
|
||||||
url = "https://code.qt.io/cgit/qt/qtbase.git"
|
|
||||||
description = "Qt6 core framework libraries and tools."
|
|
||||||
topics = ("qt", "qt6")
|
|
||||||
settings = "os", "compiler", "arch", "build_type"
|
|
||||||
_qt_option_parser = None
|
|
||||||
options = None
|
|
||||||
default_options = None
|
|
||||||
exports_sources = "*", "!conan*.*"
|
|
||||||
# use commit ID as the RREV (recipe revision)
|
|
||||||
revision_mode = "scm"
|
|
||||||
python_requires = "qt-conan-common/{0}@qt/everywhere".format(_get_qt_minor_version())
|
|
||||||
short_paths = True
|
|
||||||
_shared = None
|
|
||||||
|
|
||||||
def init(self):
|
|
||||||
self._shared = self.python_requires["qt-conan-common"].module
|
|
||||||
self._qt_option_parser = self._shared.QtOptionParser(Path(__file__).parent.resolve())
|
|
||||||
self.options = self._qt_option_parser.get_qt_conan_options()
|
|
||||||
self.default_options = self._qt_option_parser.get_default_qt_conan_options()
|
|
||||||
|
|
||||||
def set_version(self):
|
|
||||||
# Executed during "conan export" i.e. in source tree
|
|
||||||
_ver = _parse_qt_version_by_key("QT_REPO_MODULE_VERSION")
|
|
||||||
_prerelease = _parse_qt_version_by_key("QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT")
|
|
||||||
self.version = _ver + "-" + _prerelease if _prerelease else _ver
|
|
||||||
|
|
||||||
def export(self):
|
|
||||||
self.copy("configure_options.json")
|
|
||||||
self.copy("configure_features.txt")
|
|
||||||
self.copy(".cmake.conf")
|
|
||||||
conf = self._shared.qt_sw_versions_config_folder() / self._shared.qt_sw_versions_config_name()
|
|
||||||
if not conf.exists():
|
|
||||||
# If using "conan export" outside Qt CI provisioned machines
|
|
||||||
print("Warning: Couldn't find '{0}'. 3rd party dependencies skipped.".format(conf))
|
|
||||||
else:
|
|
||||||
shutil.copy2(conf, self.export_folder)
|
|
||||||
|
|
||||||
def requirements(self):
|
|
||||||
# list of tuples, (package_name, fallback version)
|
|
||||||
optional_requirements = [("icu", "56.1")]
|
|
||||||
for req_name, req_ver_fallback in optional_requirements:
|
|
||||||
if self.options.get_safe(req_name, default=False) == True:
|
|
||||||
# Note! If this conan package is being "conan export"ed outside Qt CI and the
|
|
||||||
# sw versions .ini file is not present then it will fall-back to default version
|
|
||||||
ver = self._shared.parse_qt_sw_pkg_dependency(
|
|
||||||
config_folder=Path(self.recipe_folder),
|
|
||||||
package_name=req_name,
|
|
||||||
target_os=str(self.settings.os),
|
|
||||||
)
|
|
||||||
if not ver:
|
|
||||||
print(
|
|
||||||
"Warning: Using fallback version '{0}' for: {1}".format(
|
|
||||||
req_name, req_ver_fallback
|
|
||||||
)
|
|
||||||
)
|
|
||||||
ver = req_ver_fallback
|
|
||||||
requirement = "{0}/{1}@qt/everywhere".format(req_name, ver)
|
|
||||||
print("Setting 3rd party package requirement: {0}".format(requirement))
|
|
||||||
self.requires(requirement)
|
|
||||||
|
|
||||||
def _resolve_qt_host_path(self) -> Union[str, None]:
|
|
||||||
"""
|
|
||||||
Attempt to resolve QT_HOST_PATH.
|
|
||||||
|
|
||||||
When cross-building the user needs to pass 'qt_host_path' which is transformed to
|
|
||||||
QT_HOST_PATH later on. Resolve the exact path if possible.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
string: The resolved QT_HOST_PATH or None if unable to determine it.
|
|
||||||
"""
|
|
||||||
_host_p = self.options.get_safe("qt_host_path")
|
|
||||||
if _host_p:
|
|
||||||
return str(Path(os.path.expandvars(str(_host_p))).expanduser().resolve(strict=True))
|
|
||||||
else:
|
|
||||||
print("Warning: 'qt_host_path' option was not given in cross-build context")
|
|
||||||
return None
|
|
||||||
|
|
||||||
def configure(self):
|
|
||||||
if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "8":
|
|
||||||
raise ConanInvalidConfiguration("Qt6 does not support GCC before 8")
|
|
||||||
|
|
||||||
def _set_default_if_not_set(option_name: str, option_value: bool) -> None:
|
|
||||||
# let it fail if option name does not exist, it means the recipe is not up to date
|
|
||||||
if self.options.get_safe(option_name) in [None, "None"]:
|
|
||||||
setattr(self.options, option_name, option_value)
|
|
||||||
|
|
||||||
def _set_build_type(build_type: str) -> None:
|
|
||||||
if self.settings.build_type != build_type:
|
|
||||||
msg = (
|
|
||||||
"The build_type '{0}' changed to '{1}'. Please check your Settings and "
|
|
||||||
"Options. The used Qt options enforce '{2}' as a build_type. ".format(
|
|
||||||
self.settings.build_type, build_type, build_type
|
|
||||||
)
|
|
||||||
)
|
|
||||||
raise QtConanError(msg)
|
|
||||||
self.settings.build_type = build_type
|
|
||||||
|
|
||||||
def _check_mutually_exclusive_options(options: Dict[str, bool]) -> None:
|
|
||||||
if list(options.values()).count(True) > 1:
|
|
||||||
raise QtConanError(
|
|
||||||
"These Qt options are mutually exclusive: {0}"
|
|
||||||
". Choose only one of them and try again.".format(list(options.keys()))
|
|
||||||
)
|
|
||||||
|
|
||||||
default_options = ["shared", "gui", "widgets", "accessibility", "system_proxies", "ico"]
|
|
||||||
|
|
||||||
if self.settings.os == "Macos":
|
|
||||||
default_options.append("framework")
|
|
||||||
|
|
||||||
for item in default_options:
|
|
||||||
_set_default_if_not_set(item, True)
|
|
||||||
|
|
||||||
release = self.options.get_safe("release", default=False)
|
|
||||||
debug = self.options.get_safe("debug", default=False)
|
|
||||||
debug_and_release = self.options.get_safe("debug_and_release", default=False)
|
|
||||||
force_debug_info = self.options.get_safe("force_debug_info", default=False)
|
|
||||||
optimize_size = self.options.get_safe("optimize_size", default=False)
|
|
||||||
|
|
||||||
# these options are mutually exclusive options so do a sanity check
|
|
||||||
_check_mutually_exclusive_options(
|
|
||||||
{"release": release, "debug": debug, "debug_and_release": debug_and_release}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Prioritize Qt's configure options over Settings.build_type
|
|
||||||
if debug_and_release == True:
|
|
||||||
# Qt build system will build both debug and release binaries
|
|
||||||
if force_debug_info == True:
|
|
||||||
_set_build_type("RelWithDebInfo")
|
|
||||||
else:
|
|
||||||
_set_build_type("Release")
|
|
||||||
elif release == True:
|
|
||||||
_check_mutually_exclusive_options(
|
|
||||||
{"force_debug_info": force_debug_info, "optimize_size": optimize_size}
|
|
||||||
)
|
|
||||||
if force_debug_info == True:
|
|
||||||
_set_build_type("RelWithDebInfo")
|
|
||||||
elif optimize_size == True:
|
|
||||||
_set_build_type("MinSizeRel")
|
|
||||||
else:
|
|
||||||
_set_build_type("Release")
|
|
||||||
elif debug == True:
|
|
||||||
_set_build_type("Debug")
|
|
||||||
else:
|
|
||||||
# As a fallback set the build type for Qt configure based on the 'build_type'
|
|
||||||
# defined in the conan build settings
|
|
||||||
build_type = self.settings.get_safe("build_type")
|
|
||||||
if build_type in [None, "None"]:
|
|
||||||
# set default that mirror the configure(.bat) default values
|
|
||||||
self.options.release = True
|
|
||||||
self.settings.build_type = "Release"
|
|
||||||
elif build_type == "Release":
|
|
||||||
self.options.release = True
|
|
||||||
elif build_type == "Debug":
|
|
||||||
self.options.debug = True
|
|
||||||
elif build_type == "RelWithDebInfo":
|
|
||||||
self.options.release = True
|
|
||||||
self.options.force_debug_info = True
|
|
||||||
elif build_type == "MinSizeRel":
|
|
||||||
self.options.release = True
|
|
||||||
self.options.optimize_size = True
|
|
||||||
else:
|
|
||||||
raise QtConanError("Unknown build_type: {0}".format(self.settings.build_type))
|
|
||||||
|
|
||||||
if self.settings.os == "Android":
|
|
||||||
if self.options.get_safe("android_sdk_version") == None:
|
|
||||||
cmake_args_qtbase = str(self.options.get_safe("cmake_args_qtbase"))
|
|
||||||
sdk_ver = self._shared.parse_android_sdk_version(cmake_args_qtbase)
|
|
||||||
if sdk_ver:
|
|
||||||
print("'android_sdk_version' not given. Deduced version: {0}".format(sdk_ver))
|
|
||||||
self.options.android_sdk_version = sdk_ver
|
|
||||||
else:
|
|
||||||
# TODO, for now we have no clean means to query the Android SDK version from
|
|
||||||
# Qt build system so we just exclude the "android_sdk" from the package_id.
|
|
||||||
print("Can't deduce 'android_sdk_version'. Excluding it from 'package_id'")
|
|
||||||
delattr(self.info.options, "android_sdk_version")
|
|
||||||
if self.options.get_safe("android_ndk_version") == None:
|
|
||||||
ndk_ver = str(self.options.get_safe("android_ndk"))
|
|
||||||
ndk_ver = self._shared.parse_android_ndk_version(Path(ndk_ver, strict=True))
|
|
||||||
print("'android_ndk_version' not given. Deduced version: {0}".format(ndk_ver))
|
|
||||||
self.options.android_ndk_version = ndk_ver
|
|
||||||
|
|
||||||
def build(self):
|
|
||||||
self._shared.build_env_wrap(self, _build_qtbase)
|
|
||||||
|
|
||||||
def package(self):
|
|
||||||
self._shared.call_install(self)
|
|
||||||
|
|
||||||
def package_info(self):
|
|
||||||
self._shared.package_info(self)
|
|
||||||
if tools.cross_building(conanfile=self):
|
|
||||||
qt_host_path = self._resolve_qt_host_path()
|
|
||||||
if qt_host_path:
|
|
||||||
self.env_info.QT_HOST_PATH.append(qt_host_path)
|
|
||||||
|
|
||||||
def package_id(self):
|
|
||||||
# https://docs.conan.io/en/latest/creating_packages/define_abi_compatibility.html
|
|
||||||
|
|
||||||
# The package_revision_mode() is too strict for Qt CI. This mode includes artifacts
|
|
||||||
# checksum in package_id which is problematic in Qt CI re-runs (re-run flaky
|
|
||||||
# build) which contain different build timestamps (cmake) which end up in library
|
|
||||||
# files -> different package_id.
|
|
||||||
self.info.requires.recipe_revision_mode()
|
|
||||||
|
|
||||||
# Enable 'qt-conan-common' updates on client side with $conan install .. --update
|
|
||||||
self.info.python_requires.recipe_revision_mode()
|
|
||||||
|
|
||||||
# Remove those configure(.bat) options which should not affect package_id.
|
|
||||||
# These point to local file system paths and in order to re-use pre-built
|
|
||||||
# binaries (by Qt CI) by others these should not affect the 'package_id'
|
|
||||||
# as those probably differ on each machine
|
|
||||||
rm_list = [
|
|
||||||
"sdk",
|
|
||||||
"qpa",
|
|
||||||
"translationsdir",
|
|
||||||
"headersclean",
|
|
||||||
"qt_host_path",
|
|
||||||
"android_sdk",
|
|
||||||
"android_ndk",
|
|
||||||
]
|
|
||||||
for item in rm_list:
|
|
||||||
if item in self.info.options:
|
|
||||||
delattr(self.info.options, item)
|
|
||||||
# filter also those cmake options that should not end up in the package_id
|
|
||||||
if hasattr(self.info.options, "cmake_args_qtbase"):
|
|
||||||
_filter = self._shared.filter_cmake_args_for_package_id
|
|
||||||
self.info.options.cmake_args_qtbase = _filter(self.info.options.cmake_args_qtbase)
|
|
||||||
|
|
||||||
def deploy(self):
|
|
||||||
self.copy("*") # copy from current package
|
|
||||||
self.copy_deps("*") # copy from dependencies
|
|
@ -64,10 +64,13 @@ Build options:
|
|||||||
-cmake-file-api ...... Let CMake store build metadata for loading the build
|
-cmake-file-api ...... Let CMake store build metadata for loading the build
|
||||||
into an IDE. [no; yes if -developer-build]
|
into an IDE. [no; yes if -developer-build]
|
||||||
-no-guess-compiler ... Do not guess the compiler from the target mkspec.
|
-no-guess-compiler ... Do not guess the compiler from the target mkspec.
|
||||||
-release ............. Build Qt with debugging turned off [yes]
|
-release ............. Build Qt with optimizations and without debug
|
||||||
-debug ............... Build Qt with debugging turned on [no]
|
symbols [yes]
|
||||||
-debug-and-release ... Build two versions of Qt, with and without
|
Note that -developer-build implies -debug unless
|
||||||
debugging turned on [yes] (Apple and Windows only)
|
-release is also explicitly specified
|
||||||
|
-debug ............... Build Qt without optimizations and with debug symbols
|
||||||
|
[no]
|
||||||
|
-debug-and-release ... Build two versions of Qt in one build tree [no]
|
||||||
-optimize-debug ...... Enable debug-friendly optimizations in debug builds
|
-optimize-debug ...... Enable debug-friendly optimizations in debug builds
|
||||||
[auto] (Not supported with MSVC or Clang toolchains)
|
[auto] (Not supported with MSVC or Clang toolchains)
|
||||||
-optimize-size ....... Optimize release builds for size instead of speed [no]
|
-optimize-size ....... Optimize release builds for size instead of speed [no]
|
||||||
@ -80,7 +83,8 @@ Build options:
|
|||||||
sections. [auto for static builds, otherwise no]
|
sections. [auto for static builds, otherwise no]
|
||||||
-force-asserts ....... Enable Q_ASSERT even in release builds [no]
|
-force-asserts ....... Enable Q_ASSERT even in release builds [no]
|
||||||
-developer-build ..... Compile and link Qt for developing Qt itself
|
-developer-build ..... Compile and link Qt for developing Qt itself
|
||||||
(exports for auto-tests, extra checks, etc.) [no]
|
(exports for auto-tests, extra checks, implies
|
||||||
|
-no-prefix, etc.) [no]
|
||||||
|
|
||||||
-shared .............. Build shared Qt libraries [yes] (no for UIKit)
|
-shared .............. Build shared Qt libraries [yes] (no for UIKit)
|
||||||
-static .............. Build static Qt libraries [no] (yes for UIKit)
|
-static .............. Build static Qt libraries [no] (yes for UIKit)
|
||||||
@ -159,6 +163,8 @@ Build environment:
|
|||||||
|
|
||||||
-pkg-config .......... Use pkg-config [auto] (Unix only)
|
-pkg-config .......... Use pkg-config [auto] (Unix only)
|
||||||
|
|
||||||
|
-vcpkg ............... Use vcpkg [yes]
|
||||||
|
|
||||||
-D <string> .......... Pass additional preprocessor define
|
-D <string> .......... Pass additional preprocessor define
|
||||||
-I <string> .......... Pass additional include path
|
-I <string> .......... Pass additional include path
|
||||||
-L <string> .......... Pass additional library path
|
-L <string> .......... Pass additional library path
|
||||||
@ -196,6 +202,9 @@ Component selection:
|
|||||||
[default: libs and examples, also tools if not
|
[default: libs and examples, also tools if not
|
||||||
cross-building, also tests if -developer-build]
|
cross-building, also tests if -developer-build]
|
||||||
-nomake <part> ....... Exclude <part> from the list of parts to be built.
|
-nomake <part> ....... Exclude <part> from the list of parts to be built.
|
||||||
|
-install-examples-sources Installs examples source code into the Qt prefix
|
||||||
|
Only possible when -make examples is also passed
|
||||||
|
[no]
|
||||||
-gui ................. Build the Qt GUI module and dependencies [yes]
|
-gui ................. Build the Qt GUI module and dependencies [yes]
|
||||||
-widgets ............. Build the Qt Widgets module and dependencies [yes]
|
-widgets ............. Build the Qt Widgets module and dependencies [yes]
|
||||||
-no-dbus ............. Do not build the Qt D-Bus module
|
-no-dbus ............. Do not build the Qt D-Bus module
|
||||||
|
@ -22,6 +22,7 @@ qt_find_package(WrapOpenSSLHeaders PROVIDED_TARGETS WrapOpenSSLHeaders::WrapOpen
|
|||||||
# openssl_headers
|
# openssl_headers
|
||||||
# OPENSSL_VERSION_MAJOR is not defined for OpenSSL 1.1.1
|
# OPENSSL_VERSION_MAJOR is not defined for OpenSSL 1.1.1
|
||||||
qt_config_compile_test(opensslv11_headers
|
qt_config_compile_test(opensslv11_headers
|
||||||
|
LABEL "opensslv11_headers"
|
||||||
LIBRARIES
|
LIBRARIES
|
||||||
WrapOpenSSLHeaders::WrapOpenSSLHeaders
|
WrapOpenSSLHeaders::WrapOpenSSLHeaders
|
||||||
CODE
|
CODE
|
||||||
@ -46,6 +47,7 @@ qt_find_package(WrapOpenSSL PROVIDED_TARGETS WrapOpenSSL::WrapOpenSSL MODULE_NAM
|
|||||||
# openssl
|
# openssl
|
||||||
# OPENSSL_VERSION_MAJOR is not defined for OpenSSL 1.1.1
|
# OPENSSL_VERSION_MAJOR is not defined for OpenSSL 1.1.1
|
||||||
qt_config_compile_test(opensslv11
|
qt_config_compile_test(opensslv11
|
||||||
|
LABEL "opensslv11"
|
||||||
LIBRARIES
|
LIBRARIES
|
||||||
WrapOpenSSL::WrapOpenSSL
|
WrapOpenSSL::WrapOpenSSL
|
||||||
CODE
|
CODE
|
||||||
@ -70,6 +72,7 @@ SSL_free(SSL_new(0));
|
|||||||
# opensslv30
|
# opensslv30
|
||||||
# openssl_headers
|
# openssl_headers
|
||||||
qt_config_compile_test(opensslv30_headers
|
qt_config_compile_test(opensslv30_headers
|
||||||
|
LABEL "opensslv30_headers"
|
||||||
LIBRARIES
|
LIBRARIES
|
||||||
WrapOpenSSLHeaders::WrapOpenSSLHeaders
|
WrapOpenSSLHeaders::WrapOpenSSLHeaders
|
||||||
CODE
|
CODE
|
||||||
@ -87,6 +90,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
")
|
")
|
||||||
qt_config_compile_test(opensslv30
|
qt_config_compile_test(opensslv30
|
||||||
|
LABEL "opensslv30"
|
||||||
LIBRARIES
|
LIBRARIES
|
||||||
WrapOpenSSL::WrapOpenSSL
|
WrapOpenSSL::WrapOpenSSL
|
||||||
CODE
|
CODE
|
||||||
@ -285,11 +289,13 @@ int main(void)
|
|||||||
"# FIXME: qmake: ['TEMPLATE = lib', 'CONFIG += dll bsymbolic_functions', 'isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope")']
|
"# FIXME: qmake: ['TEMPLATE = lib', 'CONFIG += dll bsymbolic_functions', 'isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope")']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(NOT MSVC AND NOT APPLE)
|
||||||
|
qt_config_compile_test("separate_debug_info"
|
||||||
|
LABEL "separate debug information support"
|
||||||
|
PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/separate_debug_info"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
qt_config_compile_test("separate_debug_info"
|
|
||||||
LABEL "separate debug information support"
|
|
||||||
PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/separate_debug_info"
|
|
||||||
)
|
|
||||||
# signaling_nan
|
# signaling_nan
|
||||||
qt_config_compile_test(signaling_nan
|
qt_config_compile_test(signaling_nan
|
||||||
LABEL "Signaling NaN for doubles"
|
LABEL "Signaling NaN for doubles"
|
||||||
@ -487,7 +493,7 @@ qt_feature("developer-build" PRIVATE
|
|||||||
LABEL "Developer build"
|
LABEL "Developer build"
|
||||||
AUTODETECT OFF
|
AUTODETECT OFF
|
||||||
)
|
)
|
||||||
qt_feature("no-prefix" PRIVATE
|
qt_feature("no-prefix"
|
||||||
LABEL "No prefix build"
|
LABEL "No prefix build"
|
||||||
AUTODETECT NOT QT_WILL_INSTALL
|
AUTODETECT NOT QT_WILL_INSTALL
|
||||||
CONDITION NOT QT_WILL_INSTALL
|
CONDITION NOT QT_WILL_INSTALL
|
||||||
@ -519,7 +525,7 @@ qt_feature_config("force_debug_info" QMAKE_PRIVATE_CONFIG)
|
|||||||
qt_feature("separate_debug_info" PUBLIC
|
qt_feature("separate_debug_info" PUBLIC
|
||||||
LABEL "Split off debug information"
|
LABEL "Split off debug information"
|
||||||
AUTODETECT OFF
|
AUTODETECT OFF
|
||||||
CONDITION ( QT_FEATURE_shared ) AND ( QT_FEATURE_debug OR QT_FEATURE_debug_and_release OR QT_FEATURE_force_debug_info ) AND ( APPLE OR TEST_separate_debug_info )
|
CONDITION ( QT_FEATURE_shared ) AND ( QT_FEATURE_debug OR QT_FEATURE_debug_and_release OR QT_FEATURE_force_debug_info ) AND ( MSVC OR APPLE OR TEST_separate_debug_info )
|
||||||
)
|
)
|
||||||
qt_feature_config("separate_debug_info" QMAKE_PUBLIC_QT_CONFIG)
|
qt_feature_config("separate_debug_info" QMAKE_PUBLIC_QT_CONFIG)
|
||||||
qt_feature("appstore-compliant" PUBLIC
|
qt_feature("appstore-compliant" PUBLIC
|
||||||
@ -1067,6 +1073,18 @@ qt_configure_add_summary_entry(
|
|||||||
ARGS "ccache"
|
ARGS "ccache"
|
||||||
CONDITION UNIX
|
CONDITION UNIX
|
||||||
)
|
)
|
||||||
|
qt_configure_add_summary_entry(
|
||||||
|
TYPE "message" ARGS "Unity Build" MESSAGE "yes" CONDITION QT_UNITY_BUILD
|
||||||
|
)
|
||||||
|
qt_configure_add_summary_entry(
|
||||||
|
TYPE "message" ARGS "Unity Build" MESSAGE "no" CONDITION NOT QT_UNITY_BUILD
|
||||||
|
)
|
||||||
|
qt_configure_add_summary_entry(
|
||||||
|
TYPE "message"
|
||||||
|
ARGS "Unity Build Batch Size"
|
||||||
|
MESSAGE "${QT_UNITY_BUILD_BATCH_SIZE}"
|
||||||
|
CONDITION QT_UNITY_BUILD
|
||||||
|
)
|
||||||
qt_configure_add_summary_entry(
|
qt_configure_add_summary_entry(
|
||||||
TYPE "firstAvailableFeature"
|
TYPE "firstAvailableFeature"
|
||||||
ARGS "use_bfd_linker use_gold_linker use_lld_linker use_mold_linker"
|
ARGS "use_bfd_linker use_gold_linker use_lld_linker use_mold_linker"
|
||||||
@ -1124,6 +1142,13 @@ qt_configure_add_summary_entry(ARGS "sanitize_fuzzer_no_link")
|
|||||||
qt_configure_add_summary_entry(ARGS "sanitize_undefined")
|
qt_configure_add_summary_entry(ARGS "sanitize_undefined")
|
||||||
qt_configure_end_summary_section() # end of "Sanitizers" section
|
qt_configure_end_summary_section() # end of "Sanitizers" section
|
||||||
qt_configure_add_summary_build_parts("Build parts")
|
qt_configure_add_summary_build_parts("Build parts")
|
||||||
|
if(QT_INSTALL_EXAMPLES_SOURCES)
|
||||||
|
set(_examples_sources_entry_message "yes")
|
||||||
|
else()
|
||||||
|
set(_examples_sources_entry_message "no")
|
||||||
|
endif()
|
||||||
|
qt_configure_add_summary_entry(ARGS "Install examples sources" TYPE "message"
|
||||||
|
MESSAGE "${_examples_sources_entry_message}")
|
||||||
qt_configure_add_summary_entry(
|
qt_configure_add_summary_entry(
|
||||||
ARGS "appstore-compliant"
|
ARGS "appstore-compliant"
|
||||||
CONDITION APPLE OR ANDROID OR WIN32
|
CONDITION APPLE OR ANDROID OR WIN32
|
||||||
@ -1143,6 +1168,14 @@ qt_configure_add_summary_entry(ARGS "xml")
|
|||||||
qt_configure_end_summary_section() # end of "Qt modules and options" section
|
qt_configure_end_summary_section() # end of "Qt modules and options" section
|
||||||
qt_configure_add_summary_section(NAME "Support enabled for")
|
qt_configure_add_summary_section(NAME "Support enabled for")
|
||||||
qt_configure_add_summary_entry(ARGS "pkg-config")
|
qt_configure_add_summary_entry(ARGS "pkg-config")
|
||||||
|
|
||||||
|
if(QT_USE_VCPKG AND (DEFINED ENV{VCPKG_ROOT} OR VCPKG_TARGET_TRIPLET))
|
||||||
|
set(_vcpkg_entry_message "yes")
|
||||||
|
else()
|
||||||
|
set(_vcpkg_entry_message "no")
|
||||||
|
endif()
|
||||||
|
qt_configure_add_summary_entry(ARGS "Using vcpkg" TYPE "message" MESSAGE "${_vcpkg_entry_message}")
|
||||||
|
|
||||||
qt_configure_add_summary_entry(ARGS "libudev")
|
qt_configure_add_summary_entry(ARGS "libudev")
|
||||||
qt_configure_add_summary_entry(ARGS "openssl")
|
qt_configure_add_summary_entry(ARGS "openssl")
|
||||||
qt_configure_add_summary_entry(ARGS "openssl-linked")
|
qt_configure_add_summary_entry(ARGS "openssl-linked")
|
||||||
@ -1237,3 +1270,11 @@ qt_extra_definition("QT_VERSION_PATCH" ${PROJECT_VERSION_PATCH} PUBLIC)
|
|||||||
|
|
||||||
qt_extra_definition("QT_COPYRIGHT" \"${QT_COPYRIGHT}\" PRIVATE)
|
qt_extra_definition("QT_COPYRIGHT" \"${QT_COPYRIGHT}\" PRIVATE)
|
||||||
qt_extra_definition("QT_COPYRIGHT_YEAR" \"${QT_COPYRIGHT_YEAR}\" PRIVATE)
|
qt_extra_definition("QT_COPYRIGHT_YEAR" \"${QT_COPYRIGHT_YEAR}\" PRIVATE)
|
||||||
|
|
||||||
|
qt_configure_add_report_entry(
|
||||||
|
TYPE WARNING
|
||||||
|
MESSAGE "QT_ALLOW_SYMLINK_IN_PATHS is enabled. This is not recommended, and it may lead to unexpected issues.
|
||||||
|
E.g., When building QtWebEngine, enabling this option may result in build issues in certain platforms.
|
||||||
|
See https://bugreports.qt.io/browse/QTBUG-59769."
|
||||||
|
CONDITION QT_ALLOW_SYMLINK_IN_PATHS
|
||||||
|
)
|
||||||
|
@ -29,6 +29,5 @@ url = https://doc.qt.io/qt
|
|||||||
|
|
||||||
defines += qt6
|
defines += qt6
|
||||||
|
|
||||||
# Uncomment the following two lines to generate documentation marked as \internal
|
# Require Qt modules to define qhp.projects
|
||||||
# alias.internal = disable
|
qhp = true
|
||||||
# macro.internal.HTML = "<span style="color:red">[internal]</span>"
|
|
||||||
|
@ -56,6 +56,19 @@ macro.endqdoc.HTML = "*/"
|
|||||||
macro.borderedimage = "\\div {class=\"border\"} \\image \1\n\\enddiv"
|
macro.borderedimage = "\\div {class=\"border\"} \\image \1\n\\enddiv"
|
||||||
macro.examplecategory = "\\meta category {\1}\n\\ingroup category \1"
|
macro.examplecategory = "\\meta category {\1}\n\\ingroup category \1"
|
||||||
|
|
||||||
|
macro.QDS = "Qt Design Studio"
|
||||||
|
macro.QDV = "Qt Design Viewer"
|
||||||
|
macro.QB = "Qt Bridge"
|
||||||
|
macro.QBPS = "Qt Bridge for Adobe Photoshop"
|
||||||
|
macro.QBXD = "Qt Bridge for Adobe XD"
|
||||||
|
macro.QBSK = "Qt Bridge for Sketch"
|
||||||
|
macro.QBF = "Qt Bridge for Figma"
|
||||||
|
macro.QMCU = "Qt for MCUs"
|
||||||
|
macro.QUL = "Qt Quick Ultralite"
|
||||||
|
macro.QtAA = "Qt for Android Automotive"
|
||||||
|
macro.QOI = "Qt Online Installer"
|
||||||
|
macro.QMT = "Qt Maintenance Tool"
|
||||||
|
|
||||||
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
|
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
|
||||||
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
|
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
|
||||||
macro.endfloat.HTML = "</div>"
|
macro.endfloat.HTML = "</div>"
|
||||||
@ -111,3 +124,9 @@ macro.cmakepropertywebassemblyonly = "\\note This property is used only if targe
|
|||||||
|
|
||||||
macro.cmakepropertyiosonly = "\\note This property is used only if targeting iOS."
|
macro.cmakepropertyiosonly = "\\note This property is used only if targeting iOS."
|
||||||
macro.cmakevariableiosonly = "\\note This variable is used only if targeting iOS."
|
macro.cmakevariableiosonly = "\\note This variable is used only if targeting iOS."
|
||||||
|
|
||||||
|
macro.qtpolicydeprecatedbehavior = "\\note The \\c{OLD} behavior of a policy is deprecated, and may be removed in the future."
|
||||||
|
#Appends the tech preview link to the brief sentence and adds to tech_preview
|
||||||
|
#group.
|
||||||
|
#Must be placed directly under a \brief command
|
||||||
|
macro.techpreview = "(Technical preview)\n\n\\meta status {Technical preview}\n\\ingroup tech_preview\n"
|
||||||
|
@ -91,7 +91,6 @@ manifestmeta.android.names = "Qt3D/Qt 3D: Basic Shapes C++ Example" \
|
|||||||
"QtQuickControls/Qt Quick Controls - Flat Style" \
|
"QtQuickControls/Qt Quick Controls - Flat Style" \
|
||||||
"QtQuickControls/Qt Quick Controls - Gallery" \
|
"QtQuickControls/Qt Quick Controls - Gallery" \
|
||||||
"QtQuickControls/Qt Quick Controls - Imagine Style Example: Automotive" \
|
"QtQuickControls/Qt Quick Controls - Imagine Style Example: Automotive" \
|
||||||
"QtQuickControls/Qt Quick Controls - Imagine Style Example: Music Player" \
|
|
||||||
"QtQuickControls/Qt Quick Controls - Text Editor" \
|
"QtQuickControls/Qt Quick Controls - Text Editor" \
|
||||||
"QtQuickControls/Qt Quick Controls - Wearable Demo" \
|
"QtQuickControls/Qt Quick Controls - Wearable Demo" \
|
||||||
"QtQuickDialogs/*" \
|
"QtQuickDialogs/*" \
|
||||||
|
@ -5,7 +5,6 @@ qt_examples_build_begin(EXTERNAL_BUILD)
|
|||||||
|
|
||||||
add_subdirectory(corelib)
|
add_subdirectory(corelib)
|
||||||
add_subdirectory(embedded)
|
add_subdirectory(embedded)
|
||||||
add_subdirectory(qpa)
|
|
||||||
if(TARGET Qt6::DBus)
|
if(TARGET Qt6::DBus)
|
||||||
add_subdirectory(dbus)
|
add_subdirectory(dbus)
|
||||||
endif()
|
endif()
|
||||||
|
@ -6,9 +6,6 @@ add_subdirectory(mimetypes)
|
|||||||
add_subdirectory(serialization)
|
add_subdirectory(serialization)
|
||||||
add_subdirectory(tools)
|
add_subdirectory(tools)
|
||||||
add_subdirectory(platform)
|
add_subdirectory(platform)
|
||||||
if(QT_FEATURE_permissions)
|
|
||||||
add_subdirectory(permissions)
|
|
||||||
endif()
|
|
||||||
if(QT_FEATURE_thread)
|
if(QT_FEATURE_thread)
|
||||||
add_subdirectory(threads)
|
add_subdirectory(threads)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,2 +1,25 @@
|
|||||||
qt_internal_add_example(bindablesubscription)
|
# Copyright (C) 2022 The Qt Company Ltd.
|
||||||
qt_internal_add_example(subscription)
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
project(bindableproperties LANGUAGES CXX)
|
||||||
|
|
||||||
|
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
||||||
|
set(INSTALL_EXAMPLESDIR "examples")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/corelib/bindableproperties")
|
||||||
|
|
||||||
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
|
||||||
|
|
||||||
|
qt_standard_project_setup()
|
||||||
|
|
||||||
|
add_subdirectory(shared)
|
||||||
|
add_subdirectory(subscription)
|
||||||
|
add_subdirectory(bindablesubscription)
|
||||||
|
|
||||||
|
install(TARGETS subscription bindablesubscription
|
||||||
|
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
|
||||||
|
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
|
||||||
|
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
|
||||||
|
)
|
||||||
|
@ -1,50 +1,15 @@
|
|||||||
# Copyright (C) 2022 The Qt Company Ltd.
|
# Copyright (C) 2022 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.16)
|
|
||||||
project(bindablesubscription LANGUAGES CXX)
|
|
||||||
|
|
||||||
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
|
||||||
set(INSTALL_EXAMPLESDIR "examples")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/corelib/bindableproperties/bindablesubscription")
|
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
|
|
||||||
|
|
||||||
qt_standard_project_setup()
|
|
||||||
|
|
||||||
qt_add_executable(bindablesubscription
|
qt_add_executable(bindablesubscription
|
||||||
../shared/subscriptionwindow.cpp ../shared/subscriptionwindow.h ../shared/subscriptionwindow.ui
|
|
||||||
main.cpp
|
main.cpp
|
||||||
bindablesubscription.cpp bindablesubscription.h
|
bindablesubscription.cpp
|
||||||
bindableuser.cpp bindableuser.h
|
bindablesubscription.h
|
||||||
|
bindableuser.cpp
|
||||||
|
bindableuser.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(bindablesubscription PRIVATE
|
target_link_libraries(bindablesubscription PRIVATE
|
||||||
Qt6::Core
|
bindableproperties_shared
|
||||||
Qt6::Gui
|
|
||||||
Qt6::Widgets
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(countries_resource_files
|
|
||||||
"../shared/finland.png"
|
|
||||||
"../shared/germany.png"
|
|
||||||
"../shared/norway.png"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_add_resources(bindablesubscription "countries"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
BASE
|
|
||||||
"../shared"
|
|
||||||
FILES
|
|
||||||
${countries_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
install(TARGETS bindablesubscription
|
|
||||||
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
||||||
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
||||||
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
||||||
)
|
|
||||||
|
@ -38,8 +38,7 @@ double BindableSubscription::calculateDiscount() const
|
|||||||
case Yearly:
|
case Yearly:
|
||||||
return 0.6;
|
return 0.6;
|
||||||
}
|
}
|
||||||
Q_ASSERT(false);
|
Q_UNREACHABLE_RETURN(-1);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int BindableSubscription::basePrice() const
|
int BindableSubscription::basePrice() const
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
|
#include <QProperty>
|
||||||
|
#include <QString>
|
||||||
|
#include <QDateTimeEdit>
|
||||||
|
#include <QBindable>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -19,6 +23,8 @@ int main(int argc, char *argv[])
|
|||||||
BindableSubscription subscription(&user);
|
BindableSubscription subscription(&user);
|
||||||
|
|
||||||
SubscriptionWindow w;
|
SubscriptionWindow w;
|
||||||
|
// clazy:excludeall=lambda-in-connect
|
||||||
|
// when subscription is out of scope so is window
|
||||||
|
|
||||||
// Initialize subscription data
|
// Initialize subscription data
|
||||||
QRadioButton *monthly = w.findChild<QRadioButton *>("btnMonthly");
|
QRadioButton *monthly = w.findChild<QRadioButton *>("btnMonthly");
|
||||||
@ -49,9 +55,8 @@ int main(int argc, char *argv[])
|
|||||||
});
|
});
|
||||||
|
|
||||||
QSpinBox *ageSpinBox = w.findChild<QSpinBox *>("ageSpinBox");
|
QSpinBox *ageSpinBox = w.findChild<QSpinBox *>("ageSpinBox");
|
||||||
QObject::connect(ageSpinBox, &QSpinBox::valueChanged, [&](int value) {
|
QBindable<int> ageBindable(ageSpinBox, "value");
|
||||||
user.setAge(value);
|
user.bindableAge().setBinding([ageBindable](){ return ageBindable.value();});
|
||||||
});
|
|
||||||
|
|
||||||
QLabel *priceDisplay = w.findChild<QLabel *>("priceDisplay");
|
QLabel *priceDisplay = w.findChild<QLabel *>("priceDisplay");
|
||||||
|
|
||||||
|
23
examples/corelib/bindableproperties/shared/CMakeLists.txt
Normal file
23
examples/corelib/bindableproperties/shared/CMakeLists.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Copyright (C) 2023 The Qt Company Ltd.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
add_library(bindableproperties_shared STATIC
|
||||||
|
subscriptionwindow.cpp
|
||||||
|
subscriptionwindow.h
|
||||||
|
subscriptionwindow.ui
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(bindableproperties_shared PUBLIC
|
||||||
|
Qt6::Core
|
||||||
|
Qt6::Gui
|
||||||
|
Qt6::Widgets
|
||||||
|
)
|
||||||
|
|
||||||
|
qt_add_resources(bindableproperties_shared "countries"
|
||||||
|
PREFIX
|
||||||
|
"/"
|
||||||
|
FILES
|
||||||
|
"finland.png"
|
||||||
|
"germany.png"
|
||||||
|
"norway.png"
|
||||||
|
)
|
@ -1,50 +1,12 @@
|
|||||||
# Copyright (C) 2022 The Qt Company Ltd.
|
# Copyright (C) 2022 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.16)
|
|
||||||
project(subscription LANGUAGES CXX)
|
|
||||||
|
|
||||||
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
|
||||||
set(INSTALL_EXAMPLESDIR "examples")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/corelib/bindableproperties/subscription")
|
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
|
|
||||||
|
|
||||||
qt_standard_project_setup()
|
|
||||||
|
|
||||||
qt_add_executable(subscription
|
qt_add_executable(subscription
|
||||||
../shared/subscriptionwindow.cpp ../shared/subscriptionwindow.h ../shared/subscriptionwindow.ui
|
|
||||||
main.cpp
|
main.cpp
|
||||||
subscription.cpp subscription.h
|
subscription.cpp subscription.h
|
||||||
user.cpp user.h
|
user.cpp user.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(subscription PRIVATE
|
target_link_libraries(subscription PRIVATE
|
||||||
Qt6::Core
|
bindableproperties_shared
|
||||||
Qt6::Gui
|
|
||||||
Qt6::Widgets
|
|
||||||
)
|
|
||||||
|
|
||||||
# Resources:
|
|
||||||
set(countries_resource_files
|
|
||||||
"../shared/finland.png"
|
|
||||||
"../shared/germany.png"
|
|
||||||
"../shared/norway.png"
|
|
||||||
)
|
|
||||||
|
|
||||||
qt_add_resources(subscription "countries"
|
|
||||||
PREFIX
|
|
||||||
"/"
|
|
||||||
BASE
|
|
||||||
"../shared"
|
|
||||||
FILES
|
|
||||||
${countries_resource_files}
|
|
||||||
)
|
|
||||||
|
|
||||||
install(TARGETS subscription
|
|
||||||
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
||||||
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
||||||
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
||||||
)
|
)
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
\example platform/androidnotifier
|
\example platform/androidnotifier
|
||||||
\examplecategory {Mobile}
|
\examplecategory {Mobile}
|
||||||
\brief Demonstrates calling Java code from Qt in an Android application.
|
\brief Demonstrates calling Java code from Qt in an Android application.
|
||||||
|
\ingroup androidplatform
|
||||||
|
|
||||||
\image androidnotifier.png
|
\image androidnotifier.png
|
||||||
|
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
# Copyright (C) 2022 The Qt Company Ltd.
|
# Copyright (C) 2022 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
qt_internal_add_example(cbordump)
|
if(NOT ANDROID)
|
||||||
qt_internal_add_example(convert)
|
qt_internal_add_example(cbordump)
|
||||||
qt_internal_add_example(savegame)
|
qt_internal_add_example(convert)
|
||||||
if(TARGET Qt6::Network AND TARGET Qt6::Widgets)
|
qt_internal_add_example(savegame)
|
||||||
qt_internal_add_example(rsslisting)
|
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Qt6::Widgets)
|
if(TARGET Qt6::Widgets)
|
||||||
qt_internal_add_example(streambookmarks)
|
qt_internal_add_example(streambookmarks)
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(cbordump LANGUAGES CXX)
|
project(cbordump LANGUAGES CXX)
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
|
message(FATAL_ERROR "This project cannot be built on Android.")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
||||||
set(INSTALL_EXAMPLESDIR "examples")
|
set(INSTALL_EXAMPLESDIR "examples")
|
||||||
endif()
|
endif()
|
||||||
|
@ -165,7 +165,7 @@ def main(argv, speak):
|
|||||||
struct CborTagDescription
|
struct CborTagDescription
|
||||||
{{
|
{{
|
||||||
QCborTag tag;
|
QCborTag tag;
|
||||||
const char *description; // with space and parentheses
|
const char *description; // with space and parentheses
|
||||||
}};
|
}};
|
||||||
|
|
||||||
// {title}
|
// {title}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\example serialization/cbordump
|
\example serialization/cbordump
|
||||||
\examplecategory {Input/Output}
|
\examplecategory {Data Processing & I/O}
|
||||||
\meta tag {network}
|
\meta tag {network}
|
||||||
\title Parsing and displaying CBOR data
|
\title Parsing and displaying CBOR data
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To regenerate:
|
* To regenerate:
|
||||||
* curl -O https://www.iana.org/assignments/cbor-tags/cbor-tags.xml
|
* curl -O https://www.iana.org/assignments/cbor-tags/cbor-tags.xml
|
||||||
@ -27,7 +29,7 @@
|
|||||||
struct CborTagDescription
|
struct CborTagDescription
|
||||||
{
|
{
|
||||||
QCborTag tag;
|
QCborTag tag;
|
||||||
const char *description; // with space and parentheses
|
const char *description; // with space and parentheses
|
||||||
};
|
};
|
||||||
|
|
||||||
// Concise Binary Object Representation (CBOR) Tags
|
// Concise Binary Object Representation (CBOR) Tags
|
||||||
@ -131,22 +133,18 @@ static const CborTagDescription tagDescriptions[] = {
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
// See RFC 7049 section 2.
|
// See RFC 7049 section 2.
|
||||||
SmallValueBitLength = 5,
|
SmallValueBitLength = 5,
|
||||||
SmallValueMask = (1 << SmallValueBitLength) - 1, /* 0x1f */
|
SmallValueMask = (1 << SmallValueBitLength) - 1, /* 0x1f */
|
||||||
Value8Bit = 24,
|
Value8Bit = 24,
|
||||||
Value16Bit = 25,
|
Value16Bit = 25,
|
||||||
Value32Bit = 26,
|
Value32Bit = 26,
|
||||||
Value64Bit = 27
|
Value64Bit = 27
|
||||||
};
|
};
|
||||||
|
|
||||||
//! [0]
|
//! [0]
|
||||||
struct CborDumper
|
struct CborDumper
|
||||||
{
|
{
|
||||||
enum DumpOption {
|
enum DumpOption { ShowCompact = 0x01, ShowWidthIndicators = 0x02, ShowAnnotated = 0x04 };
|
||||||
ShowCompact = 0x01,
|
|
||||||
ShowWidthIndicators = 0x02,
|
|
||||||
ShowAnnotated = 0x04
|
|
||||||
};
|
|
||||||
Q_DECLARE_FLAGS(DumpOptions, DumpOption)
|
Q_DECLARE_FLAGS(DumpOptions, DumpOption)
|
||||||
|
|
||||||
CborDumper(QFile *f, DumpOptions opts_);
|
CborDumper(QFile *f, DumpOptions opts_);
|
||||||
@ -183,8 +181,7 @@ static int cborNumberSize(quint64 value)
|
|||||||
return normalSize;
|
return normalSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
CborDumper::CborDumper(QFile *f, DumpOptions opts_)
|
CborDumper::CborDumper(QFile *f, DumpOptions opts_) : opts(opts_)
|
||||||
: opts(opts_)
|
|
||||||
{
|
{
|
||||||
// try to mmap the file, this is faster
|
// try to mmap the file, this is faster
|
||||||
char *ptr = reinterpret_cast<char *>(f->map(0, f->size(), QFile::MapPrivateOption));
|
char *ptr = reinterpret_cast<char *>(f->map(0, f->size(), QFile::MapPrivateOption));
|
||||||
@ -231,7 +228,8 @@ QCborError CborDumper::dump()
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> static inline bool canConvertTo(double v)
|
template<typename T>
|
||||||
|
static inline bool canConvertTo(double v)
|
||||||
{
|
{
|
||||||
using TypeInfo = std::numeric_limits<T>;
|
using TypeInfo = std::numeric_limits<T>;
|
||||||
// The [conv.fpint] (7.10 Floating-integral conversions) section of the
|
// The [conv.fpint] (7.10 Floating-integral conversions) section of the
|
||||||
@ -252,31 +250,32 @@ template <typename T> static inline bool canConvertTo(double v)
|
|||||||
return v == floor(v);
|
return v == floor(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString fpToString(double v, const char *suffix)
|
static QString fpToString(double v, QLatin1StringView suffix = ""_L1)
|
||||||
{
|
{
|
||||||
if (qIsInf(v))
|
if (qIsInf(v))
|
||||||
return v < 0 ? QStringLiteral("-inf") : QStringLiteral("inf");
|
return v < 0 ? "-inf"_L1 : "inf"_L1;
|
||||||
if (qIsNaN(v))
|
if (qIsNaN(v))
|
||||||
return QStringLiteral("nan");
|
return "nan"_L1;
|
||||||
if (canConvertTo<qint64>(v))
|
if (canConvertTo<qint64>(v))
|
||||||
return QString::number(qint64(v)) + ".0" + suffix;
|
return QString::number(qint64(v)) + ".0"_L1 + suffix;
|
||||||
if (canConvertTo<quint64>(v))
|
if (canConvertTo<quint64>(v))
|
||||||
return QString::number(quint64(v)) + ".0" + suffix;
|
return QString::number(quint64(v)) + ".0"_L1 + suffix;
|
||||||
|
|
||||||
QString s = QString::number(v, 'g', QLocale::FloatingPointShortest);
|
QString s = QString::number(v, 'g', QLocale::FloatingPointShortest);
|
||||||
if (!s.contains('.') && !s.contains('e'))
|
if (!s.contains(u'.') && !s.contains(u'e'))
|
||||||
s += '.';
|
s += u'.';
|
||||||
s += suffix;
|
if (suffix.size())
|
||||||
|
s += suffix;
|
||||||
return s;
|
return s;
|
||||||
};
|
};
|
||||||
|
|
||||||
void CborDumper::dumpOne(int nestingLevel)
|
void CborDumper::dumpOne(int nestingLevel)
|
||||||
{
|
{
|
||||||
QString indent(1, QLatin1Char(' '));
|
QString indent(1, u' ');
|
||||||
QString indented = indent;
|
QString indented = indent;
|
||||||
if (!opts.testFlag(ShowCompact)) {
|
if (!opts.testFlag(ShowCompact)) {
|
||||||
indent = QLatin1Char('\n') + QString(4 * nestingLevel, QLatin1Char(' '));
|
indent = u'\n' + QString(4 * nestingLevel, u' ');
|
||||||
indented = QLatin1Char('\n') + QString(4 + 4 * nestingLevel, QLatin1Char(' '));
|
indented = u'\n' + QString(4 + 4 * nestingLevel, u' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (reader.type()) {
|
switch (reader.type()) {
|
||||||
@ -316,7 +315,7 @@ void CborDumper::dumpOne(int nestingLevel)
|
|||||||
printStringWidthIndicator(r.data.size());
|
printStringWidthIndicator(r.data.size());
|
||||||
|
|
||||||
r = reader.readByteArray();
|
r = reader.readByteArray();
|
||||||
comma = QLatin1Char(',') + indented;
|
comma = u',' + indented;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
auto r = reader.readString();
|
auto r = reader.readString();
|
||||||
@ -325,7 +324,7 @@ void CborDumper::dumpOne(int nestingLevel)
|
|||||||
printStringWidthIndicator(r.data.toUtf8().size());
|
printStringWidthIndicator(r.data.toUtf8().size());
|
||||||
|
|
||||||
r = reader.readString();
|
r = reader.readString();
|
||||||
comma = QLatin1Char(',') + indented;
|
comma = u',' + indented;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,7 +380,7 @@ void CborDumper::dumpOne(int nestingLevel)
|
|||||||
if (reader.next()) {
|
if (reader.next()) {
|
||||||
printWidthIndicator(quint64(tag));
|
printWidthIndicator(quint64(tag));
|
||||||
printf("(");
|
printf("(");
|
||||||
dumpOne(nestingLevel); // same level!
|
dumpOne(nestingLevel); // same level!
|
||||||
printf(")");
|
printf(")");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,15 +412,15 @@ void CborDumper::dumpOne(int nestingLevel)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case QCborStreamReader::Float16:
|
case QCborStreamReader::Float16:
|
||||||
printf("%s", qPrintable(fpToString(reader.toFloat16(), "f16")));
|
printf("%s", qPrintable(fpToString(reader.toFloat16(), "f16"_L1)));
|
||||||
reader.next();
|
reader.next();
|
||||||
break;
|
break;
|
||||||
case QCborStreamReader::Float:
|
case QCborStreamReader::Float:
|
||||||
printf("%s", qPrintable(fpToString(reader.toFloat(), "f")));
|
printf("%s", qPrintable(fpToString(reader.toFloat(), "f"_L1)));
|
||||||
reader.next();
|
reader.next();
|
||||||
break;
|
break;
|
||||||
case QCborStreamReader::Double:
|
case QCborStreamReader::Double:
|
||||||
printf("%s", qPrintable(fpToString(reader.toDouble(), "")));
|
printf("%s", qPrintable(fpToString(reader.toDouble())));
|
||||||
reader.next();
|
reader.next();
|
||||||
break;
|
break;
|
||||||
case QCborStreamReader::Invalid:
|
case QCborStreamReader::Invalid:
|
||||||
@ -474,7 +473,7 @@ void CborDumper::dumpOneDetailed(int nestingLevel)
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto printFp = [=](const char *descr, double d) {
|
auto printFp = [=](const char *descr, double d) {
|
||||||
QString s = fpToString(d, "");
|
QString s = fpToString(d);
|
||||||
if (s.size() <= 6)
|
if (s.size() <= 6)
|
||||||
return print(descr, "%s", qPrintable(s));
|
return print(descr, "%s", qPrintable(s));
|
||||||
return print(descr, "%a", d);
|
return print(descr, "%a", d);
|
||||||
@ -489,7 +488,7 @@ void CborDumper::dumpOneDetailed(int nestingLevel)
|
|||||||
|
|
||||||
qsizetype size = reader.currentStringChunkSize();
|
qsizetype size = reader.currentStringChunkSize();
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
return; // error
|
return; // error
|
||||||
if (size >= ChunkSizeLimit) {
|
if (size >= ChunkSizeLimit) {
|
||||||
fprintf(stderr, "String length too big, %lli\n", qint64(size));
|
fprintf(stderr, "String length too big, %lli\n", qint64(size));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
@ -534,7 +533,7 @@ void CborDumper::dumpOneDetailed(int nestingLevel)
|
|||||||
printf(" %s%s", indent.constData(), section.toHex(' ').constData());
|
printf(" %s%s", indent.constData(), section.toHex(' ').constData());
|
||||||
|
|
||||||
// print the decode
|
// print the decode
|
||||||
QByteArray spaces(width > 0 ? width - section.size() * 3 + 1: 0, ' ');
|
QByteArray spaces(width > 0 ? width - section.size() * 3 + 1 : 0, ' ');
|
||||||
printf("%s # \"", spaces.constData());
|
printf("%s # \"", spaces.constData());
|
||||||
auto ptr = reinterpret_cast<const uchar *>(section.constData());
|
auto ptr = reinterpret_cast<const uchar *>(section.constData());
|
||||||
for (int j = 0; j < section.size(); ++j)
|
for (int j = 0; j < section.size(); ++j)
|
||||||
@ -546,7 +545,7 @@ void CborDumper::dumpOneDetailed(int nestingLevel)
|
|||||||
// get the next chunk
|
// get the next chunk
|
||||||
size = reader.currentStringChunkSize();
|
size = reader.currentStringChunkSize();
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
return; // error
|
return; // error
|
||||||
if (size >= ChunkSizeLimit) {
|
if (size >= ChunkSizeLimit) {
|
||||||
fprintf(stderr, "String length too big, %lli\n", qint64(size));
|
fprintf(stderr, "String length too big, %lli\n", qint64(size));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
@ -685,7 +684,9 @@ void CborDumper::printByteArray(const QByteArray &ba)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case quint8(QCborKnownTags::ExpectedBase64url):
|
case quint8(QCborKnownTags::ExpectedBase64url):
|
||||||
printf("b64'%s'", ba.toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals).constData());
|
printf("b64'%s'",
|
||||||
|
ba.toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals)
|
||||||
|
.constData());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -726,23 +727,20 @@ int main(int argc, char *argv[])
|
|||||||
setlocale(LC_ALL, "C");
|
setlocale(LC_ALL, "C");
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.setApplicationDescription(QStringLiteral("CBOR Dumper tool"));
|
parser.setApplicationDescription("CBOR Dumper tool"_L1);
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
|
|
||||||
QCommandLineOption compact({QStringLiteral("c"), QStringLiteral("compact")},
|
QCommandLineOption compact({"c"_L1, "compact"_L1}, "Use compact form (no line breaks)"_L1);
|
||||||
QStringLiteral("Use compact form (no line breaks)"));
|
|
||||||
parser.addOption(compact);
|
parser.addOption(compact);
|
||||||
|
|
||||||
QCommandLineOption showIndicators({QStringLiteral("i"), QStringLiteral("indicators")},
|
QCommandLineOption showIndicators({ "i"_L1, "indicators"_L1 },
|
||||||
QStringLiteral("Show indicators for width of lengths and integrals"));
|
"Show indicators for width of lengths and integrals"_L1);
|
||||||
parser.addOption(showIndicators);
|
parser.addOption(showIndicators);
|
||||||
|
|
||||||
QCommandLineOption verbose({QStringLiteral("a"), QStringLiteral("annotated")},
|
QCommandLineOption verbose({"a"_L1, "annotated"_L1}, "Show bytes and annotated decoding"_L1);
|
||||||
QStringLiteral("Show bytes and annotated decoding"));
|
|
||||||
parser.addOption(verbose);
|
parser.addOption(verbose);
|
||||||
|
|
||||||
parser.addPositionalArgument(QStringLiteral("[source]"),
|
parser.addPositionalArgument("[source]"_L1, "CBOR file to read from"_L1);
|
||||||
QStringLiteral("CBOR file to read from"));
|
|
||||||
|
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(convert LANGUAGES CXX)
|
project(convert LANGUAGES CXX)
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
|
message(FATAL_ERROR "This project cannot be built on Android.")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
||||||
set(INSTALL_EXAMPLESDIR "examples")
|
set(INSTALL_EXAMPLESDIR "examples")
|
||||||
endif()
|
endif()
|
||||||
@ -18,6 +22,7 @@ qt_add_executable(convert
|
|||||||
cborconverter.cpp cborconverter.h
|
cborconverter.cpp cborconverter.h
|
||||||
converter.h
|
converter.h
|
||||||
datastreamconverter.cpp datastreamconverter.h
|
datastreamconverter.cpp datastreamconverter.h
|
||||||
|
debugtextdumper.cpp debugtextdumper.h
|
||||||
jsonconverter.cpp jsonconverter.h
|
jsonconverter.cpp jsonconverter.h
|
||||||
main.cpp
|
main.cpp
|
||||||
nullconverter.cpp nullconverter.h
|
nullconverter.cpp nullconverter.h
|
||||||
|
@ -3,19 +3,21 @@
|
|||||||
|
|
||||||
#include "cborconverter.h"
|
#include "cborconverter.h"
|
||||||
|
|
||||||
|
#include <QCborArray>
|
||||||
|
#include <QCborMap>
|
||||||
#include <QCborStreamReader>
|
#include <QCborStreamReader>
|
||||||
#include <QCborStreamWriter>
|
#include <QCborStreamWriter>
|
||||||
#include <QCborMap>
|
|
||||||
#include <QCborArray>
|
|
||||||
#include <QCborValue>
|
#include <QCborValue>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QFloat16>
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QFloat16>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
static CborConverter cborConverter;
|
static CborConverter cborConverter;
|
||||||
static CborDiagnosticDumper cborDiagnosticDumper;
|
static CborDiagnosticDumper cborDiagnosticDumper;
|
||||||
|
|
||||||
@ -118,33 +120,33 @@ static QCborValue convertFromVariant(const QVariant &v, TrimFloatingPoint fpTrim
|
|||||||
}
|
}
|
||||||
//! [1]
|
//! [1]
|
||||||
|
|
||||||
QString CborDiagnosticDumper::name()
|
QString CborDiagnosticDumper::name() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("cbor-dump");
|
return "cbor-dump"_L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Direction CborDiagnosticDumper::directions()
|
Converter::Directions CborDiagnosticDumper::directions() const
|
||||||
{
|
{
|
||||||
return Out;
|
return Direction::Out;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Options CborDiagnosticDumper::outputOptions()
|
Converter::Options CborDiagnosticDumper::outputOptions() const
|
||||||
{
|
{
|
||||||
return SupportsArbitraryMapKeys;
|
return SupportsArbitraryMapKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *CborDiagnosticDumper::optionsHelp()
|
const char *CborDiagnosticDumper::optionsHelp() const
|
||||||
{
|
{
|
||||||
return diagnosticHelp;
|
return diagnosticHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CborDiagnosticDumper::probeFile(QIODevice *f)
|
bool CborDiagnosticDumper::probeFile(QIODevice *f) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(f);
|
Q_UNUSED(f);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant CborDiagnosticDumper::loadFile(QIODevice *f, Converter *&outputConverter)
|
QVariant CborDiagnosticDumper::loadFile(QIODevice *f, const Converter *&outputConverter) const
|
||||||
{
|
{
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
Q_UNUSED(f);
|
Q_UNUSED(f);
|
||||||
@ -152,7 +154,8 @@ QVariant CborDiagnosticDumper::loadFile(QIODevice *f, Converter *&outputConverte
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CborDiagnosticDumper::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options)
|
void CborDiagnosticDumper::saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const
|
||||||
{
|
{
|
||||||
QCborValue::DiagnosticNotationOptions opts = QCborValue::LineWrapped;
|
QCborValue::DiagnosticNotationOptions opts = QCborValue::LineWrapped;
|
||||||
for (const QString &s : options) {
|
for (const QString &s : options) {
|
||||||
@ -181,8 +184,7 @@ void CborDiagnosticDumper::saveFile(QIODevice *f, const QVariant &contents, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTextStream out(f);
|
QTextStream out(f);
|
||||||
out << convertFromVariant(contents, Double).toDiagnosticNotation(opts)
|
out << convertFromVariant(contents, Double).toDiagnosticNotation(opts) << Qt::endl;
|
||||||
<< Qt::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CborConverter::CborConverter()
|
CborConverter::CborConverter()
|
||||||
@ -190,37 +192,37 @@ CborConverter::CborConverter()
|
|||||||
qRegisterMetaType<QCborTag>();
|
qRegisterMetaType<QCborTag>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CborConverter::name()
|
QString CborConverter::name() const
|
||||||
{
|
{
|
||||||
return "cbor";
|
return "cbor";
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Direction CborConverter::directions()
|
Converter::Directions CborConverter::directions() const
|
||||||
{
|
{
|
||||||
return InOut;
|
return Direction::InOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Options CborConverter::outputOptions()
|
Converter::Options CborConverter::outputOptions() const
|
||||||
{
|
{
|
||||||
return SupportsArbitraryMapKeys;
|
return SupportsArbitraryMapKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *CborConverter::optionsHelp()
|
const char *CborConverter::optionsHelp() const
|
||||||
{
|
{
|
||||||
return cborOptionHelp;
|
return cborOptionHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CborConverter::probeFile(QIODevice *f)
|
bool CborConverter::probeFile(QIODevice *f) const
|
||||||
{
|
{
|
||||||
if (QFile *file = qobject_cast<QFile *>(f)) {
|
if (QFile *file = qobject_cast<QFile *>(f)) {
|
||||||
if (file->fileName().endsWith(QLatin1String(".cbor")))
|
if (file->fileName().endsWith(".cbor"_L1))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return f->isReadable() && f->peek(3) == QByteArray("\xd9\xd9\xf7", 3);
|
return f->isReadable() && f->peek(3) == QByteArray("\xd9\xd9\xf7", 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! [2]
|
//! [2]
|
||||||
QVariant CborConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
QVariant CborConverter::loadFile(QIODevice *f, const Converter *&outputConverter) const
|
||||||
{
|
{
|
||||||
const char *ptr = nullptr;
|
const char *ptr = nullptr;
|
||||||
if (auto file = qobject_cast<QFile *>(f))
|
if (auto file = qobject_cast<QFile *>(f))
|
||||||
@ -256,7 +258,7 @@ QVariant CborConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
|||||||
}
|
}
|
||||||
//! [2]
|
//! [2]
|
||||||
//! [3]
|
//! [3]
|
||||||
void CborConverter::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options)
|
void CborConverter::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) const
|
||||||
{
|
{
|
||||||
//! [3]
|
//! [3]
|
||||||
bool useSignature = true;
|
bool useSignature = true;
|
||||||
@ -318,8 +320,9 @@ void CborConverter::saveFile(QIODevice *f, const QVariant &contents, const QStri
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
//! [4]
|
//! [4]
|
||||||
QCborValue v = convertFromVariant(contents,
|
QCborValue v =
|
||||||
useFloat16 == Always ? Float16 : useFloat == Always ? Float : Double);
|
convertFromVariant(contents,
|
||||||
|
useFloat16 == Always ? Float16 : useFloat == Always ? Float : Double);
|
||||||
QCborStreamWriter writer(f);
|
QCborStreamWriter writer(f);
|
||||||
if (useSignature)
|
if (useSignature)
|
||||||
writer.append(QCborKnownTags::Signature);
|
writer.append(QCborKnownTags::Signature);
|
||||||
|
@ -10,13 +10,14 @@ class CborDiagnosticDumper : public Converter
|
|||||||
{
|
{
|
||||||
// Converter interface
|
// Converter interface
|
||||||
public:
|
public:
|
||||||
QString name() override;
|
QString name() const override;
|
||||||
Direction directions() override;
|
Directions directions() const override;
|
||||||
Options outputOptions() override;
|
Options outputOptions() const override;
|
||||||
const char *optionsHelp() override;
|
const char *optionsHelp() const override;
|
||||||
bool probeFile(QIODevice *f) override;
|
bool probeFile(QIODevice *f) const override;
|
||||||
QVariant loadFile(QIODevice *f, Converter *&outputConverter) override;
|
QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const override;
|
||||||
void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) override;
|
void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CborConverter : public Converter
|
class CborConverter : public Converter
|
||||||
@ -26,13 +27,14 @@ public:
|
|||||||
|
|
||||||
// Converter interface
|
// Converter interface
|
||||||
public:
|
public:
|
||||||
QString name() override;
|
QString name() const override;
|
||||||
Direction directions() override;
|
Directions directions() const override;
|
||||||
Options outputOptions() override;
|
Options outputOptions() const override;
|
||||||
const char *optionsHelp() override;
|
const char *optionsHelp() const override;
|
||||||
bool probeFile(QIODevice *f) override;
|
bool probeFile(QIODevice *f) const override;
|
||||||
QVariant loadFile(QIODevice *f, Converter *&outputConverter) override;
|
QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const override;
|
||||||
void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) override;
|
void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CBORCONVERTER_H
|
#endif // CBORCONVERTER_H
|
||||||
|
@ -12,17 +12,19 @@ INSTALLS += target
|
|||||||
|
|
||||||
SOURCES += main.cpp \
|
SOURCES += main.cpp \
|
||||||
cborconverter.cpp \
|
cborconverter.cpp \
|
||||||
jsonconverter.cpp \
|
|
||||||
datastreamconverter.cpp \
|
datastreamconverter.cpp \
|
||||||
|
debugtextdumper.cpp \
|
||||||
|
jsonconverter.cpp \
|
||||||
|
nullconverter.cpp \
|
||||||
textconverter.cpp \
|
textconverter.cpp \
|
||||||
xmlconverter.cpp \
|
xmlconverter.cpp
|
||||||
nullconverter.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
converter.h \
|
converter.h \
|
||||||
cborconverter.h \
|
cborconverter.h \
|
||||||
jsonconverter.h \
|
|
||||||
datastreamconverter.h \
|
datastreamconverter.h \
|
||||||
|
debugtextdumper.h \
|
||||||
|
jsonconverter.h \
|
||||||
|
nullconverter.h \
|
||||||
textconverter.h \
|
textconverter.h \
|
||||||
xmlconverter.h \
|
xmlconverter.h
|
||||||
nullconverter.h
|
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
#define CONVERTER_H
|
#define CONVERTER_H
|
||||||
|
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
|
#include <QList>
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
#include <QList>
|
|
||||||
|
|
||||||
class VariantOrderedMap : public QList<QPair<QVariant, QVariant>>
|
class VariantOrderedMap : public QList<QPair<QVariant, QVariant>>
|
||||||
{
|
{
|
||||||
@ -32,26 +32,25 @@ protected:
|
|||||||
public:
|
public:
|
||||||
static Converter *null;
|
static Converter *null;
|
||||||
|
|
||||||
enum Direction {
|
enum class Direction { In = 1, Out = 2, InOut = In | Out };
|
||||||
In = 1, Out = 2, InOut = 3
|
Q_DECLARE_FLAGS(Directions, Direction)
|
||||||
};
|
|
||||||
|
|
||||||
enum Option {
|
enum Option { SupportsArbitraryMapKeys = 0x01 };
|
||||||
SupportsArbitraryMapKeys = 0x01
|
|
||||||
};
|
|
||||||
Q_DECLARE_FLAGS(Options, Option)
|
Q_DECLARE_FLAGS(Options, Option)
|
||||||
|
|
||||||
virtual ~Converter() = 0;
|
virtual ~Converter() = 0;
|
||||||
|
|
||||||
virtual QString name() = 0;
|
virtual QString name() const = 0;
|
||||||
virtual Direction directions() = 0;
|
virtual Directions directions() const = 0;
|
||||||
virtual Options outputOptions() = 0;
|
virtual Options outputOptions() const = 0;
|
||||||
virtual const char *optionsHelp() = 0;
|
virtual const char *optionsHelp() const = 0;
|
||||||
virtual bool probeFile(QIODevice *f) = 0;
|
virtual bool probeFile(QIODevice *f) const = 0;
|
||||||
virtual QVariant loadFile(QIODevice *f, Converter *&outputConverter) = 0;
|
virtual QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const = 0;
|
||||||
virtual void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) = 0;
|
virtual void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Converter::Directions)
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Converter::Options)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Converter::Options)
|
||||||
|
|
||||||
#endif // CONVERTER_H
|
#endif // CONVERTER_H
|
||||||
|
@ -2,20 +2,21 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
#include "datastreamconverter.h"
|
#include "datastreamconverter.h"
|
||||||
|
#include "debugtextdumper.h"
|
||||||
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QDebug>
|
|
||||||
#include <QTextStream>
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
static const char dataStreamOptionHelp[] =
|
static const char dataStreamOptionHelp[] =
|
||||||
"byteorder=host|big|little Byte order to use.\n"
|
"byteorder=host|big|little Byte order to use.\n"
|
||||||
"version=<n> QDataStream version (default: Qt 5.0).\n"
|
"version=<n> QDataStream version (default: Qt 6.0).\n"
|
||||||
;
|
;
|
||||||
|
|
||||||
static const char signature[] = "qds";
|
static const char signature[] = "qds";
|
||||||
|
|
||||||
static DataStreamDumper dataStreamDumper;
|
static DataStreamConverter dataStreamConverter;
|
||||||
static DataStreamConverter DataStreamConverter;
|
static DebugTextDumper debugTextDumper;
|
||||||
|
|
||||||
QDataStream &operator<<(QDataStream &ds, const VariantOrderedMap &map)
|
QDataStream &operator<<(QDataStream &ds, const VariantOrderedMap &map)
|
||||||
{
|
{
|
||||||
@ -42,123 +43,43 @@ QDataStream &operator>>(QDataStream &ds, VariantOrderedMap &map)
|
|||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static QString dumpVariant(const QVariant &v, const QString &indent = QLatin1String("\n"))
|
|
||||||
{
|
|
||||||
QString result;
|
|
||||||
QString indented = indent + QLatin1String(" ");
|
|
||||||
|
|
||||||
int type = v.userType();
|
|
||||||
if (type == qMetaTypeId<VariantOrderedMap>() || type == QMetaType::QVariantMap) {
|
|
||||||
const auto map = (type == QMetaType::QVariantMap) ?
|
|
||||||
VariantOrderedMap(v.toMap()) : qvariant_cast<VariantOrderedMap>(v);
|
|
||||||
|
|
||||||
result = QLatin1String("Map {");
|
|
||||||
for (const auto &pair : map) {
|
|
||||||
result += indented + dumpVariant(pair.first, indented);
|
|
||||||
result.chop(1); // remove comma
|
|
||||||
result += QLatin1String(" => ") + dumpVariant(pair.second, indented);
|
|
||||||
|
|
||||||
}
|
|
||||||
result.chop(1); // remove comma
|
|
||||||
result += indent + QLatin1String("},");
|
|
||||||
} else if (type == QMetaType::QVariantList) {
|
|
||||||
const QVariantList list = v.toList();
|
|
||||||
|
|
||||||
result = QLatin1String("List [");
|
|
||||||
for (const auto &item : list)
|
|
||||||
result += indented + dumpVariant(item, indented);
|
|
||||||
result.chop(1); // remove comma
|
|
||||||
result += indent + QLatin1String("],");
|
|
||||||
} else {
|
|
||||||
QDebug debug(&result);
|
|
||||||
debug.nospace() << v << ',';
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString DataStreamDumper::name()
|
|
||||||
{
|
|
||||||
return QStringLiteral("datastream-dump");
|
|
||||||
}
|
|
||||||
|
|
||||||
Converter::Direction DataStreamDumper::directions()
|
|
||||||
{
|
|
||||||
return Out;
|
|
||||||
}
|
|
||||||
|
|
||||||
Converter::Options DataStreamDumper::outputOptions()
|
|
||||||
{
|
|
||||||
return SupportsArbitraryMapKeys;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *DataStreamDumper::optionsHelp()
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DataStreamDumper::probeFile(QIODevice *f)
|
|
||||||
{
|
|
||||||
Q_UNUSED(f);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant DataStreamDumper::loadFile(QIODevice *f, Converter *&outputConverter)
|
|
||||||
{
|
|
||||||
Q_UNREACHABLE();
|
|
||||||
Q_UNUSED(f);
|
|
||||||
Q_UNUSED(outputConverter);
|
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DataStreamDumper::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options)
|
|
||||||
{
|
|
||||||
Q_UNUSED(options);
|
|
||||||
QString s = dumpVariant(contents);
|
|
||||||
s[s.size() - 1] = QLatin1Char('\n'); // replace the comma with newline
|
|
||||||
|
|
||||||
QTextStream out(f);
|
|
||||||
out << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
DataStreamConverter::DataStreamConverter()
|
DataStreamConverter::DataStreamConverter()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<VariantOrderedMap>();
|
qRegisterMetaType<VariantOrderedMap>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DataStreamConverter::name()
|
QString DataStreamConverter::name() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("datastream");
|
return "datastream"_L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Direction DataStreamConverter::directions()
|
Converter::Directions DataStreamConverter::directions() const
|
||||||
{
|
{
|
||||||
return InOut;
|
return Direction::InOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Options DataStreamConverter::outputOptions()
|
Converter::Options DataStreamConverter::outputOptions() const
|
||||||
{
|
{
|
||||||
return SupportsArbitraryMapKeys;
|
return SupportsArbitraryMapKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *DataStreamConverter::optionsHelp()
|
const char *DataStreamConverter::optionsHelp() const
|
||||||
{
|
{
|
||||||
return dataStreamOptionHelp;
|
return dataStreamOptionHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DataStreamConverter::probeFile(QIODevice *f)
|
bool DataStreamConverter::probeFile(QIODevice *f) const
|
||||||
{
|
{
|
||||||
return f->isReadable() && f->peek(sizeof(signature) - 1) == signature;
|
return f->isReadable() && f->peek(sizeof(signature) - 1) == signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant DataStreamConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
QVariant DataStreamConverter::loadFile(QIODevice *f, const Converter *&outputConverter) const
|
||||||
{
|
{
|
||||||
if (!outputConverter)
|
if (!outputConverter)
|
||||||
outputConverter = &dataStreamDumper;
|
outputConverter = &debugTextDumper;
|
||||||
|
|
||||||
char c;
|
char c;
|
||||||
if (f->read(sizeof(signature) -1) != signature ||
|
if (f->read(sizeof(signature) - 1) != signature || !f->getChar(&c) || (c != 'l' && c != 'B')) {
|
||||||
!f->getChar(&c) || (c != 'l' && c != 'B')) {
|
|
||||||
fprintf(stderr, "Could not load QDataStream file: invalid signature.\n");
|
fprintf(stderr, "Could not load QDataStream file: invalid signature.\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -175,9 +96,10 @@ QVariant DataStreamConverter::loadFile(QIODevice *f, Converter *&outputConverter
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataStreamConverter::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options)
|
void DataStreamConverter::saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const
|
||||||
{
|
{
|
||||||
QDataStream::Version version = QDataStream::Qt_5_0;
|
QDataStream::Version version = QDataStream::Qt_6_0;
|
||||||
auto order = QDataStream::ByteOrder(QSysInfo::ByteOrder);
|
auto order = QDataStream::ByteOrder(QSysInfo::ByteOrder);
|
||||||
for (const QString &option : options) {
|
for (const QString &option : options) {
|
||||||
const QStringList pair = option.split('=');
|
const QStringList pair = option.split('=');
|
||||||
@ -213,7 +135,7 @@ void DataStreamConverter::saveFile(QIODevice *f, const QVariant &contents, const
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
char c = order == QDataStream::LittleEndian ? 'l' : 'B';
|
char c = order == QDataStream::LittleEndian ? 'l' : 'B';
|
||||||
f->write(signature);
|
f->write(signature);
|
||||||
f->write(&c, 1);
|
f->write(&c, 1);
|
||||||
|
|
||||||
|
@ -6,19 +6,6 @@
|
|||||||
|
|
||||||
#include "converter.h"
|
#include "converter.h"
|
||||||
|
|
||||||
class DataStreamDumper : public Converter
|
|
||||||
{
|
|
||||||
// Converter interface
|
|
||||||
public:
|
|
||||||
QString name() override;
|
|
||||||
Direction directions() override;
|
|
||||||
Options outputOptions() override;
|
|
||||||
const char *optionsHelp() override;
|
|
||||||
bool probeFile(QIODevice *f) override;
|
|
||||||
QVariant loadFile(QIODevice *f, Converter *&outputConverter) override;
|
|
||||||
void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DataStreamConverter : public Converter
|
class DataStreamConverter : public Converter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -26,13 +13,14 @@ public:
|
|||||||
|
|
||||||
// Converter interface
|
// Converter interface
|
||||||
public:
|
public:
|
||||||
QString name() override;
|
QString name() const override;
|
||||||
Direction directions() override;
|
Directions directions() const override;
|
||||||
Options outputOptions() override;
|
Options outputOptions() const override;
|
||||||
const char *optionsHelp() override;
|
const char *optionsHelp() const override;
|
||||||
bool probeFile(QIODevice *f) override;
|
bool probeFile(QIODevice *f) const override;
|
||||||
QVariant loadFile(QIODevice *f, Converter *&outputConverter) override;
|
QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const override;
|
||||||
void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) override;
|
void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATASTREAMCONVERTER_H
|
#endif // DATASTREAMCONVERTER_H
|
||||||
|
89
examples/corelib/serialization/convert/debugtextdumper.cpp
Normal file
89
examples/corelib/serialization/convert/debugtextdumper.cpp
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
// Copyright (C) 2018 Intel Corporation.
|
||||||
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
|
#include "debugtextdumper.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
|
// Static instance is declared in datastreamconverter.cpp, since it uses it.
|
||||||
|
|
||||||
|
static QString dumpVariant(const QVariant &v, const QString &indent = "\n"_L1)
|
||||||
|
{
|
||||||
|
QString result;
|
||||||
|
QString indented = indent + " "_L1;
|
||||||
|
|
||||||
|
int type = v.userType();
|
||||||
|
if (type == qMetaTypeId<VariantOrderedMap>() || type == QMetaType::QVariantMap) {
|
||||||
|
const auto map = (type == QMetaType::QVariantMap) ? VariantOrderedMap(v.toMap())
|
||||||
|
: qvariant_cast<VariantOrderedMap>(v);
|
||||||
|
|
||||||
|
result = "Map {"_L1;
|
||||||
|
for (const auto &pair : map) {
|
||||||
|
result += indented + dumpVariant(pair.first, indented);
|
||||||
|
result.chop(1); // remove comma
|
||||||
|
result += " => "_L1 + dumpVariant(pair.second, indented);
|
||||||
|
}
|
||||||
|
result.chop(1); // remove comma
|
||||||
|
result += indent + "},"_L1;
|
||||||
|
} else if (type == QMetaType::QVariantList) {
|
||||||
|
const QVariantList list = v.toList();
|
||||||
|
|
||||||
|
result = "List ["_L1;
|
||||||
|
for (const auto &item : list)
|
||||||
|
result += indented + dumpVariant(item, indented);
|
||||||
|
result.chop(1); // remove comma
|
||||||
|
result += indent + "],"_L1;
|
||||||
|
} else {
|
||||||
|
QDebug debug(&result);
|
||||||
|
debug.nospace() << v << ',';
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DebugTextDumper::name() const
|
||||||
|
{
|
||||||
|
return "debugtext-dump"_L1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Converter::Directions DebugTextDumper::directions() const
|
||||||
|
{
|
||||||
|
return Direction::Out;
|
||||||
|
}
|
||||||
|
|
||||||
|
Converter::Options DebugTextDumper::outputOptions() const
|
||||||
|
{
|
||||||
|
return SupportsArbitraryMapKeys;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *DebugTextDumper::optionsHelp() const
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DebugTextDumper::probeFile(QIODevice *f) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(f);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant DebugTextDumper::loadFile(QIODevice *f, const Converter *&outputConverter) const
|
||||||
|
{
|
||||||
|
Q_UNREACHABLE();
|
||||||
|
Q_UNUSED(f);
|
||||||
|
Q_UNUSED(outputConverter);
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebugTextDumper::saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(options);
|
||||||
|
QString s = dumpVariant(contents);
|
||||||
|
s[s.size() - 1] = u'\n'; // replace the comma with newline
|
||||||
|
|
||||||
|
QTextStream out(f);
|
||||||
|
out << s;
|
||||||
|
}
|
23
examples/corelib/serialization/convert/debugtextdumper.h
Normal file
23
examples/corelib/serialization/convert/debugtextdumper.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (C) 2018 Intel Corporation.
|
||||||
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
|
#ifndef DEBUGTEXTDUMPER_H
|
||||||
|
#define DEBUGTEXTDUMPER_H
|
||||||
|
|
||||||
|
#include "converter.h"
|
||||||
|
|
||||||
|
class DebugTextDumper : public Converter
|
||||||
|
{
|
||||||
|
// Converter interface
|
||||||
|
public:
|
||||||
|
QString name() const override;
|
||||||
|
Directions directions() const override;
|
||||||
|
Options outputOptions() const override;
|
||||||
|
const char *optionsHelp() const override;
|
||||||
|
bool probeFile(QIODevice *f) const override;
|
||||||
|
QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const override;
|
||||||
|
void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DEBUGTEXTDUMPER_H
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\example serialization/convert
|
\example serialization/convert
|
||||||
\examplecategory {Input/Output}
|
\examplecategory {Data Processing & I/O}
|
||||||
\meta tag {network}
|
\meta tag {network}
|
||||||
\title Convert Example
|
\title Convert Example
|
||||||
|
|
||||||
@ -60,7 +60,7 @@
|
|||||||
\section1 The DataStreamConverter Class
|
\section1 The DataStreamConverter Class
|
||||||
|
|
||||||
The DataStreamConverter class is used to serialize to and from the
|
The DataStreamConverter class is used to serialize to and from the
|
||||||
QDataStream format. There is also the DataStreamDumper class for outputting
|
QDataStream format. There is also the DebugTextDumper class for outputting
|
||||||
the data lossless in a non-standardized human readable format.
|
the data lossless in a non-standardized human readable format.
|
||||||
|
|
||||||
\section1 The JsonConverter Class
|
\section1 The JsonConverter Class
|
||||||
|
@ -9,10 +9,11 @@
|
|||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonValue>
|
#include <QJsonValue>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
static JsonConverter jsonConverter;
|
static JsonConverter jsonConverter;
|
||||||
|
|
||||||
static const char jsonOptionHelp[] =
|
static const char jsonOptionHelp[] = "compact=no|yes Use compact JSON form.\n";
|
||||||
"compact=no|yes Use compact JSON form.\n";
|
|
||||||
|
|
||||||
static QJsonDocument convertFromVariant(const QVariant &v)
|
static QJsonDocument convertFromVariant(const QVariant &v)
|
||||||
{
|
{
|
||||||
@ -24,34 +25,30 @@ static QJsonDocument convertFromVariant(const QVariant &v)
|
|||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonConverter::JsonConverter()
|
QString JsonConverter::name() const
|
||||||
{
|
{
|
||||||
|
return "json"_L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString JsonConverter::name()
|
Converter::Directions JsonConverter::directions() const
|
||||||
{
|
{
|
||||||
return "json";
|
return Direction::InOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Direction JsonConverter::directions()
|
Converter::Options JsonConverter::outputOptions() const
|
||||||
{
|
|
||||||
return InOut;
|
|
||||||
}
|
|
||||||
|
|
||||||
Converter::Options JsonConverter::outputOptions()
|
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *JsonConverter::optionsHelp()
|
const char *JsonConverter::optionsHelp() const
|
||||||
{
|
{
|
||||||
return jsonOptionHelp;
|
return jsonOptionHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JsonConverter::probeFile(QIODevice *f)
|
bool JsonConverter::probeFile(QIODevice *f) const
|
||||||
{
|
{
|
||||||
if (QFile *file = qobject_cast<QFile *>(f)) {
|
if (QFile *file = qobject_cast<QFile *>(f)) {
|
||||||
if (file->fileName().endsWith(QLatin1String(".json")))
|
if (file->fileName().endsWith(".json"_L1))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +59,7 @@ bool JsonConverter::probeFile(QIODevice *f)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant JsonConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
QVariant JsonConverter::loadFile(QIODevice *f, const Converter *&outputConverter) const
|
||||||
{
|
{
|
||||||
if (!outputConverter)
|
if (!outputConverter)
|
||||||
outputConverter = this;
|
outputConverter = this;
|
||||||
@ -87,13 +84,14 @@ QVariant JsonConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
|||||||
return doc.toVariant();
|
return doc.toVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsonConverter::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options)
|
void JsonConverter::saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const
|
||||||
{
|
{
|
||||||
QJsonDocument::JsonFormat format = QJsonDocument::Indented;
|
QJsonDocument::JsonFormat format = QJsonDocument::Indented;
|
||||||
for (const QString &s : options) {
|
for (const QString &s : options) {
|
||||||
if (s == QLatin1String("compact=no")) {
|
if (s == "compact=no"_L1) {
|
||||||
format = QJsonDocument::Indented;
|
format = QJsonDocument::Indented;
|
||||||
} else if (s == QLatin1String("compact=yes")) {
|
} else if (s == "compact=yes"_L1) {
|
||||||
format = QJsonDocument::Compact;
|
format = QJsonDocument::Compact;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown option '%s' to JSON output. Valid options are:\n%s",
|
fprintf(stderr, "Unknown option '%s' to JSON output. Valid options are:\n%s",
|
||||||
|
@ -8,18 +8,16 @@
|
|||||||
|
|
||||||
class JsonConverter : public Converter
|
class JsonConverter : public Converter
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
JsonConverter();
|
|
||||||
|
|
||||||
// Converter interface
|
// Converter interface
|
||||||
public:
|
public:
|
||||||
QString name() override;
|
QString name() const override;
|
||||||
Direction directions() override;
|
Directions directions() const override;
|
||||||
Options outputOptions() override;
|
Options outputOptions() const override;
|
||||||
const char *optionsHelp() override;
|
const char *optionsHelp() const override;
|
||||||
bool probeFile(QIODevice *f) override;
|
bool probeFile(QIODevice *f) const override;
|
||||||
QVariant loadFile(QIODevice *f, Converter *&outputConverter) override;
|
QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const override;
|
||||||
void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) override;
|
void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // JSONCONVERTER_H
|
#endif // JSONCONVERTER_H
|
||||||
|
@ -11,12 +11,14 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
static QList<Converter *> *availableConverters;
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
|
static QList<const Converter *> *availableConverters;
|
||||||
|
|
||||||
Converter::Converter()
|
Converter::Converter()
|
||||||
{
|
{
|
||||||
if (!availableConverters)
|
if (!availableConverters)
|
||||||
availableConverters = new QList<Converter *>;
|
availableConverters = new QList<const Converter *>;
|
||||||
availableConverters->append(this);
|
availableConverters->append(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,64 +33,68 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QStringList inputFormats;
|
QStringList inputFormats;
|
||||||
QStringList outputFormats;
|
QStringList outputFormats;
|
||||||
for (Converter *conv : std::as_const(*availableConverters)) {
|
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||||
auto direction = conv->directions();
|
auto direction = conv->directions();
|
||||||
QString name = conv->name();
|
QString name = conv->name();
|
||||||
if (direction & Converter::In)
|
if (direction.testFlag(Converter::Direction::In))
|
||||||
inputFormats << name;
|
inputFormats << name;
|
||||||
if (direction & Converter::Out)
|
if (direction.testFlag(Converter::Direction::Out))
|
||||||
outputFormats << name;
|
outputFormats << name;
|
||||||
}
|
}
|
||||||
inputFormats.sort();
|
inputFormats.sort();
|
||||||
outputFormats.sort();
|
outputFormats.sort();
|
||||||
inputFormats.prepend("auto");
|
inputFormats.prepend("auto"_L1);
|
||||||
outputFormats.prepend("auto");
|
outputFormats.prepend("auto"_L1);
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.setApplicationDescription(QStringLiteral("Qt file format conversion tool"));
|
parser.setApplicationDescription("Qt file format conversion tool"_L1);
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
|
|
||||||
QCommandLineOption inputFormatOption(QStringList{"I", "input-format"});
|
QCommandLineOption inputFormatOption(QStringList{ "I"_L1, "input-format"_L1 });
|
||||||
inputFormatOption.setDescription(QLatin1String("Select the input format for the input file. Available formats: ") +
|
inputFormatOption.setDescription(
|
||||||
inputFormats.join(", "));
|
"Select the input format for the input file. Available formats: "_L1
|
||||||
inputFormatOption.setValueName("format");
|
+ inputFormats.join(", "_L1));
|
||||||
|
inputFormatOption.setValueName("format"_L1);
|
||||||
inputFormatOption.setDefaultValue(inputFormats.constFirst());
|
inputFormatOption.setDefaultValue(inputFormats.constFirst());
|
||||||
parser.addOption(inputFormatOption);
|
parser.addOption(inputFormatOption);
|
||||||
|
|
||||||
QCommandLineOption outputFormatOption(QStringList{"O", "output-format"});
|
QCommandLineOption outputFormatOption(QStringList{ "O"_L1, "output-format"_L1 });
|
||||||
outputFormatOption.setDescription(QLatin1String("Select the output format for the output file. Available formats: ") +
|
outputFormatOption.setDescription(
|
||||||
outputFormats.join(", "));
|
"Select the output format for the output file. Available formats: "_L1
|
||||||
outputFormatOption.setValueName("format");
|
+ outputFormats.join(", "_L1));
|
||||||
|
outputFormatOption.setValueName("format"_L1);
|
||||||
outputFormatOption.setDefaultValue(outputFormats.constFirst());
|
outputFormatOption.setDefaultValue(outputFormats.constFirst());
|
||||||
parser.addOption(outputFormatOption);
|
parser.addOption(outputFormatOption);
|
||||||
|
|
||||||
QCommandLineOption optionOption(QStringList{"o", "option"});
|
QCommandLineOption optionOption(QStringList{ "o"_L1, "option"_L1 });
|
||||||
optionOption.setDescription(QStringLiteral("Format-specific options. Use --format-options to find out what options are available."));
|
optionOption.setDescription(
|
||||||
optionOption.setValueName("options...");
|
"Format-specific options. Use --format-options to find out what options are available."_L1);
|
||||||
|
optionOption.setValueName("options..."_L1);
|
||||||
optionOption.setDefaultValues({});
|
optionOption.setDefaultValues({});
|
||||||
parser.addOption(optionOption);
|
parser.addOption(optionOption);
|
||||||
|
|
||||||
QCommandLineOption formatOptionsOption("format-options");
|
QCommandLineOption formatOptionsOption("format-options"_L1);
|
||||||
formatOptionsOption.setDescription(QStringLiteral("Prints the list of valid options for --option for the converter format <format>."));
|
formatOptionsOption.setDescription(
|
||||||
formatOptionsOption.setValueName("format");
|
"Prints the list of valid options for --option for the converter format <format>."_L1);
|
||||||
|
formatOptionsOption.setValueName("format"_L1);
|
||||||
parser.addOption(formatOptionsOption);
|
parser.addOption(formatOptionsOption);
|
||||||
|
|
||||||
parser.addPositionalArgument(QStringLiteral("[source]"),
|
parser.addPositionalArgument("[source]"_L1, "File to read from (stdin if none)"_L1);
|
||||||
QStringLiteral("File to read from (stdin if none)"));
|
parser.addPositionalArgument("[destination]"_L1, "File to write to (stdout if none)"_L1);
|
||||||
parser.addPositionalArgument(QStringLiteral("[destination]"),
|
|
||||||
QStringLiteral("File to write to (stdout if none)"));
|
|
||||||
|
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
|
||||||
if (parser.isSet(formatOptionsOption)) {
|
if (parser.isSet(formatOptionsOption)) {
|
||||||
QString format = parser.value(formatOptionsOption);
|
QString format = parser.value(formatOptionsOption);
|
||||||
for (Converter *conv : std::as_const(*availableConverters)) {
|
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||||
if (conv->name() == format) {
|
if (conv->name() == format) {
|
||||||
const char *help = conv->optionsHelp();
|
const char *help = conv->optionsHelp();
|
||||||
if (help)
|
if (help) {
|
||||||
printf("The following options are available for format '%s':\n\n%s", qPrintable(format), help);
|
printf("The following options are available for format '%s':\n\n%s",
|
||||||
else
|
qPrintable(format), help);
|
||||||
|
} else {
|
||||||
printf("Format '%s' supports no options.\n", qPrintable(format));
|
printf("Format '%s' supports no options.\n", qPrintable(format));
|
||||||
|
}
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,10 +103,10 @@ int main(int argc, char *argv[])
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter *inconv = nullptr;
|
const Converter *inconv = nullptr;
|
||||||
QString format = parser.value(inputFormatOption);
|
QString format = parser.value(inputFormatOption);
|
||||||
if (format != "auto") {
|
if (format != "auto"_L1) {
|
||||||
for (Converter *conv : std::as_const(*availableConverters)) {
|
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||||
if (conv->name() == format) {
|
if (conv->name() == format) {
|
||||||
inconv = conv;
|
inconv = conv;
|
||||||
break;
|
break;
|
||||||
@ -113,10 +119,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter *outconv = nullptr;
|
const Converter *outconv = nullptr;
|
||||||
format = parser.value(outputFormatOption);
|
format = parser.value(outputFormatOption);
|
||||||
if (format != "auto") {
|
if (format != "auto"_L1) {
|
||||||
for (Converter *conv : std::as_const(*availableConverters)) {
|
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||||
if (conv->name() == format) {
|
if (conv->name() == format) {
|
||||||
outconv = conv;
|
outconv = conv;
|
||||||
break;
|
break;
|
||||||
@ -155,8 +161,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!inconv) {
|
if (!inconv) {
|
||||||
// probe the input to find a file format
|
// probe the input to find a file format
|
||||||
for (Converter *conv : std::as_const(*availableConverters)) {
|
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||||
if (conv->directions() & Converter::In && conv->probeFile(&input)) {
|
if (conv->directions().testFlag(Converter::Direction::In)
|
||||||
|
&& conv->probeFile(&input)) {
|
||||||
inconv = conv;
|
inconv = conv;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -170,8 +177,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!outconv) {
|
if (!outconv) {
|
||||||
// probe the output to find a file format
|
// probe the output to find a file format
|
||||||
for (Converter *conv : std::as_const(*availableConverters)) {
|
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||||
if (conv->directions() & Converter::Out && conv->probeFile(&output)) {
|
if (conv->directions().testFlag(Converter::Direction::Out)
|
||||||
|
&& conv->probeFile(&output)) {
|
||||||
outconv = conv;
|
outconv = conv;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3,36 +3,38 @@
|
|||||||
|
|
||||||
#include "nullconverter.h"
|
#include "nullconverter.h"
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
static NullConverter nullConverter;
|
static NullConverter nullConverter;
|
||||||
Converter* Converter::null = &nullConverter;
|
Converter *Converter::null = &nullConverter;
|
||||||
|
|
||||||
QString NullConverter::name()
|
QString NullConverter::name() const
|
||||||
{
|
{
|
||||||
return QLatin1String("null");
|
return "null"_L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Direction NullConverter::directions()
|
Converter::Directions NullConverter::directions() const
|
||||||
{
|
{
|
||||||
return Out;
|
return Direction::Out;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Options NullConverter::outputOptions()
|
Converter::Options NullConverter::outputOptions() const
|
||||||
{
|
{
|
||||||
return SupportsArbitraryMapKeys;
|
return SupportsArbitraryMapKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *NullConverter::optionsHelp()
|
const char *NullConverter::optionsHelp() const
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NullConverter::probeFile(QIODevice *f)
|
bool NullConverter::probeFile(QIODevice *f) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(f);
|
Q_UNUSED(f);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant NullConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
QVariant NullConverter::loadFile(QIODevice *f, const Converter *&outputConverter) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(f);
|
Q_UNUSED(f);
|
||||||
Q_UNUSED(outputConverter);
|
Q_UNUSED(outputConverter);
|
||||||
@ -40,10 +42,12 @@ QVariant NullConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NullConverter::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options)
|
void NullConverter::saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const
|
||||||
{
|
{
|
||||||
if (!options.isEmpty()) {
|
if (!options.isEmpty()) {
|
||||||
fprintf(stderr, "Unknown option '%s' to null output. This format has no options.\n", qPrintable(options.first()));
|
fprintf(stderr, "Unknown option '%s' to null output. This format has no options.\n",
|
||||||
|
qPrintable(options.first()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,13 +10,14 @@ class NullConverter : public Converter
|
|||||||
{
|
{
|
||||||
// Converter interface
|
// Converter interface
|
||||||
public:
|
public:
|
||||||
QString name() override;
|
QString name() const override;
|
||||||
Direction directions() override;
|
Directions directions() const override;
|
||||||
Options outputOptions() override;
|
Options outputOptions() const override;
|
||||||
const char *optionsHelp() override;
|
const char *optionsHelp() const override;
|
||||||
bool probeFile(QIODevice *f) override;
|
bool probeFile(QIODevice *f) const override;
|
||||||
QVariant loadFile(QIODevice *f, Converter *&outputConverter) override;
|
QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const override;
|
||||||
void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) override;
|
void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NULLCONVERTER_H
|
#endif // NULLCONVERTER_H
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
static void dumpVariant(QTextStream &out, const QVariant &v)
|
static void dumpVariant(QTextStream &out, const QVariant &v)
|
||||||
{
|
{
|
||||||
switch (v.userType()) {
|
switch (v.userType()) {
|
||||||
@ -42,67 +44,62 @@ static void dumpVariant(QTextStream &out, const QVariant &v)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TextConverter::name()
|
QString TextConverter::name() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("text");
|
return "text"_L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Direction TextConverter::directions()
|
Converter::Directions TextConverter::directions() const
|
||||||
{
|
{
|
||||||
return InOut;
|
return Direction::InOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Options TextConverter::outputOptions()
|
Converter::Options TextConverter::outputOptions() const
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TextConverter::optionsHelp()
|
const char *TextConverter::optionsHelp() const
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextConverter::probeFile(QIODevice *f)
|
bool TextConverter::probeFile(QIODevice *f) const
|
||||||
{
|
{
|
||||||
if (QFile *file = qobject_cast<QFile *>(f))
|
if (QFile *file = qobject_cast<QFile *>(f))
|
||||||
return file->fileName().endsWith(QLatin1String(".txt"));
|
return file->fileName().endsWith(".txt"_L1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant TextConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
QVariant TextConverter::loadFile(QIODevice *f, const Converter *&outputConverter) const
|
||||||
{
|
{
|
||||||
if (!outputConverter)
|
if (!outputConverter)
|
||||||
outputConverter = this;
|
outputConverter = this;
|
||||||
|
|
||||||
QVariantList list;
|
QVariantList list;
|
||||||
QTextStream in(f);
|
QTextStream in(f);
|
||||||
QString line ;
|
QString line;
|
||||||
while (!in.atEnd()) {
|
while (!in.atEnd()) {
|
||||||
in.readLineInto(&line);
|
in.readLineInto(&line);
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
qint64 v = line.toLongLong(&ok);
|
|
||||||
if (ok) {
|
if (qint64 v = line.toLongLong(&ok); ok)
|
||||||
list.append(v);
|
list.append(v);
|
||||||
continue;
|
else if (double d = line.toDouble(&ok); ok)
|
||||||
}
|
|
||||||
|
|
||||||
double d = line.toDouble(&ok);
|
|
||||||
if (ok) {
|
|
||||||
list.append(d);
|
list.append(d);
|
||||||
continue;
|
else
|
||||||
}
|
list.append(line);
|
||||||
|
|
||||||
list.append(line);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextConverter::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options)
|
void TextConverter::saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const
|
||||||
{
|
{
|
||||||
if (!options.isEmpty()) {
|
if (!options.isEmpty()) {
|
||||||
fprintf(stderr, "Unknown option '%s' to text output. This format has no options.\n", qPrintable(options.first()));
|
fprintf(stderr, "Unknown option '%s' to text output. This format has no options.\n",
|
||||||
|
qPrintable(options.first()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,16 +8,16 @@
|
|||||||
|
|
||||||
class TextConverter : public Converter
|
class TextConverter : public Converter
|
||||||
{
|
{
|
||||||
|
|
||||||
// Converter interface
|
// Converter interface
|
||||||
public:
|
public:
|
||||||
QString name() override;
|
QString name() const override;
|
||||||
Direction directions() override;
|
Directions directions() const override;
|
||||||
Options outputOptions() override;
|
Options outputOptions() const override;
|
||||||
const char *optionsHelp() override;
|
const char *optionsHelp() const override;
|
||||||
bool probeFile(QIODevice *f) override;
|
bool probeFile(QIODevice *f) const override;
|
||||||
QVariant loadFile(QIODevice *f, Converter *&outputConverter) override;
|
QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const override;
|
||||||
void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) override;
|
void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TEXTCONVERTER_H
|
#endif // TEXTCONVERTER_H
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
|
|
||||||
static const char xmlOptionHelp[] =
|
using namespace Qt::StringLiterals;
|
||||||
"compact=no|yes Use compact XML form.\n";
|
|
||||||
|
static const char xmlOptionHelp[] = "compact=no|yes Use compact XML form.\n";
|
||||||
|
|
||||||
static XmlConverter xmlConverter;
|
static XmlConverter xmlConverter;
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ static QVariant variantFromXml(QXmlStreamReader &xml, Converter::Options options
|
|||||||
static QVariantList listFromXml(QXmlStreamReader &xml, Converter::Options options)
|
static QVariantList listFromXml(QXmlStreamReader &xml, Converter::Options options)
|
||||||
{
|
{
|
||||||
QVariantList list;
|
QVariantList list;
|
||||||
while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == QLatin1String("list"))) {
|
while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == "list"_L1)) {
|
||||||
xml.readNext();
|
xml.readNext();
|
||||||
switch (xml.tokenType()) {
|
switch (xml.tokenType()) {
|
||||||
case QXmlStreamReader::StartElement:
|
case QXmlStreamReader::StartElement:
|
||||||
@ -47,8 +48,7 @@ static QVariantList listFromXml(QXmlStreamReader &xml, Converter::Options option
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n",
|
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n", xml.lineNumber(), xml.columnNumber(),
|
||||||
xml.lineNumber(), xml.columnNumber(),
|
|
||||||
qPrintable(xml.tokenString()), qPrintable(xml.name().toString()));
|
qPrintable(xml.tokenString()), qPrintable(xml.name().toString()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -57,10 +57,11 @@ static QVariantList listFromXml(QXmlStreamReader &xml, Converter::Options option
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VariantOrderedMap::value_type mapEntryFromXml(QXmlStreamReader &xml, Converter::Options options)
|
static VariantOrderedMap::value_type mapEntryFromXml(QXmlStreamReader &xml,
|
||||||
|
Converter::Options options)
|
||||||
{
|
{
|
||||||
QVariant key, value;
|
QVariant key, value;
|
||||||
while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == QLatin1String("entry"))) {
|
while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == "entry"_L1)) {
|
||||||
xml.readNext();
|
xml.readNext();
|
||||||
switch (xml.tokenType()) {
|
switch (xml.tokenType()) {
|
||||||
case QXmlStreamReader::StartElement:
|
case QXmlStreamReader::StartElement:
|
||||||
@ -89,8 +90,7 @@ static VariantOrderedMap::value_type mapEntryFromXml(QXmlStreamReader &xml, Conv
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n",
|
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n", xml.lineNumber(), xml.columnNumber(),
|
||||||
xml.lineNumber(), xml.columnNumber(),
|
|
||||||
qPrintable(xml.tokenString()), qPrintable(xml.name().toString()));
|
qPrintable(xml.tokenString()), qPrintable(xml.name().toString()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -103,11 +103,11 @@ static QVariant mapFromXml(QXmlStreamReader &xml, Converter::Options options)
|
|||||||
QVariantMap map1;
|
QVariantMap map1;
|
||||||
VariantOrderedMap map2;
|
VariantOrderedMap map2;
|
||||||
|
|
||||||
while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == QLatin1String("map"))) {
|
while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == "map"_L1)) {
|
||||||
xml.readNext();
|
xml.readNext();
|
||||||
switch (xml.tokenType()) {
|
switch (xml.tokenType()) {
|
||||||
case QXmlStreamReader::StartElement:
|
case QXmlStreamReader::StartElement:
|
||||||
if (xml.name() == QLatin1String("entry")) {
|
if (xml.name() == "entry"_L1) {
|
||||||
auto pair = mapEntryFromXml(xml, options);
|
auto pair = mapEntryFromXml(xml, options);
|
||||||
if (options & Converter::SupportsArbitraryMapKeys)
|
if (options & Converter::SupportsArbitraryMapKeys)
|
||||||
map2.append(pair);
|
map2.append(pair);
|
||||||
@ -134,8 +134,7 @@ static QVariant mapFromXml(QXmlStreamReader &xml, Converter::Options options)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n",
|
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n", xml.lineNumber(), xml.columnNumber(),
|
||||||
xml.lineNumber(), xml.columnNumber(),
|
|
||||||
qPrintable(xml.tokenString()), qPrintable(xml.name().toString()));
|
qPrintable(xml.tokenString()), qPrintable(xml.name().toString()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -149,18 +148,18 @@ static QVariant mapFromXml(QXmlStreamReader &xml, Converter::Options options)
|
|||||||
static QVariant variantFromXml(QXmlStreamReader &xml, Converter::Options options)
|
static QVariant variantFromXml(QXmlStreamReader &xml, Converter::Options options)
|
||||||
{
|
{
|
||||||
QStringView name = xml.name();
|
QStringView name = xml.name();
|
||||||
if (name == QLatin1String("list"))
|
if (name == "list"_L1)
|
||||||
return listFromXml(xml, options);
|
return listFromXml(xml, options);
|
||||||
if (name == QLatin1String("map"))
|
if (name == "map"_L1)
|
||||||
return mapFromXml(xml, options);
|
return mapFromXml(xml, options);
|
||||||
if (name != QLatin1String("value")) {
|
if (name != "value"_L1) {
|
||||||
fprintf(stderr, "%lld:%lld: Invalid XML key '%s'.\n",
|
fprintf(stderr, "%lld:%lld: Invalid XML key '%s'.\n",
|
||||||
xml.lineNumber(), xml.columnNumber(), qPrintable(name.toString()));
|
xml.lineNumber(), xml.columnNumber(), qPrintable(name.toString()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
QXmlStreamAttributes attrs = xml.attributes();
|
QXmlStreamAttributes attrs = xml.attributes();
|
||||||
QStringView type = attrs.value(QLatin1String("type"));
|
QStringView type = attrs.value("type"_L1);
|
||||||
|
|
||||||
forever {
|
forever {
|
||||||
xml.readNext();
|
xml.readNext();
|
||||||
@ -169,8 +168,7 @@ static QVariant variantFromXml(QXmlStreamReader &xml, Converter::Options options
|
|||||||
if (xml.isCDATA() || xml.isCharacters() || xml.isEndElement())
|
if (xml.isCDATA() || xml.isCharacters() || xml.isEndElement())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n",
|
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n", xml.lineNumber(), xml.columnNumber(),
|
||||||
xml.lineNumber(), xml.columnNumber(),
|
|
||||||
qPrintable(xml.tokenString()), qPrintable(name.toString()));
|
qPrintable(xml.tokenString()), qPrintable(name.toString()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -180,45 +178,45 @@ static QVariant variantFromXml(QXmlStreamReader &xml, Converter::Options options
|
|||||||
text = text.trimmed();
|
text = text.trimmed();
|
||||||
|
|
||||||
QVariant result;
|
QVariant result;
|
||||||
bool ok;
|
|
||||||
if (type.isEmpty()) {
|
if (type.isEmpty()) {
|
||||||
// ok
|
// ok
|
||||||
} else if (type == QLatin1String("number")) {
|
} else if (type == "number"_L1) {
|
||||||
// try integer first
|
// try integer first
|
||||||
|
bool ok;
|
||||||
qint64 v = text.toLongLong(&ok);
|
qint64 v = text.toLongLong(&ok);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
result = v;
|
result = v;
|
||||||
} else {
|
} else {
|
||||||
// let's see floating point
|
// let's see floating point
|
||||||
double d = text.toDouble(&ok);
|
double d = text.toDouble(&ok);
|
||||||
result = d;
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
fprintf(stderr, "%lld:%lld: Invalid XML: could not interpret '%s' as a number.\n",
|
fprintf(stderr, "%lld:%lld: Invalid XML: could not interpret '%s' as a number.\n",
|
||||||
xml.lineNumber(), xml.columnNumber(), qPrintable(text.toString()));
|
xml.lineNumber(), xml.columnNumber(), qPrintable(text.toString()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
result = d;
|
||||||
}
|
}
|
||||||
} else if (type == QLatin1String("bytes")) {
|
} else if (type == "bytes"_L1) {
|
||||||
QByteArray data = text.toLatin1();
|
QByteArray data = text.toLatin1();
|
||||||
QStringView encoding = attrs.value("encoding");
|
QStringView encoding = attrs.value("encoding");
|
||||||
if (encoding == QLatin1String("base64url")) {
|
if (encoding == "base64url"_L1) {
|
||||||
result = QByteArray::fromBase64(data, QByteArray::Base64UrlEncoding);
|
result = QByteArray::fromBase64(data, QByteArray::Base64UrlEncoding);
|
||||||
} else if (encoding == QLatin1String("hex")) {
|
} else if (encoding == "hex"_L1) {
|
||||||
result = QByteArray::fromHex(data);
|
result = QByteArray::fromHex(data);
|
||||||
} else if (encoding.isEmpty() || encoding == QLatin1String("base64")) {
|
} else if (encoding.isEmpty() || encoding == "base64"_L1) {
|
||||||
result = QByteArray::fromBase64(data);
|
result = QByteArray::fromBase64(data);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "%lld:%lld: Invalid XML: unknown encoding '%s' for bytes.\n",
|
fprintf(stderr, "%lld:%lld: Invalid XML: unknown encoding '%s' for bytes.\n",
|
||||||
xml.lineNumber(), xml.columnNumber(), qPrintable(encoding.toString()));
|
xml.lineNumber(), xml.columnNumber(), qPrintable(encoding.toString()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if (type == QLatin1String("string")) {
|
} else if (type == "string"_L1) {
|
||||||
result = text.toString();
|
result = text.toString();
|
||||||
} else if (type == QLatin1String("null")) {
|
} else if (type == "null"_L1) {
|
||||||
result = QVariant::fromValue(nullptr);
|
result = QVariant::fromValue(nullptr);
|
||||||
} else if (type == QLatin1String("CBOR simple type")) {
|
} else if (type == "CBOR simple type"_L1) {
|
||||||
result = QVariant::fromValue(QCborSimpleType(text.toShort()));
|
result = QVariant::fromValue(QCborSimpleType(text.toShort()));
|
||||||
} else if (type == QLatin1String("bits")) {
|
} else if (type == "bits"_L1) {
|
||||||
QBitArray ba;
|
QBitArray ba;
|
||||||
ba.resize(text.size());
|
ba.resize(text.size());
|
||||||
qsizetype n = 0;
|
qsizetype n = 0;
|
||||||
@ -238,13 +236,13 @@ static QVariant variantFromXml(QXmlStreamReader &xml, Converter::Options options
|
|||||||
result = ba;
|
result = ba;
|
||||||
} else {
|
} else {
|
||||||
int id = QMetaType::UnknownType;
|
int id = QMetaType::UnknownType;
|
||||||
if (type == QLatin1String("datetime"))
|
if (type == "datetime"_L1)
|
||||||
id = QMetaType::QDateTime;
|
id = QMetaType::QDateTime;
|
||||||
else if (type == QLatin1String("url"))
|
else if (type == "url"_L1)
|
||||||
id = QMetaType::QUrl;
|
id = QMetaType::QUrl;
|
||||||
else if (type == QLatin1String("uuid"))
|
else if (type == "uuid"_L1)
|
||||||
id = QMetaType::QUuid;
|
id = QMetaType::QUuid;
|
||||||
else if (type == QLatin1String("regex"))
|
else if (type == "regex"_L1)
|
||||||
id = QMetaType::QRegularExpression;
|
id = QMetaType::QRegularExpression;
|
||||||
else
|
else
|
||||||
id = QMetaType::fromName(type.toLatin1()).id();
|
id = QMetaType::fromName(type.toLatin1()).id();
|
||||||
@ -267,8 +265,7 @@ static QVariant variantFromXml(QXmlStreamReader &xml, Converter::Options options
|
|||||||
} while (xml.isComment() || xml.isWhitespace());
|
} while (xml.isComment() || xml.isWhitespace());
|
||||||
|
|
||||||
if (!xml.isEndElement()) {
|
if (!xml.isEndElement()) {
|
||||||
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n",
|
fprintf(stderr, "%lld:%lld: Invalid XML %s '%s'.\n", xml.lineNumber(), xml.columnNumber(),
|
||||||
xml.lineNumber(), xml.columnNumber(),
|
|
||||||
qPrintable(xml.tokenString()), qPrintable(name.toString()));
|
qPrintable(xml.tokenString()), qPrintable(name.toString()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -287,9 +284,9 @@ static void variantToXml(QXmlStreamWriter &xml, const QVariant &v)
|
|||||||
variantToXml(xml, v);
|
variantToXml(xml, v);
|
||||||
xml.writeEndElement();
|
xml.writeEndElement();
|
||||||
} else if (type == QMetaType::QVariantMap || type == qMetaTypeId<VariantOrderedMap>()) {
|
} else if (type == QMetaType::QVariantMap || type == qMetaTypeId<VariantOrderedMap>()) {
|
||||||
const VariantOrderedMap map = (type == QMetaType::QVariantMap) ?
|
const VariantOrderedMap map = (type == QMetaType::QVariantMap)
|
||||||
VariantOrderedMap(v.toMap()) :
|
? VariantOrderedMap(v.toMap())
|
||||||
qvariant_cast<VariantOrderedMap>(v);
|
: qvariant_cast<VariantOrderedMap>(v);
|
||||||
|
|
||||||
xml.writeStartElement("map");
|
xml.writeStartElement("map");
|
||||||
for (const auto &pair : map) {
|
for (const auto &pair : map) {
|
||||||
@ -301,7 +298,7 @@ static void variantToXml(QXmlStreamWriter &xml, const QVariant &v)
|
|||||||
xml.writeEndElement();
|
xml.writeEndElement();
|
||||||
} else {
|
} else {
|
||||||
xml.writeStartElement("value");
|
xml.writeStartElement("value");
|
||||||
QString typeString = QStringLiteral("type");
|
QString typeString = "type"_L1;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QMetaType::Short:
|
case QMetaType::Short:
|
||||||
case QMetaType::UShort:
|
case QMetaType::UShort:
|
||||||
@ -399,37 +396,37 @@ static void variantToXml(QXmlStreamWriter &xml, const QVariant &v)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString XmlConverter::name()
|
QString XmlConverter::name() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("xml");
|
return "xml"_L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Direction XmlConverter::directions()
|
Converter::Directions XmlConverter::directions() const
|
||||||
{
|
{
|
||||||
return InOut;
|
return Direction::InOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
Converter::Options XmlConverter::outputOptions()
|
Converter::Options XmlConverter::outputOptions() const
|
||||||
{
|
{
|
||||||
return SupportsArbitraryMapKeys;
|
return SupportsArbitraryMapKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *XmlConverter::optionsHelp()
|
const char *XmlConverter::optionsHelp() const
|
||||||
{
|
{
|
||||||
return xmlOptionHelp;
|
return xmlOptionHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool XmlConverter::probeFile(QIODevice *f)
|
bool XmlConverter::probeFile(QIODevice *f) const
|
||||||
{
|
{
|
||||||
if (QFile *file = qobject_cast<QFile *>(f)) {
|
if (QFile *file = qobject_cast<QFile *>(f)) {
|
||||||
if (file->fileName().endsWith(QLatin1String(".xml")))
|
if (file->fileName().endsWith(".xml"_L1))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return f->isReadable() && f->peek(5) == "<?xml";
|
return f->isReadable() && f->peek(5) == "<?xml";
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant XmlConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
QVariant XmlConverter::loadFile(QIODevice *f, const Converter *&outputConverter) const
|
||||||
{
|
{
|
||||||
if (!outputConverter)
|
if (!outputConverter)
|
||||||
outputConverter = this;
|
outputConverter = this;
|
||||||
@ -445,13 +442,14 @@ QVariant XmlConverter::loadFile(QIODevice *f, Converter *&outputConverter)
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XmlConverter::saveFile(QIODevice *f, const QVariant &contents, const QStringList &options)
|
void XmlConverter::saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const
|
||||||
{
|
{
|
||||||
bool compact = false;
|
bool compact = false;
|
||||||
for (const QString &s : options) {
|
for (const QString &s : options) {
|
||||||
if (s == QLatin1String("compact=no")) {
|
if (s == "compact=no"_L1) {
|
||||||
compact = false;
|
compact = false;
|
||||||
} else if (s == QLatin1String("compact=yes")) {
|
} else if (s == "compact=yes"_L1) {
|
||||||
compact = true;
|
compact = true;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown option '%s' to XML output. Valid options are:\n%s",
|
fprintf(stderr, "Unknown option '%s' to XML output. Valid options are:\n%s",
|
||||||
|
@ -10,13 +10,14 @@ class XmlConverter : public Converter
|
|||||||
{
|
{
|
||||||
// Converter interface
|
// Converter interface
|
||||||
public:
|
public:
|
||||||
QString name() override;
|
QString name() const override;
|
||||||
Direction directions() override;
|
Directions directions() const override;
|
||||||
Options outputOptions() override;
|
Options outputOptions() const override;
|
||||||
const char *optionsHelp() override;
|
const char *optionsHelp() const override;
|
||||||
bool probeFile(QIODevice *f) override;
|
bool probeFile(QIODevice *f) const override;
|
||||||
QVariant loadFile(QIODevice *f, Converter *&outputConverter) override;
|
QVariant loadFile(QIODevice *f, const Converter *&outputConverter) const override;
|
||||||
void saveFile(QIODevice *f, const QVariant &contents, const QStringList &options) override;
|
void saveFile(QIODevice *f, const QVariant &contents,
|
||||||
|
const QStringList &options) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XMLCONVERTER_H
|
#endif // XMLCONVERTER_H
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(savegame LANGUAGES CXX)
|
project(savegame LANGUAGES CXX)
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
|
message(FATAL_ERROR "This project cannot be built on Android.")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
||||||
set(INSTALL_EXAMPLESDIR "examples")
|
set(INSTALL_EXAMPLESDIR "examples")
|
||||||
endif()
|
endif()
|
||||||
|
@ -6,15 +6,10 @@
|
|||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
Character::Character()
|
Character::Character() = default;
|
||||||
= default;
|
|
||||||
|
|
||||||
Character::Character(const QString &name,
|
Character::Character(const QString &name, int level, Character::ClassType classType)
|
||||||
int level,
|
: mName(name), mLevel(level), mClassType(classType)
|
||||||
Character::ClassType classType) :
|
|
||||||
mName(name),
|
|
||||||
mLevel(level),
|
|
||||||
mClassType(classType)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,7 @@ class Character
|
|||||||
Q_GADGET
|
Q_GADGET
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum ClassType {
|
enum ClassType { Warrior, Mage, Archer };
|
||||||
Warrior, Mage, Archer
|
|
||||||
};
|
|
||||||
Q_ENUM(ClassType)
|
Q_ENUM(ClassType)
|
||||||
|
|
||||||
Character();
|
Character();
|
||||||
@ -37,6 +35,7 @@ public:
|
|||||||
QJsonObject toJson() const;
|
QJsonObject toJson() const;
|
||||||
|
|
||||||
void print(QTextStream &s, int indentation = 0) const;
|
void print(QTextStream &s, int indentation = 0) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
QString mName;
|
||||||
int mLevel = 0;
|
int mLevel = 0;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\example serialization/savegame
|
\example serialization/savegame
|
||||||
\examplecategory {Input/Output}
|
\examplecategory {Data Processing & I/O}
|
||||||
\title JSON Save Game Example
|
\title JSON Save Game Example
|
||||||
|
|
||||||
\brief The JSON Save Game example demonstrates how to save and load a
|
\brief The JSON Save Game example demonstrates how to save and load a
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include <QRandomGenerator>
|
#include <QRandomGenerator>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
Character Game::player() const
|
Character Game::player() const
|
||||||
{
|
{
|
||||||
return mPlayer;
|
return mPlayer;
|
||||||
@ -25,37 +27,32 @@ QList<Level> Game::levels() const
|
|||||||
void Game::newGame()
|
void Game::newGame()
|
||||||
{
|
{
|
||||||
mPlayer = Character();
|
mPlayer = Character();
|
||||||
mPlayer.setName(QStringLiteral("Hero"));
|
mPlayer.setName("Hero"_L1);
|
||||||
mPlayer.setClassType(Character::Archer);
|
mPlayer.setClassType(Character::Archer);
|
||||||
mPlayer.setLevel(QRandomGenerator::global()->bounded(15, 21));
|
mPlayer.setLevel(QRandomGenerator::global()->bounded(15, 21));
|
||||||
|
|
||||||
mLevels.clear();
|
mLevels.clear();
|
||||||
mLevels.reserve(2);
|
mLevels.reserve(2);
|
||||||
|
|
||||||
Level village(QStringLiteral("Village"));
|
Level village("Village"_L1);
|
||||||
QList<Character> villageNpcs;
|
QList<Character> villageNpcs;
|
||||||
villageNpcs.reserve(2);
|
villageNpcs.reserve(2);
|
||||||
villageNpcs.append(Character(QStringLiteral("Barry the Blacksmith"),
|
villageNpcs.append(Character("Barry the Blacksmith"_L1,
|
||||||
QRandomGenerator::global()->bounded(8, 11),
|
QRandomGenerator::global()->bounded(8, 11), Character::Warrior));
|
||||||
Character::Warrior));
|
villageNpcs.append(Character("Terry the Trader"_L1,
|
||||||
villageNpcs.append(Character(QStringLiteral("Terry the Trader"),
|
QRandomGenerator::global()->bounded(6, 8), Character::Warrior));
|
||||||
QRandomGenerator::global()->bounded(6, 8),
|
|
||||||
Character::Warrior));
|
|
||||||
village.setNpcs(villageNpcs);
|
village.setNpcs(villageNpcs);
|
||||||
mLevels.append(village);
|
mLevels.append(village);
|
||||||
|
|
||||||
Level dungeon(QStringLiteral("Dungeon"));
|
Level dungeon("Dungeon"_L1);
|
||||||
QList<Character> dungeonNpcs;
|
QList<Character> dungeonNpcs;
|
||||||
dungeonNpcs.reserve(3);
|
dungeonNpcs.reserve(3);
|
||||||
dungeonNpcs.append(Character(QStringLiteral("Eric the Evil"),
|
dungeonNpcs.append(Character("Eric the Evil"_L1,
|
||||||
QRandomGenerator::global()->bounded(18, 26),
|
QRandomGenerator::global()->bounded(18, 26), Character::Mage));
|
||||||
Character::Mage));
|
dungeonNpcs.append(Character("Eric's Left Minion"_L1,
|
||||||
dungeonNpcs.append(Character(QStringLiteral("Eric's Left Minion"),
|
QRandomGenerator::global()->bounded(5, 7), Character::Warrior));
|
||||||
QRandomGenerator::global()->bounded(5, 7),
|
dungeonNpcs.append(Character("Eric's Right Minion"_L1,
|
||||||
Character::Warrior));
|
QRandomGenerator::global()->bounded(4, 9), Character::Warrior));
|
||||||
dungeonNpcs.append(Character(QStringLiteral("Eric's Right Minion"),
|
|
||||||
QRandomGenerator::global()->bounded(4, 9),
|
|
||||||
Character::Warrior));
|
|
||||||
dungeon.setNpcs(dungeonNpcs);
|
dungeon.setNpcs(dungeonNpcs);
|
||||||
mLevels.append(dungeon);
|
mLevels.append(dungeon);
|
||||||
}
|
}
|
||||||
@ -64,9 +61,7 @@ void Game::newGame()
|
|||||||
//! [loadGame]
|
//! [loadGame]
|
||||||
bool Game::loadGame(Game::SaveFormat saveFormat)
|
bool Game::loadGame(Game::SaveFormat saveFormat)
|
||||||
{
|
{
|
||||||
QFile loadFile(saveFormat == Json
|
QFile loadFile(saveFormat == Json ? "save.json"_L1 : "save.dat"_L1);
|
||||||
? QStringLiteral("save.json")
|
|
||||||
: QStringLiteral("save.dat"));
|
|
||||||
|
|
||||||
if (!loadFile.open(QIODevice::ReadOnly)) {
|
if (!loadFile.open(QIODevice::ReadOnly)) {
|
||||||
qWarning("Couldn't open save file.");
|
qWarning("Couldn't open save file.");
|
||||||
@ -76,15 +71,13 @@ bool Game::loadGame(Game::SaveFormat saveFormat)
|
|||||||
QByteArray saveData = loadFile.readAll();
|
QByteArray saveData = loadFile.readAll();
|
||||||
|
|
||||||
QJsonDocument loadDoc(saveFormat == Json
|
QJsonDocument loadDoc(saveFormat == Json
|
||||||
? QJsonDocument::fromJson(saveData)
|
? QJsonDocument::fromJson(saveData)
|
||||||
: QJsonDocument(QCborValue::fromCbor(saveData).toMap().toJsonObject()));
|
: QJsonDocument(QCborValue::fromCbor(saveData).toMap().toJsonObject()));
|
||||||
|
|
||||||
read(loadDoc.object());
|
read(loadDoc.object());
|
||||||
|
|
||||||
QTextStream(stdout) << "Loaded save for "
|
QTextStream(stdout) << "Loaded save for " << loadDoc["player"]["name"].toString()
|
||||||
<< loadDoc["player"]["name"].toString()
|
<< " using " << (saveFormat != Json ? "CBOR" : "JSON") << "...\n";
|
||||||
<< " using "
|
|
||||||
<< (saveFormat != Json ? "CBOR" : "JSON") << "...\n";
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//! [loadGame]
|
//! [loadGame]
|
||||||
@ -92,9 +85,7 @@ bool Game::loadGame(Game::SaveFormat saveFormat)
|
|||||||
//! [saveGame]
|
//! [saveGame]
|
||||||
bool Game::saveGame(Game::SaveFormat saveFormat) const
|
bool Game::saveGame(Game::SaveFormat saveFormat) const
|
||||||
{
|
{
|
||||||
QFile saveFile(saveFormat == Json
|
QFile saveFile(saveFormat == Json ? "save.json"_L1 : "save.dat"_L1);
|
||||||
? QStringLiteral("save.json")
|
|
||||||
: QStringLiteral("save.dat"));
|
|
||||||
|
|
||||||
if (!saveFile.open(QIODevice::WriteOnly)) {
|
if (!saveFile.open(QIODevice::WriteOnly)) {
|
||||||
qWarning("Couldn't open save file.");
|
qWarning("Couldn't open save file.");
|
||||||
@ -102,9 +93,8 @@ bool Game::saveGame(Game::SaveFormat saveFormat) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject gameObject = toJson();
|
QJsonObject gameObject = toJson();
|
||||||
saveFile.write(saveFormat == Json
|
saveFile.write(saveFormat == Json ? QJsonDocument(gameObject).toJson()
|
||||||
? QJsonDocument(gameObject).toJson()
|
: QCborValue::fromJsonValue(gameObject).toCbor());
|
||||||
: QCborValue::fromJsonValue(gameObject).toCbor());
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,7 @@ QT_FORWARD_DECLARE_CLASS(QTextStream)
|
|||||||
class Game
|
class Game
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum SaveFormat {
|
enum SaveFormat { Json, Binary };
|
||||||
Json, Binary
|
|
||||||
};
|
|
||||||
|
|
||||||
Character player() const;
|
Character player() const;
|
||||||
QList<Level> levels() const;
|
QList<Level> levels() const;
|
||||||
@ -31,6 +29,7 @@ public:
|
|||||||
QJsonObject toJson() const;
|
QJsonObject toJson() const;
|
||||||
|
|
||||||
void print(QTextStream &s, int indentation = 0) const;
|
void print(QTextStream &s, int indentation = 0) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Character mPlayer;
|
Character mPlayer;
|
||||||
QList<Level> mLevels;
|
QList<Level> mLevels;
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
Level::Level(const QString &name) : mName(name)
|
Level::Level(const QString &name) : mName(name) { }
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Level::name() const
|
QString Level::name() const
|
||||||
{
|
{
|
||||||
@ -61,8 +59,7 @@ void Level::print(QTextStream &s, int indentation) const
|
|||||||
{
|
{
|
||||||
const QString indent(indentation * 2, ' ');
|
const QString indent(indentation * 2, ' ');
|
||||||
|
|
||||||
s << indent << "Name:\t" << mName << "\n"
|
s << indent << "Name:\t" << mName << "\n" << indent << "NPCs:\n";
|
||||||
<< indent << "NPCs:\n";
|
|
||||||
for (const Character &character : mNpcs)
|
for (const Character &character : mNpcs)
|
||||||
character.print(s, indentation + 1);
|
character.print(s, indentation + 1);
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ public:
|
|||||||
QJsonObject toJson() const;
|
QJsonObject toJson() const;
|
||||||
|
|
||||||
void print(QTextStream &s, int indentation = 0) const;
|
void print(QTextStream &s, int indentation = 0) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
QString mName;
|
||||||
QList<Character> mNpcs;
|
QList<Character> mNpcs;
|
||||||
|
@ -6,6 +6,4 @@ SUBDIRS = \
|
|||||||
|
|
||||||
qtHaveModule(widgets) {
|
qtHaveModule(widgets) {
|
||||||
SUBDIRS += streambookmarks
|
SUBDIRS += streambookmarks
|
||||||
qtHaveModule(network): SUBDIRS += \
|
|
||||||
rsslisting
|
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user