blob: 071711a5bd57a9d6798ba70e7a652f85ce911490 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LINUX 1)
else()
set(LINUX 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "HPUX")
set(HPUX 1)
else()
set(HPUX 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(ANDROID 1)
else()
set(ANDROID 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Integrity")
set(INTEGRITY 1)
else()
set(INTEGRITY 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "VxWorks")
set(VXWORKS 1)
else()
set(VXWORKS 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(QNX 1)
else()
set(QNX 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(OPENBSD 1)
else()
set(OPENBSD 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(FREEBSD 1)
else()
set(FREEBSD 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(NETBSD 1)
else()
set(NETBSD 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR EMSCRIPTEN)
set(WASM 1)
else()
set(WASM 0)
endif()
if(QT_QMAKE_TARGET_MKSPEC STREQUAL "wasm-emscripten-64")
set(WASM64 1)
else()
set(WASM64 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(SOLARIS 1)
else()
set(SOLARIS 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "GNU")
set(HURD 1)
else()
set(HURD 0)
endif()
# This is the only reliable way we can determine the webOS platform as the yocto recipe adds this
# compile definition into its generated toolchain.cmake file
if(CMAKE_CXX_FLAGS MATCHES "-D__WEBOS__")
set(WEBOS 1)
else()
set(WEBOS 0)
endif()
if(APPLE OR OPENBSD OR FREEBSD OR NETBSD)
set(BSD 1)
else()
set(BSD 0)
endif()
if(APPLE)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(IOS 1)
else()
set(IOS 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "tvOS")
set(TVOS 1)
else()
set(TVOS 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "watchOS")
set(WATCHOS 1)
else()
set(WATCHOS 0)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "visionOS")
set(VISIONOS 1)
else()
set(VISIONOS 0)
endif()
if(IOS OR TVOS OR WATCHOS OR VISIONOS)
set(UIKIT 1)
set(MACOS 0)
else()
set(UIKIT 0)
set(MACOS 1)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(GCC 1)
else()
set(GCC 0)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM")
set(CLANG 1)
else()
set(CLANG 0)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
set(APPLECLANG 1)
else()
set(APPLECLANG 0)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
set(IntelLLVM 1)
else()
set(IntelLLVM 0)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "QCC")
set(QCC 1)
else()
set(QCC 0)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(QT_64BIT TRUE)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(QT_32BIT TRUE)
endif()
# Parses a version string like "xx.yy.zz" and sets the major, minor and patch variables.
function(qt_parse_version_string version_string out_var_prefix)
string(REPLACE "." ";" version_list ${version_string})
list(LENGTH version_list length)
set(out_var "${out_var_prefix}_MAJOR")
set(value "")
if(length GREATER 0)
list(GET version_list 0 value)
list(REMOVE_AT version_list 0)
math(EXPR length "${length}-1")
endif()
set(${out_var} "${value}" PARENT_SCOPE)
set(out_var "${out_var_prefix}_MINOR")
set(value "")
if(length GREATER 0)
list(GET version_list 0 value)
set(${out_var} "${value}" PARENT_SCOPE)
list(REMOVE_AT version_list 0)
math(EXPR length "${length}-1")
endif()
set(${out_var} "${value}" PARENT_SCOPE)
set(out_var "${out_var_prefix}_PATCH")
set(value "")
if(length GREATER 0)
list(GET version_list 0 value)
set(${out_var} "${value}" PARENT_SCOPE)
list(REMOVE_AT version_list 0)
math(EXPR length "${length}-1")
endif()
set(${out_var} "${value}" PARENT_SCOPE)
endfunction()
# Set up the separate version components for the compiler version, to allow mapping of qmake
# conditions like 'equals(QT_GCC_MAJOR_VERSION,5)'.
if(CMAKE_CXX_COMPILER_VERSION)
qt_parse_version_string("${CMAKE_CXX_COMPILER_VERSION}" "QT_COMPILER_VERSION")
endif()
|