[1671] | 1 | # $Id: qt6.kmk 3593 2023-05-19 10:39:04Z bird $
|
---|
| 2 | ## @file
|
---|
[3557] | 3 | # Qt 6 unit.
|
---|
[1671] | 4 | #
|
---|
| 5 |
|
---|
| 6 | #
|
---|
[3557] | 7 | # Copyright (c) 2008-2022 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
|
---|
[1671] | 8 | #
|
---|
| 9 | # This file is part of kBuild.
|
---|
| 10 | #
|
---|
| 11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
| 12 | # it under the terms of the GNU General Public License as published by
|
---|
| 13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 14 | # (at your option) any later version.
|
---|
| 15 | #
|
---|
| 16 | # kBuild is distributed in the hope that it will be useful,
|
---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | # GNU General Public License for more details.
|
---|
| 20 | #
|
---|
| 21 | # You should have received a copy of the GNU General Public License
|
---|
| 22 | # along with kBuild; if not, write to the Free Software
|
---|
| 23 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
| 24 | #
|
---|
| 25 | #
|
---|
[2018] | 26 | # As a special exception you are granted permission to include this file, via
|
---|
| 27 | # the kmk include directive, as you wish without this in itself causing the
|
---|
| 28 | # resulting makefile, program or whatever to be covered by the GPL license.
|
---|
| 29 | # This exception does not however invalidate any other reasons why the makefile,
|
---|
| 30 | # program, whatever should not be covered the GPL.
|
---|
| 31 | #
|
---|
| 32 | #
|
---|
[1671] | 33 |
|
---|
[2018] | 34 |
|
---|
[3557] | 35 | ifdef UNIT_qt6
|
---|
| 36 | $(error kBuild: The qt6 unit was included twice!)
|
---|
[1682] | 37 | endif
|
---|
[3557] | 38 | UNIT_qt6 = qt6
|
---|
[1671] | 39 |
|
---|
| 40 |
|
---|
[2805] | 41 | if !defined(UNIT_qt3) && !defined(UNIT_qt4)
|
---|
| 42 | # Add our target properties (same as qt3 & qt4).
|
---|
[1682] | 43 | PROPS_SINGLE += QTTOOL MOCTOOL UICTOOL LRCTOOL QT_TRANSLATIONS_INST QT_TRANSLATIONS_TEMPLATE QT_PREFIX
|
---|
| 44 | PROPS_ACCUMULATE_R += MOCDEFS MOCFLAGS UICFLAGS LRCFLAGS QT_TRANSLATIONS QT_MOCSRCS QT_MOCHDRS
|
---|
| 45 | endif
|
---|
[2176] | 46 | PROPS_SINGLE += RCCTOOL QT_INFIX
|
---|
[1682] | 47 | PROPS_ACCUMULATE_R += RCCFLAGS QT_MODULES
|
---|
[1671] | 48 |
|
---|
[1682] | 49 |
|
---|
[1769] | 50 | ## @todo use pkg-config?
|
---|
| 51 |
|
---|
[1671] | 52 | #
|
---|
[3557] | 53 | # The QT6 SDK.
|
---|
[1671] | 54 | #
|
---|
[3557] | 55 | # This is implemented here rather than in sdks/QT6.kmk to enforce the global USES.
|
---|
[1671] | 56 | # It also makes things easier to develop, with fewer files I mean.
|
---|
| 57 | #
|
---|
[1677] | 58 | ## @todo the SDK might actually not be necessary as it turns out... For now it servers
|
---|
| 59 | # a purpose if the host differs from the target, in theory at least.
|
---|
[3557] | 60 | SDK_QT6 = Qt6
|
---|
[1671] | 61 |
|
---|
[1677] | 62 | # SDK Specific Properties
|
---|
[3557] | 63 | # PATH_SDK_QT6 - The general Qt6 root directory.
|
---|
| 64 | # PATH_SDK_QT6_INC - The include directory.
|
---|
| 65 | # PATH_SDK_QT6_LIB.amd64 - The lib directory for AMD64.
|
---|
| 66 | # PATH_SDK_QT6_LIB.x86 - The lib directory for X86.
|
---|
| 67 | # PATH_SDK_QT6_LIB - The lib directory for KBUILD_TARGET.
|
---|
| 68 | ifndef PATH_SDK_QT6
|
---|
| 69 | PATH_SDK_QT6 := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_TRG)/qt/v6*)))
|
---|
| 70 | ifeq ($(PATH_SDK_QT6),)
|
---|
[1677] | 71 | # If target == host, try look for Qt in the various platform specific places.
|
---|
| 72 | ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
|
---|
| 73 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
[3557] | 74 | PATH_SDK_QT6 := $(patsubst %/Frameworks/QtCore.framework/Versions/6,%,$(firstword $(wildcard /Library/Frameworks/QtCore.framework/Versions/6)))
|
---|
[1677] | 75 | else ifeq ($(KBUILD_TARGET),win)
|
---|
| 76 | # No idea here yet...
|
---|
[1767] | 77 | else ifeq ($(KBUILD_TARGET),ose)
|
---|
| 78 | # No port...
|
---|
[1677] | 79 | else
|
---|
[3557] | 80 | # The Unices. Includes and esp. libs are tricky, so override the PATH_SDK_QT6_LIB* stuff if it doesn't work.
|
---|
| 81 | # Try find the general root of thing by looking for the rcc program, as there seems to be no qt6 specific one to look for.
|
---|
| 82 | PATH_SDK_QT6 := $(patsubst %/bin/rcc-qt6,%,$(firstword $(wildcard \
|
---|
| 83 | /usr/bin/rcc-qt6 \
|
---|
| 84 | /usr/local/bin/rcc-qt6 \
|
---|
| 85 | /usr/qt/6/bin/rcc-qt6 \
|
---|
| 86 | $(if $(intersects $(KBUILD_HOST_ARCH),$(KBUILD_ARCHES_64)),/usr/lib64/qt6/bin/rcc-qt6) \
|
---|
| 87 | /usr/lib/qt6/bin/rcc-qt6 \
|
---|
| 88 | /usr/share/qt6/bin/rcc-qt6 \
|
---|
[1767] | 89 | )))
|
---|
[3557] | 90 | ifeq ($(PATH_SDK_QT6),)
|
---|
| 91 | PATH_SDK_QT6 := $(patsubst %/libexec/rcc-qt6,%,$(firstword $(wildcard \
|
---|
| 92 | /usr/libexec/rcc-qt6 \
|
---|
| 93 | /usr/local/libexec/rcc-qt6 \
|
---|
| 94 | /usr/qt/6/libexec/rcc-qt6 \
|
---|
| 95 | $(if $(intersects $(KBUILD_HOST_ARCH),$(KBUILD_ARCHES_64)),/usr/lib64/qt6/libexec/rcc-qt6) \
|
---|
| 96 | /usr/lib/qt6/libexec/rcc-qt6 \
|
---|
| 97 | /usr/share/qt6/libexec/rcc-qt6 \
|
---|
| 98 | )))
|
---|
[2787] | 99 | endif
|
---|
[3557] | 100 | ifeq ($(PATH_SDK_QT6),)
|
---|
| 101 | PATH_SDK_QT6 := $(patsubst %/libexec/rcc,%,$(firstword $(wildcard \
|
---|
| 102 | /usr/qt/6/libexec/rcc \
|
---|
| 103 | $(if $(intersects $(KBUILD_HOST_ARCH),$(KBUILD_ARCHES_64)),/usr/lib64/qt6/libexec/rcc) \
|
---|
| 104 | /usr/lib/qt6/libexec/rcc \
|
---|
| 105 | /usr/share/qt6/libexec/rcc \
|
---|
| 106 | /usr/libexec/rcc \
|
---|
| 107 | /usr/local/libexec/rcc \
|
---|
[2787] | 108 | )))
|
---|
| 109 | endif
|
---|
[3557] | 110 | ifeq ($(PATH_SDK_QT6),)
|
---|
| 111 | PATH_SDK_QT6 := $(patsubst %/bin/rcc,%,$(firstword $(wildcard \
|
---|
| 112 | /usr/qt/6/bin/rcc \
|
---|
| 113 | $(if $(intersects $(KBUILD_HOST_ARCH),$(KBUILD_ARCHES_64)),/usr/lib64/qt6/bin/rcc) \
|
---|
| 114 | /usr/lib/qt6/bin/rcc \
|
---|
| 115 | /usr/share/qt6/bin/rcc \
|
---|
[1767] | 116 | /usr/bin/rcc \
|
---|
[2787] | 117 | /usr/local/bin/rcc \
|
---|
| 118 | )))
|
---|
[1767] | 119 | endif
|
---|
[3557] | 120 | ifneq ($(PATH_SDK_QT6),)
|
---|
| 121 | export PATH_SDK_QT6
|
---|
[1773] | 122 |
|
---|
[3557] | 123 | # Locate the include files. Check for QStringConverter (since 6.?) first.
|
---|
| 124 | ifeq ($(PATH_SDK_QT6_INC),)
|
---|
| 125 | PATH_SDK_QT6_INC := $(patsubst %/QtCore/QStringConverter,%,$(firstword $(wildcard \
|
---|
| 126 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET_DOT_ARCH)),/usr/include/$(type)/qt6/QtCore/QStringConverter) \
|
---|
| 127 | $(PATH_SDK_QT6)/include/qt6/QtCore/QStringConverter \
|
---|
| 128 | /usr/include/qt6/QtCore/QStringConverter \
|
---|
| 129 | /usr/local/include/qt6/QtCore/QStringConverter \
|
---|
| 130 | $(PATH_SDK_QT6)/include/QtCore/QStringConverter \
|
---|
| 131 | /usr/include/qt/QtCore/QStringConverter \
|
---|
| 132 | /usr/local/include/qt/QtCore/QStringConverter \
|
---|
[3016] | 133 | )))
|
---|
[3557] | 134 | ifeq ($(PATH_SDK_QT6_INC),)
|
---|
| 135 | PATH_SDK_QT6_INC := $(patsubst %/QtCore/qglobal.h,%,$(firstword $(wildcard \
|
---|
| 136 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET_DOT_ARCH)),/usr/include/$(type)/qt6/QtCore/qglobal.h) \
|
---|
| 137 | $(PATH_SDK_QT6)/include/qt6/QtCore/qglobal.h \
|
---|
| 138 | /usr/include/qt6/QtCore/qglobal.h \
|
---|
| 139 | /usr/local/include/qt6/QtCore/qglobal.h \
|
---|
| 140 | $(PATH_SDK_QT6)/include/QtCore/qglobal.h \
|
---|
[1767] | 141 | )))
|
---|
[3016] | 142 | endif
|
---|
[3557] | 143 | ifneq ($(PATH_SDK_QT6_INC),)
|
---|
| 144 | export PATH_SDK_QT6_INC
|
---|
[1773] | 145 | endif
|
---|
[1677] | 146 | endif
|
---|
[1767] | 147 |
|
---|
| 148 | # Now for the libraries (mostly for helping out finding the KBUILD_TARGET libs).
|
---|
[3557] | 149 | ifeq ($(PATH_SDK_QT6_LIB.x86),)
|
---|
| 150 | PATH_SDK_QT6_LIB.x86 := $(patsubst %/libQt6Core$(SUFF_DLL),%,$(firstword $(wildcard \
|
---|
| 151 | $(PATH_SDK_QT6)/lib32/libQt6Core$(SUFF_DLL) \
|
---|
| 152 | $(PATH_SDK_QT6)/lib32/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 153 | /usr/lib32/libQt6Core$(SUFF_DLL) \
|
---|
| 154 | /usr/lib32/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 155 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET).x86),/usr/lib/$(type)/libQt6Core$(SUFF_DLL)) \
|
---|
| 156 | /usr/local/lib32/libQt6Core$(SUFF_DLL) \
|
---|
| 157 | /usr/local/lib32/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 158 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET).x86),/usr/local/lib/$(type)/libQt6Core$(SUFF_DLL)) \
|
---|
| 159 | $(PATH_SDK_QT6)/lib/libQt6Core$(SUFF_DLL) \
|
---|
| 160 | $(PATH_SDK_QT6)/lib/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 161 | $(PATH_SDK_QT6)/lib/i386-linux-gnu/libQt6Core$(SUFF_DLL) \
|
---|
[1677] | 162 | )))
|
---|
[3557] | 163 | ifneq ($(PATH_SDK_QT6_LIB.x86),)
|
---|
| 164 | export PATH_SDK_QT6_LIB.x86
|
---|
[1767] | 165 | endif
|
---|
[1677] | 166 | endif
|
---|
[3557] | 167 | ifeq ($(PATH_SDK_QT6_LIB.amd64),)
|
---|
| 168 | PATH_SDK_QT6_LIB.amd64 := $(patsubst %/libQt6Core$(SUFF_DLL),%,$(firstword $(wildcard \
|
---|
| 169 | $(PATH_SDK_QT6)/lib64/libQt6Core$(SUFF_DLL) \
|
---|
| 170 | $(PATH_SDK_QT6)/lib64/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 171 | $(PATH_SDK_QT6)/lib/amd64/libQt6Core$(SUFF_DLL) \
|
---|
| 172 | /usr/lib64/libQt6Core$(SUFF_DLL) \
|
---|
| 173 | /usr/lib64/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 174 | /usr/lib/amd64/libQt6Core$(SUFF_DLL) \
|
---|
| 175 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET).amd64),/usr/lib/$(type)/libQt6Core$(SUFF_DLL)) \
|
---|
| 176 | /usr/local/lib64/libQt6Core$(SUFF_DLL) \
|
---|
| 177 | /usr/local/lib64/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 178 | /usr/local/lib/amd64/libQt6Core$(SUFF_DLL) \
|
---|
| 179 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET).amd64),/usr/local/lib/$(type)/libQt6Core$(SUFF_DLL)) \
|
---|
| 180 | $(PATH_SDK_QT6)/lib/libQt6Core$(SUFF_DLL) \
|
---|
| 181 | $(PATH_SDK_QT6)/lib/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 182 | $(PATH_SDK_QT6)/lib/x86_64-linux-gnu/libQt6Core$(SUFF_DLL) \
|
---|
[1677] | 183 | )))
|
---|
[3557] | 184 | ifneq ($(PATH_SDK_QT6_LIB.amd64),)
|
---|
| 185 | export PATH_SDK_QT6_LIB.amd64
|
---|
[1767] | 186 | endif
|
---|
[1677] | 187 | endif
|
---|
[3557] | 188 | ifeq ($(PATH_SDK_QT6_LIB.arm64),)
|
---|
| 189 | PATH_SDK_QT6_LIB.arm64 := $(patsubst %/libQt6Core$(SUFF_DLL),%,$(firstword $(wildcard \
|
---|
| 190 | $(PATH_SDK_QT6)/lib64/libQt6Core$(SUFF_DLL) \
|
---|
| 191 | $(PATH_SDK_QT6)/lib64/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 192 | $(PATH_SDK_QT6)/lib/arm64/libQt6Core$(SUFF_DLL) \
|
---|
| 193 | /usr/lib64/libQt6Core$(SUFF_DLL) \
|
---|
| 194 | /usr/lib64/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 195 | /usr/lib/arm64/libQt6Core$(SUFF_DLL) \
|
---|
| 196 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET).arm64),/usr/lib/$(type)/libQt6Core$(SUFF_DLL)) \
|
---|
| 197 | /usr/local/lib64/libQt6Core$(SUFF_DLL) \
|
---|
| 198 | /usr/local/lib64/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 199 | /usr/local/lib/arm64/libQt6Core$(SUFF_DLL) \
|
---|
| 200 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET).arm64),/usr/local/lib/$(type)/libQt6Core$(SUFF_DLL)) \
|
---|
| 201 | $(PATH_SDK_QT6)/lib/libQt6Core$(SUFF_DLL) \
|
---|
| 202 | $(PATH_SDK_QT6)/lib/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 203 | $(PATH_SDK_QT6)/lib/x86_64-linux-gnu/libQt6Core$(SUFF_DLL) \
|
---|
| 204 | )))
|
---|
| 205 | ifneq ($(PATH_SDK_QT6_LIB.arm64),)
|
---|
| 206 | export PATH_SDK_QT6_LIB.arm64
|
---|
| 207 | endif
|
---|
| 208 | endif
|
---|
[1767] | 209 |
|
---|
| 210 | # And finally, the library path for KBUILD_TARGET.
|
---|
[3557] | 211 | ifeq ($(PATH_SDK_QT6_LIB),)
|
---|
| 212 | PATH_SDK_QT6_LIB := $(PATH_SDK_QT6_LIB.$(KBUILD_TARGET_ARCH))
|
---|
| 213 | ifeq ($(PATH_SDK_QT6_LIB),)
|
---|
| 214 | PATH_SDK_QT6_LIB := $(patsubst %/libQt6Core$(SUFF_DLL),%,$(firstword $(wildcard \
|
---|
| 215 | $(PATH_SDK_QT6)/lib/libQt6Core$(SUFF_DLL) \
|
---|
| 216 | $(PATH_SDK_QT6)/lib/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 217 | /usr/lib/libQt6Core$(SUFF_DLL) \
|
---|
| 218 | /usr/lib/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 219 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET_DOT_ARCH)),/usr/lib/$(type)/libQt6Core$(SUFF_DLL)) \
|
---|
| 220 | /usr/local/lib/libQt6Core$(SUFF_DLL) \
|
---|
| 221 | /usr/local/lib/qt6/libQt6Core$(SUFF_DLL) \
|
---|
| 222 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_TARGET_DOT_ARCH)),/usr/local/lib/$(type)/libQt6Core$(SUFF_DLL)) \
|
---|
[1767] | 223 | )))
|
---|
[1677] | 224 | endif
|
---|
[3557] | 225 | ifneq ($(PATH_SDK_QT6_LIB),)
|
---|
| 226 | export PATH_SDK_QT6_LIB
|
---|
[1767] | 227 | endif
|
---|
[1677] | 228 | endif
|
---|
[1767] | 229 |
|
---|
[1677] | 230 | endif
|
---|
| 231 | endif # Unices
|
---|
| 232 | endif
|
---|
| 233 | # Found it?
|
---|
[3557] | 234 | ifeq ($(PATH_SDK_QT6),)
|
---|
| 235 | $(warning kBuild: Couldn't find the Qt6 headers and libaries...)
|
---|
| 236 | PATH_SDK_QT6 := $(KBUILD_DEVTOOLS_TRG)/qt/not-found
|
---|
[1677] | 237 | endif
|
---|
| 238 | endif
|
---|
| 239 | else
|
---|
| 240 | # Resolve any fancy stuff once and for all.
|
---|
[3557] | 241 | PATH_SDK_QT6 := $(PATH_SDK_QT6)
|
---|
[1677] | 242 | endif
|
---|
[1671] | 243 |
|
---|
[1677] | 244 | # Libraries can be in either Frameworks or lib depending on how you
|
---|
| 245 | # build it on the mac. The .dmg installs into Frameworks but builds into lib.
|
---|
| 246 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
[3557] | 247 | ifndef PATH_SDK_QT6_LIB
|
---|
| 248 | ifneq ($(wildcard $(PATH_SDK_QT6)/Frameworks),)
|
---|
| 249 | PATH_SDK_QT6_LIB ?= $(PATH_SDK_QT6)/Frameworks
|
---|
[1677] | 250 | else
|
---|
[3557] | 251 | PATH_SDK_QT6_LIB ?= $(PATH_SDK_QT6)/lib
|
---|
[1677] | 252 | endif
|
---|
| 253 | endif
|
---|
| 254 | else
|
---|
[3557] | 255 | PATH_SDK_QT6_LIB ?= $(PATH_SDK_QT6)/lib
|
---|
| 256 | PATH_SDK_QT6_INC ?= $(PATH_SDK_QT6)/include
|
---|
[1677] | 257 | endif
|
---|
| 258 |
|
---|
| 259 | # The bits that kBuild picks up.
|
---|
| 260 | # (nothing here)
|
---|
| 261 |
|
---|
| 262 |
|
---|
[1671] | 263 | #
|
---|
[3557] | 264 | # The QT6 tool.
|
---|
[1671] | 265 | #
|
---|
[3557] | 266 | # This is implemented here rather than in tools/QT6.kmk to enforce the global USES.
|
---|
[1671] | 267 | # It also makes things easier to develop, with fewer files I mean.
|
---|
| 268 | #
|
---|
[3557] | 269 | TOOL_QT6 = Qt6
|
---|
[1671] | 270 |
|
---|
| 271 | # Tool Specific Properties
|
---|
[3557] | 272 | # PATH_TOOL_QT6 - Obsolete.
|
---|
| 273 | # PATH_TOOL_QT6_BIN - The path to the lrc and lupdate tools.
|
---|
| 274 | # PATH_TOOL_QT6_LIBEXEC - The path to the moc, uic & rcc tools.
|
---|
| 275 | # TOOL_QT6_BIN_SUFF - The binary suffix for PATH_TOOL_QT6_BIN tools.
|
---|
| 276 | # TOOL_QT6_LIBEXEC_SUFF - The binary suffix for PATH_TOOL_QT6_LIBEXEC tools.
|
---|
| 277 | if !defined(PATH_TOOL_QT6_BIN) && defined(PATH_TOOL_QT6)
|
---|
| 278 | PATH_TOOL_QT6_BIN := $(PATH_TOOL_QT6)/bin
|
---|
[1767] | 279 | endif
|
---|
[3557] | 280 | ifndef PATH_TOOL_QT6_BIN
|
---|
| 281 | PATH_TOOL_QT6_BIN := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/qt/v6*/bin)))
|
---|
| 282 | if "$(PATH_TOOL_QT6_BIN)" == "" && "$(KBUILD_DEVTOOLS_HST_ALT)" != ""
|
---|
| 283 | PATH_TOOL_QT6_BIN := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/qt/v6*/bin)))
|
---|
[2272] | 284 | endif
|
---|
[3557] | 285 | ifeq ($(PATH_TOOL_QT6_BIN),)
|
---|
| 286 | ifdef TOOL_QT6_BIN_SUFF
|
---|
| 287 | TOOL_QT6_BIN_SUFF := $(TOOL_QT6_BIN_SUFF)
|
---|
[1767] | 288 | endif
|
---|
[3557] | 289 | # Try looking for lupdate-qt6 / lupdate-$(suffix) first (this is in bin rather than libexec).
|
---|
| 290 | ifneq ($(TOOL_QT6_BIN_SUFF),)
|
---|
| 291 | PATH_TOOL_QT6_BIN := $(patsubst %/lupdate$(TOOL_QT6_BIN_SUFF),%,$(firstword $(wildcard \
|
---|
| 292 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_HOST_DOT_ARCH)),/usr/lib/$(type)/qt6/bin/lupdate$(TOOL_QT6_BIN_SUFF)) \
|
---|
| 293 | $(if $(intersects $(KBUILD_HOST_ARCH),$(KBUILD_ARCHES_64)),/usr/lib64/qt6/bin/lupdate$(TOOL_QT6_BIN_SUFF)) \
|
---|
| 294 | /usr/lib/qt6/bin/lupdate$(TOOL_QT6_BIN_SUFF) \
|
---|
| 295 | /usr/qt/6/bin/lupdate$(TOOL_QT6_BIN_SUFF) \
|
---|
| 296 | /usr/share/qt6/bin/lupdate$(TOOL_QT6_BIN_SUFF) \
|
---|
| 297 | /usr/local/bin/lupdate$(TOOL_QT6_BIN_SUFF) \
|
---|
| 298 | /usr/bin/lupdate$(TOOL_QT6_BIN_SUFF) \
|
---|
| 299 | )))
|
---|
[1774] | 300 | else
|
---|
[3557] | 301 | # No suffix given, so before we check out -qt6 look at qt6 specific locations to avoid choosers and symlinks.
|
---|
| 302 | PATH_TOOL_QT6_BIN := $(patsubst %/lupdate,%,$(firstword $(wildcard \
|
---|
| 303 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_HOST_DOT_ARCH)),/usr/lib/$(type)/qt6/bin/lupdate) \
|
---|
| 304 | $(if $(intersects $(KBUILD_HOST_ARCH), $(KBUILD_ARCHES_64)),/usr/lib64/qt6/bin/lupdate,) \
|
---|
| 305 | /usr/lib/qt6/bin/lupdate \
|
---|
| 306 | /usr/local/lib/qt6/bin/lupdate \
|
---|
| 307 | /usr/qt/6/bin/lupdate \
|
---|
| 308 | /usr/local/qt/6/bin/lupdate \
|
---|
| 309 | /usr/share/qt6/bin/lupdate \
|
---|
| 310 | /usr/local/share/qt6/bin/lupdate \
|
---|
[2978] | 311 | )))
|
---|
[3557] | 312 | ifeq ($(PATH_TOOL_QT6_BIN),)
|
---|
| 313 | PATH_TOOL_QT6_BIN := $(patsubst %/lupdate-qt6,%,$(firstword $(wildcard \
|
---|
| 314 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_HOST_DOT_ARCH)),/usr/lib/$(type)/qt6/bin/lupdate-qt6) \
|
---|
| 315 | $(if $(intersects $(KBUILD_HOST_ARCH), $(KBUILD_ARCHES_64)),/usr/lib64/qt6/bin/lupdate-qt6,) \
|
---|
| 316 | /usr/lib/qt6/bin/lupdate-qt6 \
|
---|
| 317 | /usr/qt/6/bin/lupdate-qt6 \
|
---|
| 318 | /usr/share/qt6/bin/lupdate-qt6 \
|
---|
| 319 | /usr/local/bin/lupdate-qt6 \
|
---|
| 320 | /usr/bin/lupdate-qt6 \
|
---|
[1774] | 321 | )))
|
---|
[3557] | 322 | ifneq ($(PATH_TOOL_QT6_BIN),)
|
---|
| 323 | TOOL_QT6_BIN_SUFF := -qt6
|
---|
[2978] | 324 | endif
|
---|
[1767] | 325 | endif
|
---|
| 326 | endif
|
---|
[3557] | 327 | # If still no go, try looking for qmake.
|
---|
| 328 | ifeq ($(PATH_TOOL_QT6_BIN),)
|
---|
| 329 | PATH_TOOL_QT6_BIN := $(patsubst %/qmake,%,$(firstword $(wildcard \
|
---|
| 330 | $(foreach type,$(KBUILD_OSARCH_2_GNU_SYSTEM_TYPES.$(KBUILD_HOST_DOT_ARCH)),/usr/lib/$(type)/qt6/bin/qmake) \
|
---|
| 331 | $(if $(intersects $(KBUILD_HOST_ARCH), $(KBUILD_ARCHES_64)),/usr/lib64/qt6/bin/qmake,) \
|
---|
| 332 | /usr/lib/qt6/bin/qmake \
|
---|
| 333 | /usr/qt/6/bin/qmake \
|
---|
| 334 | /usr/share/qt6/bin/qmake \
|
---|
| 335 | /usr/local/bin/qmake \
|
---|
| 336 | /usr/bin/qmake \
|
---|
[1774] | 337 | )))
|
---|
| 338 | endif
|
---|
[3557] | 339 | ifneq ($(PATH_TOOL_QT6_BIN),)
|
---|
| 340 | export PATH_TOOL_QT6_BIN
|
---|
[1774] | 341 | endif
|
---|
[1687] | 342 | endif
|
---|
[1671] | 343 | # If not found, we'll enter the 'pathless' mode.
|
---|
| 344 | else
|
---|
| 345 | # Resolve any fancy stuff once and for all.
|
---|
[3557] | 346 | PATH_TOOL_QT6_BIN := $(PATH_TOOL_QT6_BIN)
|
---|
[1671] | 347 | endif
|
---|
[3557] | 348 |
|
---|
| 349 | # Unixes have moc, rcc, uic in a libexec dir rather than the bin dir, so try
|
---|
| 350 | # find that directory or alias the LIBEXEC stuff onto BIN.
|
---|
| 351 | ifndef PATH_TOOL_QT6_LIBEXEC
|
---|
| 352 | ifneq ($(PATH_TOOL_QT6_BIN),)
|
---|
| 353 | ifneq ($(qwildcard ,$(PATH_TOOL_QT6_BIN)/../libexec/moc*),)
|
---|
| 354 | PATH_TOOL_QT6_LIBEXEC := $(qabspath ,$(PATH_TOOL_QT6_BIN)/../libexec)
|
---|
| 355 | else
|
---|
| 356 | PATH_TOOL_QT6_LIBEXEC := $(PATH_TOOL_QT6_BIN)
|
---|
[1774] | 357 | endif
|
---|
| 358 | endif
|
---|
[1671] | 359 | else
|
---|
[3557] | 360 | PATH_TOOL_QT6_LIBEXEC := $(PATH_TOOL_QT6_LIBEXEC)
|
---|
| 361 | endif
|
---|
| 362 | if !defined(TOOL_QT6_LIBEXEC_SUFF) && defined(PATH_TOOL_QT6_LIBEXEC)
|
---|
| 363 | ifneq ($(qwildcard ,$(PATH_TOOL_QT6_LIBEXEC)/moc-qt6$(HOSTSUFF_EXE)),)
|
---|
| 364 | TOOL_QT6_LIBEXEC_SUFF := -qt6
|
---|
| 365 | endif
|
---|
| 366 | endif
|
---|
| 367 |
|
---|
| 368 | ifneq ($(PATH_TOOL_QT6_BIN),)
|
---|
| 369 | TOOL_QT6_MOC ?= $(PATH_TOOL_QT6_LIBEXEC)/moc$(TOOL_QT6_LIBEXEC_SUFF)$(HOSTSUFF_EXE)
|
---|
| 370 | TOOL_QT6_UIC ?= $(PATH_TOOL_QT6_LIBEXEC)/uic$(TOOL_QT6_LIBEXEC_SUFF)$(HOSTSUFF_EXE)
|
---|
| 371 | TOOL_QT6_RCC ?= $(PATH_TOOL_QT6_LIBEXEC)/rcc$(TOOL_QT6_LIBEXEC_SUFF)$(HOSTSUFF_EXE)
|
---|
| 372 | TOOL_QT6_LRC ?= $(PATH_TOOL_QT6_BIN)/lrelease$(TOOL_QT6_BIN_SUFF)$(HOSTSUFF_EXE)
|
---|
| 373 | TOOL_QT6_LUPDATE ?= $(PATH_TOOL_QT6_BIN)/lupdate$(TOOL_QT6_BIN_SUFF)$(HOSTSUFF_EXE)
|
---|
| 374 | else
|
---|
[1671] | 375 | # Pathless, relies on the environment.
|
---|
[3557] | 376 | TOOL_QT6_MOC ?= moc$(TOOL_QT6_LIBEXEC_SUFF)$(HOSTSUFF_EXE)
|
---|
| 377 | TOOL_QT6_UIC ?= uic$(TOOL_QT6_LIBEXEC_SUFF)$(HOSTSUFF_EXE)
|
---|
| 378 | TOOL_QT6_RCC ?= rcc$(TOOL_QT6_LIBEXEC_SUFF)$(HOSTSUFF_EXE)
|
---|
| 379 | TOOL_QT6_LRC ?= lrelease$(TOOL_QT6_BIN_SUFF)$(HOSTSUFF_EXE)
|
---|
| 380 | TOOL_QT6_LUPDATE ?= lupdate$(TOOL_QT6_BIN_SUFF)$(HOSTSUFF_EXE)
|
---|
[1671] | 381 | endif
|
---|
[3557] | 382 | ifdef TOOL_QT6_USE_KSUBMIT
|
---|
[2942] | 383 | ifeq ($(KBUILD_HOST),win)
|
---|
[3557] | 384 | TOOL_QT6_MOC_KSUBMIT ?= kmk_builtin_kSubmit --$(SP)
|
---|
[2942] | 385 | endif
|
---|
| 386 | endif
|
---|
[1671] | 387 |
|
---|
| 388 | # General Properties used by kBuild and/or units/qt.kmk
|
---|
[3557] | 389 | TOOL_QT6_MOCFLAGS ?=
|
---|
| 390 | TOOL_QT6_MOCINCS ?=
|
---|
| 391 | TOOL_QT6_MOCDEFS ?=
|
---|
| 392 | TOOL_QT6_MOCDEFS.darwin ?= __APPLE__ __GNUC__
|
---|
| 393 | TOOL_QT6_MOCDEFS.solaris ?= __sun
|
---|
| 394 | TOOL_QT6_MOCDEFS.win.amd64 ?= WIN64
|
---|
| 395 | TOOL_QT6_MOCDEFS.win.x86 ?= WIN32
|
---|
[1671] | 396 |
|
---|
| 397 |
|
---|
| 398 | ## MOC a C++ source file.
|
---|
| 399 | # @param $(target) Normalized main target name.
|
---|
| 400 | # @param $(source) Source filename (relative).
|
---|
| 401 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 402 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 403 | # @param $(flags) Flags.
|
---|
| 404 | # @param $(defs) Definitions.
|
---|
| 405 | # @param $(incs) Includes.
|
---|
| 406 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 407 | #
|
---|
[3557] | 408 | TOOL_QT6_MOC_CPP_DEPEND =
|
---|
| 409 | TOOL_QT6_MOC_CPP_DEPORD =
|
---|
| 410 | TOOL_QT6_MOC_CPP_OUTPUT =
|
---|
| 411 | TOOL_QT6_MOC_CPP_OUTPUT_MAYBE =
|
---|
[3349] | 412 | ifdef KMK_WITH_QUOTING
|
---|
[3557] | 413 | define TOOL_QT6_MOC_CPP_CMDS
|
---|
| 414 | $(QUIET)$(TOOL_QT6_MOC_KSUBMIT)$(TOOL_QT6_MOC)\
|
---|
[1671] | 415 | $(flags)\
|
---|
[3328] | 416 | $(qaddprefix sh,-I, $(incs))\
|
---|
| 417 | $(qaddprefix sh,-D, $(defs))\
|
---|
| 418 | -o $(out)\
|
---|
| 419 | $(source)
|
---|
| 420 | endef
|
---|
| 421 | else
|
---|
[3557] | 422 | define TOOL_QT6_MOC_CPP_CMDS
|
---|
| 423 | $(QUIET)$(TOOL_QT6_MOC_KSUBMIT)$(TOOL_QT6_MOC)\
|
---|
[3328] | 424 | $(flags)\
|
---|
[1671] | 425 | $(addprefix -I, $(incs))\
|
---|
| 426 | $(addprefix -D, $(defs))\
|
---|
| 427 | -o $(out)\
|
---|
| 428 | $(source)
|
---|
[3328] | 429 | endef
|
---|
| 430 | endif
|
---|
[1671] | 431 |
|
---|
| 432 | ## MOC a C++ header file.
|
---|
| 433 | # @param $(target) Normalized main target name.
|
---|
| 434 | # @param $(source) Source filename (relative).
|
---|
| 435 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 436 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 437 | # @param $(flags) Flags.
|
---|
| 438 | # @param $(defs) Definitions.
|
---|
| 439 | # @param $(incs) Includes.
|
---|
| 440 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 441 | #
|
---|
[3557] | 442 | TOOL_QT6_MOC_HPP_DEPEND =
|
---|
| 443 | TOOL_QT6_MOC_HPP_DEPORD =
|
---|
| 444 | TOOL_QT6_MOC_HPP_OUTPUT =
|
---|
| 445 | TOOL_QT6_MOC_HPP_OUTPUT_MAYBE =
|
---|
[3349] | 446 | ifdef KMK_WITH_QUOTING
|
---|
[3557] | 447 | define TOOL_QT6_MOC_HPP_CMDS
|
---|
| 448 | $(QUIET)$(TOOL_QT6_MOC_KSUBMIT)$(TOOL_QT6_MOC)\
|
---|
[1671] | 449 | $(flags)\
|
---|
[3328] | 450 | $(qaddprefix sh,-I, $(incs))\
|
---|
| 451 | $(qaddprefix sh,-D, $(defs))\
|
---|
| 452 | -o $(out)\
|
---|
| 453 | $(source)
|
---|
| 454 | endef
|
---|
| 455 | else
|
---|
[3557] | 456 | define TOOL_QT6_MOC_HPP_CMDS
|
---|
| 457 | $(QUIET)$(TOOL_QT6_MOC_KSUBMIT)$(TOOL_QT6_MOC)\
|
---|
[3328] | 458 | $(flags)\
|
---|
[1671] | 459 | $(addprefix -I, $(incs))\
|
---|
| 460 | $(addprefix -D, $(defs))\
|
---|
| 461 | -o $(out)\
|
---|
| 462 | $(source)
|
---|
[3328] | 463 | endef
|
---|
| 464 | endif
|
---|
[1671] | 465 |
|
---|
| 466 | ## Compile a Qt user interface file (.ui).
|
---|
| 467 | # @param $(target) Normalized main target name.
|
---|
| 468 | # @param $(source) Source filename (relative).
|
---|
| 469 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 470 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 471 | # @param $(flags) Flags.
|
---|
| 472 | # @param $(defs) Definitions.
|
---|
| 473 | # @param $(incs) Includes.
|
---|
| 474 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 475 | #
|
---|
[3557] | 476 | TOOL_QT6_UIC_UI_DEPEND =
|
---|
| 477 | TOOL_QT6_UIC_UI_DEPORD =
|
---|
| 478 | TOOL_QT6_UIC_UI_OUTPUT =
|
---|
| 479 | TOOL_QT6_UIC_UI_OUTPUT_MAYBE =
|
---|
| 480 | define TOOL_QT6_UIC_UI_CMDS
|
---|
| 481 | $(QUIET)$(TOOL_QT6_UIC)\
|
---|
[1671] | 482 | $(flags)\
|
---|
| 483 | -o $(out)\
|
---|
| 484 | $(source)
|
---|
| 485 | endef
|
---|
| 486 |
|
---|
| 487 | ## Compile a Qt resource file (.qrc).
|
---|
| 488 | # @param $(target) Normalized main target name.
|
---|
| 489 | # @param $(source) Source filename (relative).
|
---|
| 490 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 491 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 492 | # @param $(flags) Flags.
|
---|
| 493 | # @param $(defs) Definitions.
|
---|
| 494 | # @param $(incs) Includes.
|
---|
| 495 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 496 | #
|
---|
| 497 | # @remarks The sed script generating the dependency file is a bit naive.
|
---|
[3557] | 498 | TOOL_QT6_RCC_QRC_DEPEND =
|
---|
| 499 | TOOL_QT6_RCC_QRC_DEPORD =
|
---|
| 500 | TOOL_QT6_RCC_QRC_OUTPUT =
|
---|
| 501 | TOOL_QT6_RCC_QRC_OUTPUT_MAYBE =
|
---|
| 502 | define TOOL_QT6_RCC_QRC_CMDS
|
---|
| 503 | $(QUIET)$(TOOL_QT6_RCC)\
|
---|
[1671] | 504 | $(flags)\
|
---|
| 505 | -o $(out)\
|
---|
| 506 | $(source)
|
---|
[3160] | 507 | $(QUIET2)$(APPEND) -n $(dep) '\' \
|
---|
| 508 | '$(out): \' \
|
---|
| 509 | '$(source) \'
|
---|
[2361] | 510 | $(QUIET2)$(SED) \
|
---|
[1671] | 511 | -e '/^[[:blank:]]*<file[[:blank:]][^>]*>/!d' \
|
---|
| 512 | -e 's/^.*<file[[:blank:]][^>]*>\([^<]*\)<\/file>.*$$$$/\1/' \
|
---|
[2183] | 513 | -e 's|^[^/][^:]|$(abspathex $(dir $(source)),$(defpath))/&|' \
|
---|
[1671] | 514 | -e 's|$$$$| \\|' \
|
---|
| 515 | --append $(dep) \
|
---|
| 516 | $(source)
|
---|
[2361] | 517 | $(QUIET2)$(APPEND) $(dep)
|
---|
| 518 | $(QUIET2)$(SED) \
|
---|
[1671] | 519 | -e '/^[[:blank:]]*<file[[:blank:]][^>]*>/!d' \
|
---|
| 520 | -e 's/^.*<file[[:blank:]][^>]*>\([^<]*\)<\/file>.*$$$$/\1/' \
|
---|
[2183] | 521 | -e 's|^[^/][^:]|$(abspathex $(dir $(source)),$(defpath))/&|' \
|
---|
[1671] | 522 | -e 's|$$$$|:\n|' \
|
---|
| 523 | --append $(dep) \
|
---|
| 524 | $(source)
|
---|
[2361] | 525 | $(QUIET2)$(APPEND) $(dep)
|
---|
[1671] | 526 | endef
|
---|
| 527 |
|
---|
[1675] | 528 | ## Compile a Qt translation file (.ts).
|
---|
| 529 | # @param $(target) Normalized main target name.
|
---|
| 530 | # @param $(source) Source filename (relative).
|
---|
| 531 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 532 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 533 | # @param $(flags) Flags.
|
---|
| 534 | # @param $(defs) Definitions.
|
---|
| 535 | # @param $(incs) Includes.
|
---|
| 536 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 537 | #
|
---|
[3557] | 538 | TOOL_QT6_LRC_TS_DEPEND =
|
---|
| 539 | TOOL_QT6_LRC_TS_DEPORD =
|
---|
| 540 | TOOL_QT6_LRC_TS_OUTPUT =
|
---|
| 541 | TOOL_QT6_LRC_TS_OUTPUT_MAYBE =
|
---|
| 542 | define TOOL_QT6_LRC_TS_CMDS
|
---|
| 543 | $(QUIET)$(TOOL_QT6_LRC)\
|
---|
[1675] | 544 | $(flags)\
|
---|
| 545 | $(source)\
|
---|
| 546 | -qm $(out)
|
---|
| 547 | endef
|
---|
[1671] | 548 |
|
---|
| 549 |
|
---|
[1675] | 550 |
|
---|
[1671] | 551 | #
|
---|
| 552 | #
|
---|
[3557] | 553 | # Back to the Qt6 unit.
|
---|
[1671] | 554 | #
|
---|
| 555 | #
|
---|
| 556 |
|
---|
| 557 |
|
---|
[1675] | 558 | ## wrapper for the lrelease (LRC) command dependencies.
|
---|
| 559 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3557] | 560 | _UNIT_QT6_LRC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT6_LRC_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1675] | 561 | else
|
---|
[3557] | 562 | _UNIT_QT6_LRC_CMDS_DEP =
|
---|
[1675] | 563 | endif
|
---|
| 564 |
|
---|
[1671] | 565 | ##
|
---|
[3557] | 566 | # def_unit_qt6_target_pre_handle_translation helper that is expanded before evaluation.
|
---|
[1671] | 567 | #
|
---|
[1675] | 568 | # This is necessary to resolve reference to local variables before doing
|
---|
| 569 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 570 | # later in a different context and the result would be completely wrong.
|
---|
| 571 | #
|
---|
[3557] | 572 | define def_unit_qt6_target_pre_handle_translation_dx
|
---|
[1671] | 573 |
|
---|
[1675] | 574 | $(out) + $(more_output) +| $(maybe_output): \
|
---|
| 575 | $(deps) \
|
---|
[3557] | 576 | $(value _UNIT_QT6_LRC_CMDS_DEP) \
|
---|
[1675] | 577 | | \
|
---|
| 578 | $(orderdeps)
|
---|
| 579 | %$$(call MSG_TOOL,lrelease,$(target),$(source),$$@)
|
---|
| 580 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 581 |
|
---|
[1675] | 582 | $(cmds)
|
---|
| 583 |
|
---|
| 584 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3160] | 585 | ifdef KBUILD_HAVE_OPTIMIZED_APPEND
|
---|
| 586 | %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
|
---|
[3557] | 587 | 'define $(target)_$(subst :,_,$(source))_QT6_LRC_CMDS_PREV_' \
|
---|
[3160] | 588 | '--insert-command=$(out)' \
|
---|
| 589 | 'endef'
|
---|
| 590 | else
|
---|
[1675] | 591 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[3557] | 592 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT6_LRC_CMDS_PREV_'
|
---|
[1675] | 593 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 594 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 595 | endif
|
---|
[3160] | 596 | endif
|
---|
[1675] | 597 |
|
---|
[2197] | 598 | $(target)_CLEAN += $(out) $(more_output) $(maybe_output) $(dep)
|
---|
[1675] | 599 | $(target)-inst-nls_SOURCES += $(out)
|
---|
| 600 |
|
---|
[3557] | 601 | endef # def_unit_qt6_target_pre_handle_translation_dx
|
---|
[1675] | 602 |
|
---|
| 603 | ##
|
---|
| 604 | # Handle a source file listed in QT_TRANSLATIONS.
|
---|
| 605 | #
|
---|
| 606 | # The files listed in QT_TRANSLATIONS are translation files (.ts) which needs
|
---|
| 607 | # to be translated into .qm files that are loadble by Qt.
|
---|
| 608 | #
|
---|
| 609 | # @remarks Invoked via $(evalvalctx ).
|
---|
[3557] | 610 | define def_unit_qt6_target_pre_handle_translation
|
---|
[1675] | 611 | local type := LRC
|
---|
| 612 |
|
---|
| 613 | # fetch the properties.
|
---|
| 614 | local tool := $(kb-src-tool dummy_var)
|
---|
[2239] | 615 | local qtnlsdir := $($(target)_0_OUTDIR)/qtnls
|
---|
[1675] | 616 | local outbase := $(qtnlsdir)/$(notdir $(basename $(source)))
|
---|
| 617 | local out := $(outbase).qm
|
---|
| 618 | local dep := $(out).dep
|
---|
| 619 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 620 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 621 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 622 |
|
---|
| 623 | # default path + source dep.
|
---|
| 624 | ifneq ($(defpath),)
|
---|
[3349] | 625 | ifdef KMK_WITH_QUOTING
|
---|
[3328] | 626 | local source := $(qabspathex ,$(source),$(defpath))
|
---|
| 627 | local deps := $(qabspathex ,$(deps),$(defpath)) $(source)
|
---|
| 628 | local incs := $(qabspathex ,$(incs),$(defpath))
|
---|
| 629 | else
|
---|
[1771] | 630 | local source := $(abspathex $(source),$(defpath))
|
---|
| 631 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 632 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[3328] | 633 | endif
|
---|
[1675] | 634 | else
|
---|
| 635 | local deps += $(source)
|
---|
| 636 | endif
|
---|
| 637 |
|
---|
| 638 | # call the tool
|
---|
| 639 | ifndef TOOL_$(tool)_LRC_TS_CMDS
|
---|
| 640 | $(error kBuild: qt lrelease tool not found: TOOL_$(tool)_LRC_TS_CMDS)
|
---|
| 641 | endif
|
---|
| 642 | local cmds := $(TOOL_$(tool)_LRC_TS_CMDS)
|
---|
| 643 | local more_output := $(TOOL_$(tool)_LRC_TS_OUTPUT)
|
---|
| 644 | local maybe_output := $(TOOL_$(tool)_LRC_TS_OUTPUT_MAYBE)
|
---|
| 645 | local deps += $(TOOL_$(tool)_LRC_TS_DEPEND)
|
---|
| 646 | local orderdeps += $(TOOL_$(tool)_LRC_TS_DEPORD)
|
---|
| 647 |
|
---|
| 648 | # generate the link rule and update some source and target variables.
|
---|
| 649 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 650 | $(eval includedep $(dep))
|
---|
| 651 | endif
|
---|
[3557] | 652 | $(eval $(def_unit_qt6_target_pre_handle_translation_dx))
|
---|
[1675] | 653 |
|
---|
[3557] | 654 | endef # def_unit_qt6_target_pre_handle_translation
|
---|
[1675] | 655 |
|
---|
| 656 |
|
---|
| 657 |
|
---|
[1671] | 658 | ## wrapper for the UIC command dependencies.
|
---|
| 659 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3557] | 660 | _UNIT_QT6_RCC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT6_RCC_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1671] | 661 | else
|
---|
[3557] | 662 | _UNIT_QT6_RCC_CMDS_DEP =
|
---|
[1671] | 663 | endif
|
---|
| 664 |
|
---|
| 665 | ##
|
---|
[3557] | 666 | # def_unit_qt6_target_pre_handle_qrc helper that is expanded before evaluation.
|
---|
[1671] | 667 | #
|
---|
| 668 | # This is necessary to resolve reference to local variables before doing
|
---|
| 669 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 670 | # later in a different context and the result would be completely wrong.
|
---|
| 671 | #
|
---|
[3557] | 672 | define def_unit_qt6_target_pre_handle_rcc_dx
|
---|
[1671] | 673 |
|
---|
| 674 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
| 675 | $(deps) \
|
---|
[3557] | 676 | $(value _UNIT_QT6_RCC_CMDS_DEP) \
|
---|
[1671] | 677 | | \
|
---|
| 678 | $(orderdeps)
|
---|
| 679 | %$$(call MSG_TOOL,rcc,$(target),$(source),$$@)
|
---|
| 680 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
| 681 |
|
---|
| 682 | $(cmds)
|
---|
| 683 |
|
---|
| 684 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
| 685 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3160] | 686 | ifdef KBUILD_HAVE_OPTIMIZED_APPEND
|
---|
| 687 | %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
|
---|
[3557] | 688 | 'define $(target)_$(subst :,_,$(source))_QT6_RCC_CMDS_PREV_' \
|
---|
[3160] | 689 | '--insert-command=$(out)' \
|
---|
| 690 | 'endef'
|
---|
| 691 | else
|
---|
[1671] | 692 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[3557] | 693 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT6_RCC_CMDS_PREV_'
|
---|
[1671] | 694 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 695 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 696 | endif
|
---|
[3160] | 697 | endif
|
---|
[1671] | 698 |
|
---|
[3284] | 699 | $(target)_2_INTERMEDIATES += $(realout)
|
---|
[1671] | 700 | $(target)_GEN_SOURCES_ += $(realout)
|
---|
[2197] | 701 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 702 |
|
---|
[3557] | 703 | endef # def_unit_qt6_target_pre_handle_rcc_dx
|
---|
[1671] | 704 |
|
---|
| 705 | ##
|
---|
| 706 | # Source handler for .qrc sources (Qt resource files).
|
---|
| 707 | #
|
---|
| 708 | # @remarks $(evalvalctx me).
|
---|
[3557] | 709 | define def_unit_qt6_src_handler_qrc
|
---|
[1671] | 710 | local type := RCC
|
---|
| 711 |
|
---|
| 712 | # fetch the properties.
|
---|
| 713 | local tool := $(kb-src-tool dummy_var)
|
---|
[2239] | 714 | local qtrccdir := $($(target)_0_OUTDIR)/qtrcc
|
---|
[1671] | 715 | local outbase := $(qtrccdir)/$(notdir $(basename $(source)))
|
---|
| 716 | local out := $(outbase).tmp.gen.cpp
|
---|
| 717 | local realout := $(outbase).gen.cpp
|
---|
| 718 | local dep := $(realout).dep
|
---|
| 719 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 720 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 721 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 722 |
|
---|
| 723 | # default path + source dep.
|
---|
| 724 | ifneq ($(defpath),)
|
---|
[3349] | 725 | ifdef KMK_WITH_QUOTING
|
---|
| 726 | local source := $(qabspathex ,$(source),$(defpath))
|
---|
| 727 | local deps := $(qabspathex ,$(deps),$(defpath)) $(source)
|
---|
| 728 | local incs := $(qabspathex ,$(incs),$(defpath))
|
---|
| 729 | else
|
---|
[1771] | 730 | local source := $(abspathex $(source),$(defpath))
|
---|
| 731 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 732 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[3328] | 733 | endif
|
---|
[1671] | 734 | else
|
---|
| 735 | local deps += $(source)
|
---|
| 736 | endif
|
---|
| 737 |
|
---|
| 738 | # call the tool
|
---|
| 739 | ifndef TOOL_$(tool)_RCC_QRC_CMDS
|
---|
| 740 | $(error kBuild: qt rcc tool not found: TOOL_$(tool)_RCC_QRC_CMDS)
|
---|
| 741 | endif
|
---|
| 742 | local cmds := $(TOOL_$(tool)_RCC_QRC_CMDS)
|
---|
| 743 | local more_output := $(TOOL_$(tool)_RCC_QRC_OUTPUT)
|
---|
| 744 | local maybe_output := $(TOOL_$(tool)_RCC_QRC_OUTPUT_MAYBE)
|
---|
| 745 | local deps += $(TOOL_$(tool)_RCC_QRC_DEPEND)
|
---|
| 746 | local orderdeps += $(TOOL_$(tool)_RCC_QRC_DEPORD)
|
---|
| 747 |
|
---|
| 748 | # generate the link rule and update some source and target variables.
|
---|
| 749 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 750 | $(eval includedep $(dep))
|
---|
| 751 | endif
|
---|
[3557] | 752 | $(eval $(def_unit_qt6_target_pre_handle_rcc_dx))
|
---|
[1671] | 753 |
|
---|
[3557] | 754 | endef # def_unit_qt6_src_handler_qrc
|
---|
[1671] | 755 |
|
---|
| 756 |
|
---|
[1675] | 757 |
|
---|
[1671] | 758 | ## wrapper for the UIC command dependencies.
|
---|
| 759 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3557] | 760 | _UNIT_QT6_UIC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT6_UIC_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1671] | 761 | else
|
---|
[3557] | 762 | _UNIT_QT6_UIC_CMDS_DEP =
|
---|
[1671] | 763 | endif
|
---|
| 764 |
|
---|
| 765 | ##
|
---|
[3557] | 766 | # def_unit_qt6_src_handler_ui helper that is expanded before evaluation.
|
---|
[1671] | 767 | #
|
---|
| 768 | # This is necessary to resolve reference to local variables before doing
|
---|
| 769 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 770 | # later in a different context and the result would be completely wrong.
|
---|
| 771 | #
|
---|
[3557] | 772 | define def_unit_qt6_target_pre_handle_ui_dx
|
---|
[1671] | 773 |
|
---|
| 774 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
| 775 | $(deps) \
|
---|
[3557] | 776 | $(value _UNIT_QT6_UIC_CMDS_DEP) \
|
---|
[1671] | 777 | | \
|
---|
| 778 | $(orderdeps)
|
---|
| 779 | %$$(call MSG_TOOL,uic,$(target),$(source),$$@)
|
---|
| 780 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
| 781 |
|
---|
| 782 | $(cmds)
|
---|
| 783 |
|
---|
| 784 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
| 785 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3160] | 786 | ifdef KBUILD_HAVE_OPTIMIZED_APPEND
|
---|
| 787 | %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
|
---|
[3557] | 788 | 'define $(target)_$(subst :,_,$(source))_QT6_UIC_CMDS_PREV_' \
|
---|
[3160] | 789 | '--insert-command=$(out)' \
|
---|
| 790 | 'endef'
|
---|
| 791 | else
|
---|
[1671] | 792 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[3557] | 793 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT6_UIC_CMDS_PREV_'
|
---|
[1671] | 794 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 795 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 796 | endif
|
---|
[3160] | 797 | endif
|
---|
[1671] | 798 |
|
---|
[3284] | 799 | $(target)_2_INTERMEDIATES += $(realout)
|
---|
[2197] | 800 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 801 |
|
---|
[3557] | 802 | endef # def_unit_qt6_target_pre_handle_ui_dx
|
---|
[1671] | 803 |
|
---|
| 804 | ##
|
---|
| 805 | # Source handler for .ui sources.
|
---|
| 806 | #
|
---|
| 807 | # @remarks $(evalvalctx me).
|
---|
[3557] | 808 | define def_unit_qt6_src_handler_ui
|
---|
[1671] | 809 | local type := UIC
|
---|
| 810 |
|
---|
| 811 | # fetch the properties.
|
---|
| 812 | local tool := $(kb-src-tool dummy_var)
|
---|
[2239] | 813 | local qtuicdir := $($(target)_0_OUTDIR)/qtuic
|
---|
[1671] | 814 | local outbase := $(qtuicdir)/$(notdir $(basename $(source)))
|
---|
| 815 | local out := $(outbase).tmp.gen.h
|
---|
| 816 | local realout := $(outbase).gen.h
|
---|
| 817 | local dep := $(realout).dep
|
---|
| 818 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 819 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 820 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 821 |
|
---|
| 822 | # default path + source dep.
|
---|
| 823 | ifneq ($(defpath),)
|
---|
[3349] | 824 | ifdef KMK_WITH_QUOTING
|
---|
[3328] | 825 | local source := $(qabspathex ,$(source),$(defpath))
|
---|
| 826 | local deps := $(qabspathex ,$(deps),$(defpath)) $(source)
|
---|
| 827 | local incs := $(qabspathex ,$(incs),$(defpath))
|
---|
| 828 | else
|
---|
[1771] | 829 | local source := $(abspathex $(source),$(defpath))
|
---|
| 830 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 831 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[3328] | 832 | endif
|
---|
[1671] | 833 | else
|
---|
| 834 | local deps += $(source)
|
---|
| 835 | endif
|
---|
| 836 |
|
---|
| 837 | # call the tool
|
---|
| 838 | ifndef TOOL_$(tool)_UIC_UI_CMDS
|
---|
| 839 | $(error kBuild: qt uic tool not found: TOOL_$(tool)_UIC_UI_CMDS)
|
---|
| 840 | endif
|
---|
| 841 | local cmds := $(TOOL_$(tool)_UIC_UI_CMDS)
|
---|
| 842 | local more_output := $(TOOL_$(tool)_UIC_UI_OUTPUT)
|
---|
| 843 | local maybe_output := $(TOOL_$(tool)_UIC_UI_OUTPUT_MAYBE)
|
---|
| 844 | local deps += $(TOOL_$(tool)_UIC_UI_DEPEND)
|
---|
| 845 | local orderdeps += $(TOOL_$(tool)_UIC_UI_DEPORD)
|
---|
| 846 |
|
---|
| 847 | # generate the link rule and update some source and target variables.
|
---|
| 848 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 849 | $(eval includedep $(dep))
|
---|
| 850 | endif
|
---|
[3557] | 851 | $(eval $(def_unit_qt6_target_pre_handle_ui_dx))
|
---|
[1671] | 852 |
|
---|
[3557] | 853 | endef # def_unit_qt6_src_handler_ui
|
---|
[1671] | 854 |
|
---|
| 855 |
|
---|
[1675] | 856 |
|
---|
[1671] | 857 | ## wrapper for the MOC command dependencies.
|
---|
| 858 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3557] | 859 | _UNIT_QT6_MOC_HPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT6_MOC_HPP_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1671] | 860 | else
|
---|
[3557] | 861 | _UNIT_QT6_MOC_HPP_CMDS_DEP =
|
---|
[1671] | 862 | endif
|
---|
| 863 |
|
---|
| 864 | ##
|
---|
[3557] | 865 | # def_unit_qt6_target_pre_handle_moc_hdr helper that is expanded before evaluation.
|
---|
[1671] | 866 | #
|
---|
| 867 | # This is necessary to resolve reference to local variables before doing
|
---|
| 868 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 869 | # later in a different context and the result would be completely wrong.
|
---|
| 870 | #
|
---|
[3557] | 871 | define def_unit_qt6_target_pre_handle_moc_hdr_dx
|
---|
[1671] | 872 |
|
---|
| 873 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
| 874 | $(deps) \
|
---|
[3557] | 875 | $(value _UNIT_QT6_MOC_HPP_CMDS_DEP) \
|
---|
[1671] | 876 | | \
|
---|
[3301] | 877 | $(orderdeps) $(my_target_intermediate_vars)
|
---|
[1671] | 878 | %$$(call MSG_TOOL,moc,$(target),$(source),$$@)
|
---|
| 879 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
| 880 |
|
---|
| 881 | $(cmds)
|
---|
| 882 |
|
---|
| 883 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
| 884 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3160] | 885 | ifdef KBUILD_HAVE_OPTIMIZED_APPEND
|
---|
| 886 | %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
|
---|
[3557] | 887 | 'define $(target)_$(subst :,_,$(source))_QT6_MOC_HPP_CMDS_PREV_' \
|
---|
[3160] | 888 | '--insert-command=$(out)' \
|
---|
| 889 | 'endef'
|
---|
| 890 | else
|
---|
[1671] | 891 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[3557] | 892 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT6_MOC_HPP_CMDS_PREV_'
|
---|
[1671] | 893 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 894 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 895 | endif
|
---|
[3160] | 896 | endif
|
---|
[1671] | 897 |
|
---|
[3284] | 898 | $(target)_2_INTERMEDIATES += $(realout)
|
---|
[1671] | 899 | $(target)_GEN_SOURCES_ += $(realout)
|
---|
[2197] | 900 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 901 |
|
---|
| 902 | endef
|
---|
| 903 |
|
---|
| 904 | ##
|
---|
[1683] | 905 | # Handle a source file listed in QT_MOCHDRS.
|
---|
[1671] | 906 | #
|
---|
[1675] | 907 | # The files listed in QT_MOCHDRS uses the Q_OBJECT macro and we will
|
---|
| 908 | # generate a .cpp file for each of them and add it to the generated
|
---|
| 909 | # sources so that it's compiled and linked. (There is an alternative
|
---|
| 910 | # way to do this where the .cpp file is included, this isn't currently
|
---|
| 911 | # supported by this unit.)
|
---|
[1671] | 912 | #
|
---|
| 913 | # @remarks Invoked via $(evalvalctx ).
|
---|
[3557] | 914 | define def_unit_qt6_target_pre_handle_moc_hdr
|
---|
[1671] | 915 | local type := MOC
|
---|
| 916 |
|
---|
| 917 | # fetch the properties.
|
---|
| 918 | local tool := $(kb-src-tool dummy_var)
|
---|
| 919 | local outbase := $(qtmocdir)/$(notdir $(basename $(source)))
|
---|
| 920 | local out := $(outbase).tmp.cpp
|
---|
| 921 | local realout := $(outbase).cpp
|
---|
| 922 | local dep := $(realout).dep
|
---|
| 923 | local defs := $(kb-src-prop DEFS,dummy_var,left-to-right)
|
---|
| 924 | local incs := $(kb-src-prop INCS,dummy_var,right-to-left)
|
---|
| 925 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 926 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 927 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 928 |
|
---|
| 929 | # default path + source dep.
|
---|
| 930 | ifneq ($(defpath),)
|
---|
[3349] | 931 | ifdef KMK_WITH_QUOTING
|
---|
[3328] | 932 | local source := $(qabspathex ,$(source),$(defpath))
|
---|
| 933 | local deps := $(qabspathex ,$(deps),$(defpath)) $(source)
|
---|
| 934 | local incs := $(qabspathex ,$(incs),$(defpath))
|
---|
| 935 | else
|
---|
[1771] | 936 | local source := $(abspathex $(source),$(defpath))
|
---|
| 937 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 938 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[3328] | 939 | endif
|
---|
[1671] | 940 | else
|
---|
| 941 | local deps += $(source)
|
---|
| 942 | endif
|
---|
| 943 |
|
---|
| 944 | # call the tool
|
---|
| 945 | ifndef TOOL_$(tool)_MOC_HPP_CMDS
|
---|
| 946 | $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_HPP_CMDS)
|
---|
| 947 | endif
|
---|
| 948 | local cmds := $(TOOL_$(tool)_MOC_HPP_CMDS)
|
---|
| 949 | local more_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT)
|
---|
| 950 | local maybe_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT_MAYBE)
|
---|
| 951 | local deps += $(TOOL_$(tool)_MOC_HPP_DEPEND)
|
---|
| 952 | local orderdeps += $(TOOL_$(tool)_MOC_HPP_DEPORD)
|
---|
| 953 |
|
---|
| 954 | # generate the link rule and update some source and target variables.
|
---|
| 955 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 956 | $(eval includedep $(dep))
|
---|
| 957 | endif
|
---|
[3557] | 958 | $(eval $(def_unit_qt6_target_pre_handle_moc_hdr_dx))
|
---|
[1671] | 959 |
|
---|
[3557] | 960 | endef # def_unit_qt6_target_pre_handle_moc_hdr
|
---|
[1671] | 961 |
|
---|
| 962 |
|
---|
[1683] | 963 | ## wrapper for the MOC command dependencies.
|
---|
| 964 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3557] | 965 | _UNIT_QT6_MOC_CPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT6_MOC_CPP_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1683] | 966 | else
|
---|
[3557] | 967 | _UNIT_QT6_MOC_CPP_CMDS_DEP =
|
---|
[1683] | 968 | endif
|
---|
| 969 |
|
---|
[1671] | 970 | ##
|
---|
[3557] | 971 | # def_unit_qt6_target_pre_handle_moc_src helper that is expanded before evaluation.
|
---|
[1671] | 972 | #
|
---|
| 973 | # This is necessary to resolve reference to local variables before doing
|
---|
| 974 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 975 | # later in a different context and the result would be completely wrong.
|
---|
| 976 | #
|
---|
[3557] | 977 | define def_unit_qt6_target_pre_handle_moc_src_dx
|
---|
[1671] | 978 |
|
---|
| 979 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
| 980 | $(deps) \
|
---|
[3557] | 981 | $(value _UNIT_QT6_MOC_CPP_CMDS_DEP) \
|
---|
[1671] | 982 | | \
|
---|
[3301] | 983 | $(orderdeps) $(my_target_intermediate_vars)
|
---|
[1671] | 984 | %$$(call MSG_TOOL,moc,$(target),$(source),$$@)
|
---|
| 985 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
| 986 |
|
---|
| 987 | $(cmds)
|
---|
| 988 |
|
---|
| 989 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
| 990 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[3160] | 991 | ifdef KBUILD_HAVE_OPTIMIZED_APPEND
|
---|
| 992 | %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
|
---|
[3557] | 993 | 'define $(target)_$(subst :,_,$(source))_QT6_MOC_CPP_CMDS_PREV_' \
|
---|
[3160] | 994 | '--insert-command=$(out)' \
|
---|
| 995 | 'endef'
|
---|
| 996 | else
|
---|
[1671] | 997 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[3557] | 998 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT6_MOC_CPP_CMDS_PREV_'
|
---|
[1671] | 999 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 1000 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 1001 | endif
|
---|
[3160] | 1002 | endif
|
---|
[1671] | 1003 |
|
---|
[3284] | 1004 | $(target)_2_INTERMEDIATES += $(realout)
|
---|
[2197] | 1005 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 1006 |
|
---|
| 1007 | endef
|
---|
| 1008 |
|
---|
| 1009 | ##
|
---|
| 1010 | # Handle a source file listed in QT_MOCSRCS.
|
---|
| 1011 | #
|
---|
| 1012 | # The files listed in QT_MOCSRCS uses the Q_OBJECT macro and will include
|
---|
| 1013 | # a .moc file that we're expected to generate here.
|
---|
| 1014 | #
|
---|
| 1015 | # @remarks Invoked via $(evalvalctx ).
|
---|
[3557] | 1016 | define def_unit_qt6_target_pre_handle_moc_src
|
---|
[1671] | 1017 | local type := MOC
|
---|
| 1018 |
|
---|
| 1019 | # fetch the properties.
|
---|
| 1020 | local tool := $(kb-src-tool dummy_var)
|
---|
| 1021 | local outbase := $(qtmocdir)/$(notdir $(basename $(source)))
|
---|
| 1022 | local out := $(outbase).tmp.moc
|
---|
| 1023 | local realout := $(outbase).moc
|
---|
| 1024 | local dep := $(realout).dep
|
---|
| 1025 | local defs := $(kb-src-prop DEFS,dummy_var,left-to-right)
|
---|
| 1026 | local incs := $(kb-src-prop INCS,dummy_var,right-to-left)
|
---|
| 1027 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 1028 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 1029 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 1030 |
|
---|
| 1031 | # default path + source dep.
|
---|
| 1032 | ifneq ($(defpath),)
|
---|
[3349] | 1033 | ifdef KMK_WITH_QUOTING
|
---|
[3328] | 1034 | local source := $(qabspathex ,$(source),$(defpath))
|
---|
| 1035 | local deps := $(qabspathex ,$(deps),$(defpath)) $(source)
|
---|
| 1036 | local incs := $(qabspathex ,$(incs),$(defpath))
|
---|
| 1037 | else
|
---|
[1771] | 1038 | local source := $(abspathex $(source),$(defpath))
|
---|
| 1039 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 1040 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[3328] | 1041 | endif
|
---|
[1671] | 1042 | else
|
---|
| 1043 | local deps += $(source)
|
---|
| 1044 | endif
|
---|
| 1045 |
|
---|
| 1046 | # call the tool
|
---|
| 1047 | ifndef TOOL_$(tool)_MOC_CPP_CMDS
|
---|
| 1048 | $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_CPP_CMDS)
|
---|
| 1049 | endif
|
---|
| 1050 | local cmds := $(TOOL_$(tool)_MOC_CPP_CMDS)
|
---|
| 1051 | local more_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT)
|
---|
| 1052 | local maybe_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT_MAYBE)
|
---|
| 1053 | local deps += $(TOOL_$(tool)_MOC_CPP_DEPEND)
|
---|
| 1054 | local orderdeps += $(TOOL_$(tool)_MOC_CPP_DEPORD)
|
---|
| 1055 |
|
---|
| 1056 | # generate the link rule and update some source and target variables.
|
---|
| 1057 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 1058 | $(eval includedep $(dep))
|
---|
| 1059 | endif
|
---|
[3557] | 1060 | $(eval $(def_unit_qt6_target_pre_handle_moc_src_dx))
|
---|
[1671] | 1061 |
|
---|
[3557] | 1062 | endef # def_unit_qt6_target_pre_handle_moc_src
|
---|
[1671] | 1063 |
|
---|
| 1064 |
|
---|
| 1065 | ##
|
---|
| 1066 | # Adds sources containing Q_OBJECT to QT_MOCSRCS.
|
---|
[3557] | 1067 | define def_unit_qt6_target_pre_cpp_source
|
---|
[1671] | 1068 | ifneq ($(file-size $(source)),-1)
|
---|
| 1069 | ifneq ($(strip $(shell $(SED) -f $(KBUILD_PATH)/units/qt-Q_OBJECT.sed $(source))),)
|
---|
| 1070 | $(eval $(target)_QT_MOCSRCS += $(source))
|
---|
| 1071 | endif
|
---|
| 1072 | endif
|
---|
[3557] | 1073 | endef # def_unit_qt6_target_pre_cpp_source
|
---|
[1671] | 1074 |
|
---|
| 1075 | ##
|
---|
| 1076 | # Invoked early in the processing of a target that uses the Qt unit.
|
---|
| 1077 | #
|
---|
| 1078 | # It will append the qt source handlers to the target (.h, .ui, .ts,
|
---|
| 1079 | # .png, .bmp, .gif).
|
---|
| 1080 | #
|
---|
| 1081 | # It will then check all the C++ sources and check which needs
|
---|
| 1082 | # a .moc files and generate rules and dependencies fofor these
|
---|
| 1083 | #
|
---|
[3557] | 1084 | define def_unit_qt6_target_pre
|
---|
[1671] | 1085 |
|
---|
[1675] | 1086 | # Make QTTOOL the default for the specific Qt tools instead of TOOL.
|
---|
| 1087 | ifneq ($($(target)_QTTOOL),)
|
---|
| 1088 | ifeq ($($(target)_MOCTOOL),)
|
---|
[1682] | 1089 | $(target)_MOCTOOL := $($(target)_QTTOOL)
|
---|
[1675] | 1090 | endif
|
---|
| 1091 | ifeq ($($(target)_UICTOOL),)
|
---|
[1682] | 1092 | $(target)_UICTOOL := $($(target)_QTTOOL)
|
---|
[1675] | 1093 | endif
|
---|
| 1094 | ifeq ($($(target)_RCCTOOL),)
|
---|
[1682] | 1095 | $(target)_RCCTOOL := $($(target)_QTTOOL)
|
---|
[1675] | 1096 | endif
|
---|
| 1097 | ifeq ($($(target)_LRCTOOL),)
|
---|
[1682] | 1098 | $(target)_LRCTOOL := $($(target)_QTTOOL)
|
---|
[1675] | 1099 | endif
|
---|
| 1100 | endif
|
---|
| 1101 |
|
---|
[2176] | 1102 | # Deal with QT_MODULES, QT_PREFIX and QT_INFIX.
|
---|
[1677] | 1103 | local qt_modules := \
|
---|
[1761] | 1104 | $($(target)_QT_MODULES.$(bld_trg)) \
|
---|
| 1105 | $($(target)_QT_MODULES.$(bld_trg_arch)) \
|
---|
| 1106 | $($(target)_QT_MODULES.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1107 | $($(target)_QT_MODULES.$(bld_trg_cpu)) \
|
---|
| 1108 | $($(target)_QT_MODULES.$(bld_type)) \
|
---|
[1677] | 1109 | $($(target)_QT_MODULES)
|
---|
| 1110 | local qt_prefix := $(firstword \
|
---|
[1761] | 1111 | $($(target)_QT_PREFIX.$(bld_trg)) \
|
---|
| 1112 | $($(target)_QT_PREFIX.$(bld_trg_arch)) \
|
---|
| 1113 | $($(target)_QT_PREFIX.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1114 | $($(target)_QT_PREFIX.$(bld_trg_cpu)) \
|
---|
| 1115 | $($(target)_QT_PREFIX.$(bld_type)) \
|
---|
[1677] | 1116 | $($(target)_QT_PREFIX))
|
---|
[2176] | 1117 | local qt_infix := $(firstword \
|
---|
| 1118 | $($(target)_QT_INFIX.$(bld_trg)) \
|
---|
| 1119 | $($(target)_QT_INFIX.$(bld_trg_arch)) \
|
---|
| 1120 | $($(target)_QT_INFIX.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1121 | $($(target)_QT_INFIX.$(bld_trg_cpu)) \
|
---|
| 1122 | $($(target)_QT_INFIX.$(bld_type)) \
|
---|
| 1123 | $($(target)_QT_INFIX))
|
---|
[1677] | 1124 | ifeq ($(bld_trg),darwin)
|
---|
[1681] | 1125 | # Adding -F to CXXFLAGS is necessary to make #include <QtCore/qstring.h> stuff work...
|
---|
[3557] | 1126 | $(eval $(target)_CXXFLAGS += -F$(PATH_SDK_QT6_LIB) )
|
---|
| 1127 | $(eval $(target)_OBJCXXFLAGS += -F$(PATH_SDK_QT6_LIB) )
|
---|
| 1128 | $(eval $(target)_LDFLAGS += -F$(PATH_SDK_QT6_LIB) $(foreach module,$(qt_modules), -framework $(qt_prefix)Qt$(module)$(qt_infix)) )
|
---|
[3559] | 1129 | $(eval $(target)_INCS += $(foreach module,$(qt_modules), $(PATH_SDK_QT6_LIB)/$(qt_prefix)Qt$(module)$(qt_infix).framework/Versions/A/Headers) )
|
---|
[1677] | 1130 | else
|
---|
[1679] | 1131 | ifeq ($(bld_trg),win)
|
---|
[3557] | 1132 | $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT6_LIB)/$(qt_prefix)Qt6$(module)$(qt_infix)$(SUFF_LIB)) )
|
---|
[1679] | 1133 | else
|
---|
[3557] | 1134 | $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT6_LIB)/lib$(qt_prefix)Qt6$(module)$(qt_infix)$(SUFF_DLL)) )
|
---|
[1679] | 1135 | endif
|
---|
[3557] | 1136 | $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT6_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT6_INC) )
|
---|
[1677] | 1137 | endif
|
---|
[1681] | 1138 | $(eval $(target)_DEFS += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) )
|
---|
[1677] | 1139 |
|
---|
| 1140 |
|
---|
[1671] | 1141 | # Autodetect source files with Q_OBJECT references if QT_MOCSRCS is undefined. (slow)
|
---|
| 1142 | # Tip: Use target_QT_MOCSRCS = $(NO_SUCH_VARIABLE) to avoid this.
|
---|
| 1143 | ifndef $(target)_QT_MOCSRCS
|
---|
| 1144 | $(foreach source, $(filter %.cxx %.CXX %.cpp %.CPP %.cc %.CC,\
|
---|
[1761] | 1145 | $($(target)_SOURCES.$(bld_trg)) \
|
---|
| 1146 | $($(target)_SOURCES.$(bld_trg_arch)) \
|
---|
| 1147 | $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1148 | $($(target)_SOURCES.$(bld_trg_cpu)) \
|
---|
| 1149 | $($(target)_SOURCES.$(bld_type)) \
|
---|
[1671] | 1150 | $($(target)_SOURCES) \
|
---|
[3557] | 1151 | ), $(evalval def_unit_qt6_target_pre_cpp_source))
|
---|
[1671] | 1152 | endif
|
---|
| 1153 |
|
---|
| 1154 | # Install source handlers for .ui files.
|
---|
| 1155 | $(target)_SRC_HANDLERS += \
|
---|
[3557] | 1156 | .ui:def_unit_qt6_src_handler_ui \
|
---|
| 1157 | .UI:def_unit_qt6_src_handler_ui \
|
---|
| 1158 | .qrc:def_unit_qt6_src_handler_qrc \
|
---|
| 1159 | .qrc:def_unit_qt6_src_handler_qrc
|
---|
[1671] | 1160 |
|
---|
| 1161 | # Calc the MOC and UI output directories and add them to BLDDIRS and INCS.
|
---|
[2239] | 1162 | local qtmocdir := $($(target)_0_OUTDIR)/qtmoc
|
---|
| 1163 | local qtuicdir := $($(target)_0_OUTDIR)/qtuic
|
---|
| 1164 | local qtrccdir := $($(target)_0_OUTDIR)/qtrcc
|
---|
| 1165 | local qtnlsdir := $($(target)_0_OUTDIR)/qtnls
|
---|
[1675] | 1166 | $(eval $(target)_BLDDIRS += $(qtmocdir) $(qtuicdir) $(qtrccdir) $(qtnlsdir))
|
---|
| 1167 | $(eval $(target)_INCS += $(qtmocdir) $(qtuicdir))
|
---|
[1671] | 1168 |
|
---|
[3301] | 1169 | # Since we add a lot of stuff to 2_INTERMEDIATES, we must exclude it from the intermediates
|
---|
| 1170 | # used by the rules we generate to avoid circular dependencies.
|
---|
| 1171 | local my_target_intermediate_vars := $(filter-out %_2_INTERMEDIATES$(CLOSEPAR),$(target_intermediate_vars))
|
---|
| 1172 |
|
---|
[1671] | 1173 | # Deal with QT_MOCSRCS.
|
---|
| 1174 | $(foreach source, \
|
---|
[1761] | 1175 | $($(target)_QT_MOCSRCS.$(bld_trg)) \
|
---|
| 1176 | $($(target)_QT_MOCSRCS.$(bld_trg_arch)) \
|
---|
| 1177 | $($(target)_QT_MOCSRCS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1178 | $($(target)_QT_MOCSRCS.$(bld_trg_cpu)) \
|
---|
| 1179 | $($(target)_QT_MOCSRCS.$(bld_type)) \
|
---|
[1671] | 1180 | $($(target)_QT_MOCSRCS) \
|
---|
[3557] | 1181 | , $(evalvalctx def_unit_qt6_target_pre_handle_moc_src))
|
---|
[1671] | 1182 |
|
---|
| 1183 | # Deal with QT_MOCHDRS.
|
---|
| 1184 | $(foreach source, \
|
---|
[1761] | 1185 | $($(target)_QT_MOCHDRS.$(bld_trg)) \
|
---|
| 1186 | $($(target)_QT_MOCHDRS.$(bld_trg_arch)) \
|
---|
| 1187 | $($(target)_QT_MOCHDRS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1188 | $($(target)_QT_MOCHDRS.$(bld_trg_cpu)) \
|
---|
| 1189 | $($(target)_QT_MOCHDRS.$(bld_type)) \
|
---|
[1671] | 1190 | $($(target)_QT_MOCHDRS) \
|
---|
[3557] | 1191 | , $(evalvalctx def_unit_qt6_target_pre_handle_moc_hdr))
|
---|
[1671] | 1192 |
|
---|
[1675] | 1193 | # Deal with QT_TRANSLATIONS.
|
---|
| 1194 | # ASSUMES (_ALL_)INSTALLS is processed after the targets using this unit.
|
---|
| 1195 | local translations := \
|
---|
[1761] | 1196 | $($(target)_QT_TRANSLATIONS.$(bld_trg)) \
|
---|
| 1197 | $($(target)_QT_TRANSLATIONS.$(bld_trg_arch)) \
|
---|
| 1198 | $($(target)_QT_TRANSLATIONS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1199 | $($(target)_QT_TRANSLATIONS.$(bld_trg_cpu)) \
|
---|
| 1200 | $($(target)_QT_TRANSLATIONS.$(bld_type)) \
|
---|
[1675] | 1201 | $($(target)_QT_TRANSLATIONS)
|
---|
| 1202 | ifneq ($(strip $(translations)),)
|
---|
[2479] | 1203 | local expr := _ALL_INSTALLS_IMPLICIT += $(target)-inst-nls
|
---|
[1675] | 1204 | $(eval $(expr))
|
---|
| 1205 | ifdef $(target)_QT_TRANSLATIONS_TEMPLATE
|
---|
| 1206 | $(target)-inst-nls_TEMPLATE := $($(target)_QT_TRANSLATIONS_TEMPLATE)
|
---|
[1688] | 1207 | else
|
---|
| 1208 | $(target)-inst-nls_MODE := 0644
|
---|
[1675] | 1209 | endif
|
---|
| 1210 | ifdef $(target)_QT_TRANSLATIONS_INST
|
---|
| 1211 | $(target)-inst-nls_INST := $($(target)_QT_TRANSLATIONS_INST)
|
---|
| 1212 | endif
|
---|
| 1213 | $(target)-inst-nls_SOURCES :=
|
---|
| 1214 | $(foreach source, $(translations)\
|
---|
[3557] | 1215 | , $(evalvalctx def_unit_qt6_target_pre_handle_translation))
|
---|
[1675] | 1216 | endif
|
---|
| 1217 |
|
---|
[3557] | 1218 | endef # def_unit_qt6_target_pre
|
---|
[1671] | 1219 |
|
---|
[1767] | 1220 |
|
---|
| 1221 | #
|
---|
| 1222 | # Rule for debugging.
|
---|
| 1223 | #
|
---|
[3557] | 1224 | unit-qt6-show-vars:
|
---|
| 1225 | @$(ECHO) 'The Qt6 SDK variables:'
|
---|
| 1226 | @$(ECHO) ' PATH_SDK_QT6 = "$(PATH_SDK_QT6)"'
|
---|
| 1227 | @$(ECHO) ' PATH_SDK_QT6_INC = "$(PATH_SDK_QT6_INC)"'
|
---|
| 1228 | @$(ECHO) ' PATH_SDK_QT6_LIB = "$(PATH_SDK_QT6_LIB)"'
|
---|
| 1229 | @$(ECHO) ' PATH_SDK_QT6_LIB.amd64 = "$(PATH_SDK_QT6_LIB.amd64)"'
|
---|
| 1230 | @$(ECHO) ' PATH_SDK_QT6_LIB.x86 = "$(PATH_SDK_QT6_LIB.x86)"'
|
---|
| 1231 | @$(ECHO) 'The Qt6 TOOL variables:'
|
---|
| 1232 | @$(ECHO) ' PATH_TOOL_QT6_BIN = "$(PATH_TOOL_QT6_BIN)"'
|
---|
| 1233 | @$(ECHO) ' PATH_TOOL_QT6_LIBEXEC = "$(PATH_TOOL_QT6_LIBEXEC)"'
|
---|
| 1234 | @$(ECHO) ' TOOL_QT6_BIN_SUFF = "$(TOOL_QT6_BIN_SUFF)"'
|
---|
| 1235 | @$(ECHO) ' TOOL_QT6_LIBEXEC_SUFF = "$(TOOL_QT6_LIBEXEC_SUFF)"'
|
---|
| 1236 | @$(ECHO) ' TOOL_QT6_MOC = "$(TOOL_QT6_MOC)"'
|
---|
| 1237 | @$(ECHO) ' TOOL_QT6_UIC = "$(TOOL_QT6_UIC)"'
|
---|
| 1238 | @$(ECHO) ' TOOL_QT6_RCC = "$(TOOL_QT6_RCC)"'
|
---|
| 1239 | @$(ECHO) ' TOOL_QT6_LRC = "$(TOOL_QT6_LRC)"'
|
---|
| 1240 | @$(ECHO) ' TOOL_QT6_LUPDATE = "$(TOOL_QT6_LUPDATE)"'
|
---|
[1769] | 1241 |
|
---|