[1671] | 1 | # $Id: qt4.kmk 2369 2009-11-30 00:31:21Z bird $
|
---|
| 2 | ## @file
|
---|
[1676] | 3 | # Qt 4 unit.
|
---|
[1671] | 4 | #
|
---|
| 5 |
|
---|
| 6 | #
|
---|
[2243] | 7 | # Copyright (c) 2008-2009 knut st. osmundsen <bird-kBuild-spamix@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 |
|
---|
[1682] | 35 | ifdef UNIT_qt4
|
---|
| 36 | $(error kBuild: The qt4 unit was included twice!)
|
---|
| 37 | endif
|
---|
[1671] | 38 | UNIT_qt4 = qt4
|
---|
| 39 |
|
---|
| 40 |
|
---|
[1682] | 41 | ifndef UNIT_qt3
|
---|
| 42 | # Add our target properties (same as qt3).
|
---|
| 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 | #
|
---|
| 53 | # The QT4 SDK.
|
---|
| 54 | #
|
---|
| 55 | # This is implemented here rather than in sdks/QT4.kmk to enforce the global USES.
|
---|
| 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.
|
---|
[1671] | 60 | SDK_QT4 = Qt4
|
---|
| 61 |
|
---|
[1677] | 62 | # SDK Specific Properties
|
---|
[1767] | 63 | # PATH_SDK_QT4 - The general Qt4 root directory.
|
---|
| 64 | # PATH_SDK_QT4_INC - The include directory.
|
---|
| 65 | # PATH_SDK_QT4_LIB.amd64 - The lib directory for AMD64.
|
---|
| 66 | # PATH_SDK_QT4_LIB.x86 - The lib directory for X86.
|
---|
| 67 | # PATH_SDK_QT4_LIB - The lib directory for KBUILD_TARGET.
|
---|
[1677] | 68 | ifndef PATH_SDK_QT4
|
---|
[2323] | 69 | PATH_SDK_QT4 := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_TRG)/qt/v4*)))
|
---|
[1677] | 70 | ifeq ($(PATH_SDK_QT4),)
|
---|
| 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)
|
---|
| 74 | PATH_SDK_QT4 := $(patsubst %/Frameworks/QtCore.framework/Versions/4,%,$(firstword $(wildcard /Library/Frameworks/QtCore.framework/Versions/4)))
|
---|
| 75 | else ifeq ($(KBUILD_TARGET),win)
|
---|
| 76 | # No idea here yet...
|
---|
[1767] | 77 | else ifeq ($(KBUILD_TARGET),ose)
|
---|
| 78 | # No port...
|
---|
[1677] | 79 | else
|
---|
| 80 | # The Unices. Includes and esp. libs are tricky, so override the PATH_SDK_QT4_LIB* stuff if it doesn't work.
|
---|
[1767] | 81 | # Try find the general root of thing by looking for the qt3to4 program, if not found, then look for rcc.
|
---|
| 82 | PATH_SDK_QT4 := $(patsubst %/bin/qt3to4,%,$(firstword $(wildcard \
|
---|
| 83 | /usr/bin/qt3to4 \
|
---|
| 84 | /usr/local/bin/qt3to4 \
|
---|
| 85 | /usr/qt/4/bin/qt3to4 \
|
---|
| 86 | /usr/share/qt4/bin/qt3to4 \
|
---|
| 87 | )))
|
---|
| 88 | ifeq ($(PATH_SDK_QT4),)
|
---|
[1774] | 89 | PATH_SDK_QT4 := $(patsubst %/bin/rcc,%,$(firstword $(wildcard \
|
---|
[1767] | 90 | /usr/bin/rcc \
|
---|
| 91 | /usr/local/bin/rcc \
|
---|
| 92 | /usr/qt/4/bin/rcc \
|
---|
| 93 | /usr/share/qt4/bin/rcc \
|
---|
| 94 | )))
|
---|
| 95 | endif
|
---|
[1677] | 96 | ifneq ($(PATH_SDK_QT4),)
|
---|
[1767] | 97 | export PATH_SDK_QT4
|
---|
[1773] | 98 |
|
---|
[1767] | 99 | # Locate the include files.
|
---|
[1677] | 100 | ifeq ($(PATH_SDK_QT4_INC),)
|
---|
[1767] | 101 | PATH_SDK_QT4_INC := $(patsubst %/QtCore/qglobal.h,%,$(firstword $(wildcard \
|
---|
| 102 | $(PATH_SDK_QT4)/include/QtCore/qglobal.h \
|
---|
| 103 | $(PATH_SDK_QT4)/include/qt4/QtCore/qglobal.h \
|
---|
| 104 | /usr/include/qt4/QtCore/qtglobal.h \
|
---|
| 105 | /usr/local/include/qt4/QtCore/qtglobal.h \
|
---|
| 106 | )))
|
---|
[1773] | 107 | ifneq ($(PATH_SDK_QT4_INC),)
|
---|
| 108 | export PATH_SDK_QT4_INC
|
---|
| 109 | endif
|
---|
[1677] | 110 | endif
|
---|
[1767] | 111 |
|
---|
| 112 | # Now for the libraries (mostly for helping out finding the KBUILD_TARGET libs).
|
---|
[1677] | 113 | ifeq ($(PATH_SDK_QT4_LIB.x86),)
|
---|
| 114 | PATH_SDK_QT4_LIB.x86 := $(patsubst %/libQtCore$(SUFF_DLL),%,$(firstword $(wildcard \
|
---|
| 115 | $(PATH_SDK_QT4)/lib32/libQtCore$(SUFF_DLL) \
|
---|
| 116 | $(PATH_SDK_QT4)/lib32/qt4/libQtCore$(SUFF_DLL) \
|
---|
[1685] | 117 | /usr/lib32/libQtCore$(SUFF_DLL) \
|
---|
| 118 | /usr/lib32/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 119 | /usr/local/lib32/libQtCore$(SUFF_DLL) \
|
---|
| 120 | /usr/local/lib32/qt4/libQtCore$(SUFF_DLL) \
|
---|
[1677] | 121 | $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \
|
---|
| 122 | $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 123 | )))
|
---|
[1767] | 124 | ifneq ($(PATH_SDK_QT4_LIB.x86),)
|
---|
| 125 | export PATH_SDK_QT4_LIB.x86
|
---|
| 126 | endif
|
---|
[1677] | 127 | endif
|
---|
| 128 | ifeq ($(PATH_SDK_QT4_LIB.amd64),)
|
---|
| 129 | PATH_SDK_QT4_LIB.amd64 := $(patsubst %/libQtCore$(SUFF_DLL),%,$(firstword $(wildcard \
|
---|
| 130 | $(PATH_SDK_QT4)/lib64/libQtCore$(SUFF_DLL) \
|
---|
| 131 | $(PATH_SDK_QT4)/lib64/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 132 | $(PATH_SDK_QT4)/lib/amd64/libQtCore$(SUFF_DLL) \
|
---|
[1685] | 133 | /usr/lib64/libQtCore$(SUFF_DLL) \
|
---|
| 134 | /usr/lib64/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 135 | /usr/lib/amd64/libQtCore$(SUFF_DLL) \
|
---|
| 136 | /usr/local/lib64/libQtCore$(SUFF_DLL) \
|
---|
| 137 | /usr/local/lib64/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 138 | /usr/local/lib/amd64/libQtCore$(SUFF_DLL) \
|
---|
[1677] | 139 | $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \
|
---|
| 140 | $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 141 | )))
|
---|
[1767] | 142 | ifneq ($(PATH_SDK_QT4_LIB.amd64),)
|
---|
| 143 | export PATH_SDK_QT4_LIB.amd64
|
---|
| 144 | endif
|
---|
[1677] | 145 | endif
|
---|
[1767] | 146 |
|
---|
| 147 | # And finally, the library path for KBUILD_TARGET.
|
---|
[1677] | 148 | ifeq ($(PATH_SDK_QT4_LIB),)
|
---|
[2332] | 149 | PATH_SDK_QT4_LIB := $(PATH_SDK_QT4_LIB.$(KBUILD_TARGET_ARCH))
|
---|
[1677] | 150 | ifeq ($(PATH_SDK_QT4_LIB),)
|
---|
| 151 | PATH_SDK_QT4_LIB := $(patsubst %/libQtCore$(SUFF_DLL),%,$(firstword $(wildcard \
|
---|
[1767] | 152 | $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \
|
---|
| 153 | $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 154 | /usr/lib/libQtCore$(SUFF_DLL) \
|
---|
| 155 | /usr/lib/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 156 | /usr/local/lib/libQtCore$(SUFF_DLL) \
|
---|
| 157 | /usr/local/lib/qt4/libQtCore$(SUFF_DLL) \
|
---|
| 158 | )))
|
---|
[1677] | 159 | endif
|
---|
[1767] | 160 | ifneq ($(PATH_SDK_QT4_LIB),)
|
---|
| 161 | export PATH_SDK_QT4_LIB
|
---|
| 162 | endif
|
---|
[1677] | 163 | endif
|
---|
[1767] | 164 |
|
---|
[1677] | 165 | endif
|
---|
| 166 | endif # Unices
|
---|
| 167 | endif
|
---|
| 168 | # Found it?
|
---|
| 169 | ifeq ($(PATH_SDK_QT4),)
|
---|
| 170 | $(warning kBuild: Couldn't find the Qt4 headers and libaries...)
|
---|
[2323] | 171 | PATH_SDK_QT4 := $(KBUILD_DEVTOOLS_TRG)/qt/not-found
|
---|
[1677] | 172 | endif
|
---|
| 173 | endif
|
---|
| 174 | else
|
---|
| 175 | # Resolve any fancy stuff once and for all.
|
---|
| 176 | PATH_SDK_QT4 := $(PATH_SDK_QT4)
|
---|
| 177 | endif
|
---|
[1671] | 178 |
|
---|
[1677] | 179 | # Libraries can be in either Frameworks or lib depending on how you
|
---|
| 180 | # build it on the mac. The .dmg installs into Frameworks but builds into lib.
|
---|
| 181 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
| 182 | ifndef PATH_SDK_QT4_LIB
|
---|
| 183 | ifneq ($(wildcard $(PATH_SDK_QT4)/Frameworks),)
|
---|
| 184 | PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/Frameworks
|
---|
| 185 | else
|
---|
| 186 | PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/lib
|
---|
| 187 | endif
|
---|
| 188 | endif
|
---|
| 189 | else
|
---|
| 190 | PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/lib
|
---|
| 191 | PATH_SDK_QT4_INC ?= $(PATH_SDK_QT4)/include
|
---|
| 192 | endif
|
---|
| 193 |
|
---|
| 194 | # The bits that kBuild picks up.
|
---|
| 195 | # (nothing here)
|
---|
| 196 |
|
---|
| 197 |
|
---|
[1671] | 198 | #
|
---|
| 199 | # The QT4 tool.
|
---|
| 200 | #
|
---|
| 201 | # This is implemented here rather than in tools/QT4.kmk to enforce the global USES.
|
---|
| 202 | # It also makes things easier to develop, with fewer files I mean.
|
---|
| 203 | #
|
---|
| 204 | TOOL_QT4 = Qt4
|
---|
| 205 |
|
---|
| 206 | # Tool Specific Properties
|
---|
[1767] | 207 | # PATH_TOOL_QT4 - Obsolete.
|
---|
[1773] | 208 | # PATH_TOOL_QT4_BIN - The
|
---|
| 209 | # TOOL_QT4_BIN_SUFF -
|
---|
[1767] | 210 | if !defined(PATH_TOOL_QT4_BIN) && defined(PATH_TOOL_QT4)
|
---|
| 211 | PATH_TOOL_QT4_BIN := $(PATH_TOOL_QT4)/bin
|
---|
| 212 | endif
|
---|
| 213 | ifndef PATH_TOOL_QT4_BIN
|
---|
[2323] | 214 | PATH_TOOL_QT4_BIN := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/qt/v4*/bin)))
|
---|
| 215 | if "$(PATH_TOOL_QT4_BIN)" == "" && "$(KBUILD_DEVTOOLS_HST_ALT)" != ""
|
---|
| 216 | PATH_TOOL_QT4_BIN := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/qt/v4*/bin)))
|
---|
| 217 | endif
|
---|
[1767] | 218 | ifeq ($(PATH_TOOL_QT4_BIN),)
|
---|
| 219 | ifdef TOOL_QT4_BIN_SUFF
|
---|
| 220 | TOOL_QT4_BIN_SUFF := $(TOOL_QT4_BIN_SUFF)
|
---|
| 221 | endif
|
---|
[1774] | 222 | # Try looking for moc-qt4 / moc-$(suffix) first.
|
---|
| 223 | ifneq ($(TOOL_QT4_BIN_SUFF),)
|
---|
| 224 | PATH_TOOL_QT4_BIN := $(patsubst %/moc$(TOOL_QT4_BIN_SUFF),%,$(firstword $(wildcard \
|
---|
| 225 | /usr/lib/qt4/bin/moc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 226 | /usr/qt/4/bin/moc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 227 | /usr/share/qt4/bin/moc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 228 | /usr/local/bin/moc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 229 | /usr/bin/moc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 230 | )))
|
---|
| 231 | else
|
---|
| 232 | PATH_TOOL_QT4_BIN := $(patsubst %/moc-qt4,%,$(firstword $(wildcard \
|
---|
| 233 | /usr/lib/qt4/bin/moc-qt4 \
|
---|
| 234 | /usr/qt/4/bin/moc-qt4 \
|
---|
| 235 | /usr/share/qt4/bin/moc-qt4 \
|
---|
| 236 | /usr/local/bin/moc-qt4 \
|
---|
| 237 | /usr/bin/moc-qt4 \
|
---|
| 238 | )))
|
---|
[1767] | 239 | ifneq ($(PATH_TOOL_QT4_BIN),)
|
---|
[1774] | 240 | TOOL_QT4_BIN_SUFF := -qt4
|
---|
[1767] | 241 | else
|
---|
[1774] | 242 | # If no luck, try looking for moc in the qt4 specific locations.
|
---|
| 243 | PATH_TOOL_QT4_BIN := $(patsubst %/moc,%,$(firstword $(wildcard \
|
---|
| 244 | /usr/lib/qt4/bin/moc \
|
---|
| 245 | /usr/qt/4/bin/moc \
|
---|
| 246 | /usr/share/qt4/bin/moc \
|
---|
| 247 | )))
|
---|
[1767] | 248 | endif
|
---|
| 249 | endif
|
---|
[1774] | 250 | # If still no go, try looking for qt3to4 and rcc.
|
---|
| 251 | ifeq ($(PATH_TOOL_QT4_BIN),)
|
---|
| 252 | PATH_TOOL_QT4_BIN := $(patsubst %/qt3to4,%,$(firstword $(wildcard \
|
---|
| 253 | /usr/lib/qt4/bin/qt3to4 \
|
---|
| 254 | /usr/qt/4/bin/qt3to4 \
|
---|
| 255 | /usr/share/qt4/bin/qt3to4 \
|
---|
| 256 | /usr/local/bin/qt3to4 \
|
---|
| 257 | /usr/bin/qt3to4 \
|
---|
| 258 | )))
|
---|
| 259 | endif
|
---|
| 260 | ifeq ($(PATH_TOOL_QT4_BIN),)
|
---|
| 261 | PATH_TOOL_QT4_BIN := $(patsubst %/rcc$(TOOL_QT4_BIN_SUFF),%,$(firstword $(wildcard \
|
---|
| 262 | /usr/lib/qt4/bin/rcc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 263 | /usr/qt/4/bin/rcc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 264 | /usr/share/qt4/bin/rcc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 265 | /usr/local/bin/rcc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 266 | /usr/bin/rcc$(TOOL_QT4_BIN_SUFF) \
|
---|
| 267 | )))
|
---|
| 268 | endif
|
---|
| 269 | if "$(PATH_TOOL_QT4_BIN)" == "" && "$(TOOL_QT4_BIN_SUFF)" != ""
|
---|
| 270 | PATH_TOOL_QT4_BIN := $(patsubst %/rcc,%,$(firstword $(wildcard \
|
---|
| 271 | /usr/lib/qt4/bin/rcc \
|
---|
| 272 | /usr/qt/4/bin/rcc \
|
---|
| 273 | /usr/share/qt4/bin/rcc \
|
---|
| 274 | /usr/local/bin/rcc \
|
---|
| 275 | /usr/bin/rcc \
|
---|
| 276 | )))
|
---|
| 277 | endif
|
---|
| 278 | ifneq ($(PATH_TOOL_QT4_BIN),)
|
---|
| 279 | export PATH_TOOL_QT4_BIN
|
---|
| 280 | endif
|
---|
[1687] | 281 | endif
|
---|
[1671] | 282 | # If not found, we'll enter the 'pathless' mode.
|
---|
| 283 | else
|
---|
| 284 | # Resolve any fancy stuff once and for all.
|
---|
[1767] | 285 | PATH_TOOL_QT4_BIN := $(PATH_TOOL_QT4_BIN)
|
---|
[1671] | 286 | endif
|
---|
[1768] | 287 | ifneq ($(PATH_TOOL_QT4_BIN),)
|
---|
[1767] | 288 | TOOL_QT4_MOC ?= $(PATH_TOOL_QT4_BIN)/moc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
| 289 | TOOL_QT4_UIC ?= $(PATH_TOOL_QT4_BIN)/uic$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
[1774] | 290 | ifndef TOOL_QT4_RCC
|
---|
| 291 | TOOL_QT4_RCC := $(PATH_TOOL_QT4_BIN)/rcc$(HOST_SUFF_EXE)
|
---|
| 292 | ifeq ($(wildcard $(TOOL_QT4_RCC)),)
|
---|
| 293 | TOOL_QT4_RCC := $(PATH_TOOL_QT4_BIN)/rcc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
| 294 | endif
|
---|
| 295 | endif
|
---|
[1767] | 296 | TOOL_QT4_LRC ?= $(PATH_TOOL_QT4_BIN)/lrelease$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
| 297 | TOOL_QT4_LUPDATE ?= $(PATH_TOOL_QT4_BIN)/lupdate$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
[1671] | 298 | else
|
---|
| 299 | # Pathless, relies on the environment.
|
---|
[1767] | 300 | TOOL_QT4_MOC ?= moc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
| 301 | TOOL_QT4_UIC ?= uic$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
[1774] | 302 | TOOL_QT4_RCC ?= rcc$(HOST_SUFF_EXE)
|
---|
[1767] | 303 | TOOL_QT4_LRC ?= lrelease$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
| 304 | TOOL_QT4_LUPDATE ?= lupdate$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
|
---|
[1671] | 305 | endif
|
---|
| 306 |
|
---|
| 307 | # General Properties used by kBuild and/or units/qt.kmk
|
---|
| 308 | TOOL_QT4_MOCFLAGS ?=
|
---|
| 309 | TOOL_QT4_MOCINCS ?=
|
---|
| 310 | TOOL_QT4_MOCDEFS ?=
|
---|
| 311 | TOOL_QT4_MOCDEFS.darwin ?= __APPLE__ __GNUC__
|
---|
| 312 | TOOL_QT4_MOCDEFS.solaris ?= __sun
|
---|
| 313 | TOOL_QT4_MOCDEFS.win.amd64 ?= WIN64
|
---|
| 314 | TOOL_QT4_MOCDEFS.win.x86 ?= WIN32
|
---|
| 315 |
|
---|
| 316 |
|
---|
| 317 | ## MOC a C++ source file.
|
---|
| 318 | # @param $(target) Normalized main target name.
|
---|
| 319 | # @param $(source) Source filename (relative).
|
---|
| 320 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 321 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 322 | # @param $(flags) Flags.
|
---|
| 323 | # @param $(defs) Definitions.
|
---|
| 324 | # @param $(incs) Includes.
|
---|
| 325 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 326 | #
|
---|
| 327 | TOOL_QT4_MOC_CPP_DEPEND =
|
---|
| 328 | TOOL_QT4_MOC_CPP_DEPORD =
|
---|
| 329 | TOOL_QT4_MOC_CPP_OUTPUT =
|
---|
| 330 | TOOL_QT4_MOC_CPP_OUTPUT_MAYBE =
|
---|
| 331 | define TOOL_QT4_MOC_CPP_CMDS
|
---|
| 332 | $(QUIET)$(TOOL_QT4_MOC)\
|
---|
| 333 | $(flags)\
|
---|
| 334 | $(addprefix -I, $(incs))\
|
---|
| 335 | $(addprefix -D, $(defs))\
|
---|
| 336 | -o $(out)\
|
---|
| 337 | $(source)
|
---|
| 338 | endef
|
---|
| 339 |
|
---|
| 340 | ## MOC a C++ header file.
|
---|
| 341 | # @param $(target) Normalized main target name.
|
---|
| 342 | # @param $(source) Source filename (relative).
|
---|
| 343 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 344 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 345 | # @param $(flags) Flags.
|
---|
| 346 | # @param $(defs) Definitions.
|
---|
| 347 | # @param $(incs) Includes.
|
---|
| 348 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 349 | #
|
---|
| 350 | TOOL_QT4_MOC_HPP_DEPEND =
|
---|
| 351 | TOOL_QT4_MOC_HPP_DEPORD =
|
---|
| 352 | TOOL_QT4_MOC_HPP_OUTPUT =
|
---|
| 353 | TOOL_QT4_MOC_HPP_OUTPUT_MAYBE =
|
---|
| 354 | define TOOL_QT4_MOC_HPP_CMDS
|
---|
| 355 | $(QUIET)$(TOOL_QT4_MOC)\
|
---|
| 356 | $(flags)\
|
---|
| 357 | $(addprefix -I, $(incs))\
|
---|
| 358 | $(addprefix -D, $(defs))\
|
---|
| 359 | -o $(out)\
|
---|
| 360 | $(source)
|
---|
| 361 | endef
|
---|
| 362 |
|
---|
| 363 | ## Compile a Qt user interface file (.ui).
|
---|
| 364 | # @param $(target) Normalized main target name.
|
---|
| 365 | # @param $(source) Source filename (relative).
|
---|
| 366 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 367 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 368 | # @param $(flags) Flags.
|
---|
| 369 | # @param $(defs) Definitions.
|
---|
| 370 | # @param $(incs) Includes.
|
---|
| 371 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 372 | #
|
---|
| 373 | TOOL_QT4_UIC_UI_DEPEND =
|
---|
| 374 | TOOL_QT4_UIC_UI_DEPORD =
|
---|
| 375 | TOOL_QT4_UIC_UI_OUTPUT =
|
---|
| 376 | TOOL_QT4_UIC_UI_OUTPUT_MAYBE =
|
---|
| 377 | define TOOL_QT4_UIC_UI_CMDS
|
---|
| 378 | $(QUIET)$(TOOL_QT4_UIC)\
|
---|
| 379 | $(flags)\
|
---|
| 380 | -o $(out)\
|
---|
| 381 | $(source)
|
---|
| 382 | endef
|
---|
| 383 |
|
---|
| 384 | ## Compile a Qt resource file (.qrc).
|
---|
| 385 | # @param $(target) Normalized main target name.
|
---|
| 386 | # @param $(source) Source filename (relative).
|
---|
| 387 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 388 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 389 | # @param $(flags) Flags.
|
---|
| 390 | # @param $(defs) Definitions.
|
---|
| 391 | # @param $(incs) Includes.
|
---|
| 392 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 393 | #
|
---|
| 394 | # @remarks The sed script generating the dependency file is a bit naive.
|
---|
| 395 | TOOL_QT4_RCC_QRC_DEPEND =
|
---|
| 396 | TOOL_QT4_RCC_QRC_DEPORD =
|
---|
| 397 | TOOL_QT4_RCC_QRC_OUTPUT =
|
---|
| 398 | TOOL_QT4_RCC_QRC_OUTPUT_MAYBE =
|
---|
| 399 | define TOOL_QT4_RCC_QRC_CMDS
|
---|
| 400 | $(QUIET)$(TOOL_QT4_RCC)\
|
---|
| 401 | $(flags)\
|
---|
| 402 | -o $(out)\
|
---|
| 403 | $(source)
|
---|
[2369] | 404 | $(QUIET2)$(APPEND) $(dep) '\'
|
---|
| 405 | $(QUIET2)$(APPEND) $(dep) '$(out): \'
|
---|
| 406 | $(QUIET2)$(APPEND) $(dep) '$(source) \'
|
---|
| 407 | $(QUIET2)$(SED) \
|
---|
[1671] | 408 | -e '/^[[:blank:]]*<file[[:blank:]][^>]*>/!d' \
|
---|
| 409 | -e 's/^.*<file[[:blank:]][^>]*>\([^<]*\)<\/file>.*$$$$/\1/' \
|
---|
[2183] | 410 | -e 's|^[^/][^:]|$(abspathex $(dir $(source)),$(defpath))/&|' \
|
---|
[1671] | 411 | -e 's|$$$$| \\|' \
|
---|
| 412 | --append $(dep) \
|
---|
| 413 | $(source)
|
---|
[2369] | 414 | $(QUIET2)$(APPEND) $(dep)
|
---|
| 415 | $(QUIET2)$(SED) \
|
---|
[1671] | 416 | -e '/^[[:blank:]]*<file[[:blank:]][^>]*>/!d' \
|
---|
| 417 | -e 's/^.*<file[[:blank:]][^>]*>\([^<]*\)<\/file>.*$$$$/\1/' \
|
---|
[2183] | 418 | -e 's|^[^/][^:]|$(abspathex $(dir $(source)),$(defpath))/&|' \
|
---|
[1671] | 419 | -e 's|$$$$|:\n|' \
|
---|
| 420 | --append $(dep) \
|
---|
| 421 | $(source)
|
---|
[2369] | 422 | $(QUIET2)$(APPEND) $(dep)
|
---|
[1671] | 423 | endef
|
---|
| 424 |
|
---|
[1675] | 425 | ## Compile a Qt translation file (.ts).
|
---|
| 426 | # @param $(target) Normalized main target name.
|
---|
| 427 | # @param $(source) Source filename (relative).
|
---|
| 428 | # @param $(out) Object file name. This shall be (re)created by the compilation.
|
---|
| 429 | # @param $(dep) Dependcy file. This may be (re)created by the compilation.
|
---|
| 430 | # @param $(flags) Flags.
|
---|
| 431 | # @param $(defs) Definitions.
|
---|
| 432 | # @param $(incs) Includes.
|
---|
| 433 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
| 434 | #
|
---|
| 435 | TOOL_QT4_LRC_TS_DEPEND =
|
---|
| 436 | TOOL_QT4_LRC_TS_DEPORD =
|
---|
| 437 | TOOL_QT4_LRC_TS_OUTPUT =
|
---|
| 438 | TOOL_QT4_LRC_TS_OUTPUT_MAYBE =
|
---|
| 439 | define TOOL_QT4_LRC_TS_CMDS
|
---|
| 440 | $(QUIET)$(TOOL_QT4_LRC)\
|
---|
| 441 | $(flags)\
|
---|
| 442 | $(source)\
|
---|
| 443 | -qm $(out)
|
---|
| 444 | endef
|
---|
[1671] | 445 |
|
---|
| 446 |
|
---|
[1675] | 447 |
|
---|
[1671] | 448 | #
|
---|
| 449 | #
|
---|
| 450 | # Back to the Qt4 unit.
|
---|
| 451 | #
|
---|
| 452 | #
|
---|
| 453 |
|
---|
| 454 |
|
---|
[1675] | 455 | ## wrapper for the lrelease (LRC) command dependencies.
|
---|
| 456 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[1683] | 457 | _UNIT_QT4_LRC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_LRC_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1675] | 458 | else
|
---|
[1683] | 459 | _UNIT_QT4_LRC_CMDS_DEP =
|
---|
[1675] | 460 | endif
|
---|
| 461 |
|
---|
[1671] | 462 | ##
|
---|
[1675] | 463 | # def_unit_qt4_target_pre_handle_translation helper that is expanded before evaluation.
|
---|
[1671] | 464 | #
|
---|
[1675] | 465 | # This is necessary to resolve reference to local variables before doing
|
---|
| 466 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 467 | # later in a different context and the result would be completely wrong.
|
---|
| 468 | #
|
---|
| 469 | define def_unit_qt4_target_pre_handle_translation_dx
|
---|
[1671] | 470 |
|
---|
[1675] | 471 | $(out) + $(more_output) +| $(maybe_output): \
|
---|
| 472 | $(deps) \
|
---|
[1683] | 473 | $(value _UNIT_QT4_LRC_CMDS_DEP) \
|
---|
[1675] | 474 | | \
|
---|
| 475 | $(orderdeps)
|
---|
| 476 | %$$(call MSG_TOOL,lrelease,$(target),$(source),$$@)
|
---|
| 477 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 478 |
|
---|
[1675] | 479 | $(cmds)
|
---|
| 480 |
|
---|
| 481 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 482 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[1683] | 483 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_LRC_CMDS_PREV_'
|
---|
[1675] | 484 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 485 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 486 | endif
|
---|
| 487 |
|
---|
[2197] | 488 | $(target)_CLEAN += $(out) $(more_output) $(maybe_output) $(dep)
|
---|
[1675] | 489 | $(target)-inst-nls_SOURCES += $(out)
|
---|
| 490 |
|
---|
| 491 | endef # def_unit_qt4_target_pre_handle_translation_dx
|
---|
| 492 |
|
---|
| 493 | ##
|
---|
| 494 | # Handle a source file listed in QT_TRANSLATIONS.
|
---|
| 495 | #
|
---|
| 496 | # The files listed in QT_TRANSLATIONS are translation files (.ts) which needs
|
---|
| 497 | # to be translated into .qm files that are loadble by Qt.
|
---|
| 498 | #
|
---|
| 499 | # @remarks Invoked via $(evalvalctx ).
|
---|
| 500 | define def_unit_qt4_target_pre_handle_translation
|
---|
| 501 | local type := LRC
|
---|
| 502 |
|
---|
| 503 | # fetch the properties.
|
---|
| 504 | local tool := $(kb-src-tool dummy_var)
|
---|
[2239] | 505 | local qtnlsdir := $($(target)_0_OUTDIR)/qtnls
|
---|
[1675] | 506 | local outbase := $(qtnlsdir)/$(notdir $(basename $(source)))
|
---|
| 507 | local out := $(outbase).qm
|
---|
| 508 | local dep := $(out).dep
|
---|
| 509 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 510 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 511 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 512 |
|
---|
| 513 | # default path + source dep.
|
---|
| 514 | ifneq ($(defpath),)
|
---|
[1771] | 515 | local source := $(abspathex $(source),$(defpath))
|
---|
| 516 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 517 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[1675] | 518 | else
|
---|
| 519 | local deps += $(source)
|
---|
| 520 | endif
|
---|
| 521 |
|
---|
| 522 | # call the tool
|
---|
| 523 | ifndef TOOL_$(tool)_LRC_TS_CMDS
|
---|
| 524 | $(error kBuild: qt lrelease tool not found: TOOL_$(tool)_LRC_TS_CMDS)
|
---|
| 525 | endif
|
---|
| 526 | local cmds := $(TOOL_$(tool)_LRC_TS_CMDS)
|
---|
| 527 | local more_output := $(TOOL_$(tool)_LRC_TS_OUTPUT)
|
---|
| 528 | local maybe_output := $(TOOL_$(tool)_LRC_TS_OUTPUT_MAYBE)
|
---|
| 529 | local deps += $(TOOL_$(tool)_LRC_TS_DEPEND)
|
---|
| 530 | local orderdeps += $(TOOL_$(tool)_LRC_TS_DEPORD)
|
---|
| 531 |
|
---|
| 532 | # generate the link rule and update some source and target variables.
|
---|
| 533 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 534 | $(eval includedep $(dep))
|
---|
| 535 | endif
|
---|
| 536 | $(eval $(def_unit_qt4_target_pre_handle_translation_dx))
|
---|
| 537 |
|
---|
| 538 | endef # def_unit_qt4_target_pre_handle_translation
|
---|
| 539 |
|
---|
| 540 |
|
---|
| 541 |
|
---|
[1671] | 542 | ## wrapper for the UIC command dependencies.
|
---|
| 543 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[1683] | 544 | _UNIT_QT4_RCC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_RCC_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1671] | 545 | else
|
---|
[1683] | 546 | _UNIT_QT4_RCC_CMDS_DEP =
|
---|
[1671] | 547 | endif
|
---|
| 548 |
|
---|
| 549 | ##
|
---|
| 550 | # def_unit_qt4_target_pre_handle_qrc helper that is expanded before evaluation.
|
---|
| 551 | #
|
---|
| 552 | # This is necessary to resolve reference to local variables before doing
|
---|
| 553 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 554 | # later in a different context and the result would be completely wrong.
|
---|
| 555 | #
|
---|
| 556 | define def_unit_qt4_target_pre_handle_rcc_dx
|
---|
| 557 |
|
---|
| 558 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
| 559 | $(deps) \
|
---|
[1683] | 560 | $(value _UNIT_QT4_RCC_CMDS_DEP) \
|
---|
[1671] | 561 | | \
|
---|
| 562 | $(orderdeps)
|
---|
| 563 | %$$(call MSG_TOOL,rcc,$(target),$(source),$$@)
|
---|
| 564 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
| 565 |
|
---|
| 566 | $(cmds)
|
---|
| 567 |
|
---|
| 568 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
| 569 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 570 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[1683] | 571 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_RCC_CMDS_PREV_'
|
---|
[1671] | 572 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 573 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 574 | endif
|
---|
| 575 |
|
---|
| 576 | $(target)_INTERMEDIATES += $(realout)
|
---|
| 577 | $(target)_GEN_SOURCES_ += $(realout)
|
---|
[2197] | 578 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 579 |
|
---|
| 580 | endef # def_unit_qt4_target_pre_handle_rcc_dx
|
---|
| 581 |
|
---|
| 582 | ##
|
---|
| 583 | # Source handler for .qrc sources (Qt resource files).
|
---|
| 584 | #
|
---|
| 585 | # @remarks $(evalvalctx me).
|
---|
| 586 | define def_unit_qt4_src_handler_qrc
|
---|
| 587 | local type := RCC
|
---|
| 588 |
|
---|
| 589 | # fetch the properties.
|
---|
| 590 | local tool := $(kb-src-tool dummy_var)
|
---|
[2239] | 591 | local qtrccdir := $($(target)_0_OUTDIR)/qtrcc
|
---|
[1671] | 592 | local outbase := $(qtrccdir)/$(notdir $(basename $(source)))
|
---|
| 593 | local out := $(outbase).tmp.gen.cpp
|
---|
| 594 | local realout := $(outbase).gen.cpp
|
---|
| 595 | local dep := $(realout).dep
|
---|
| 596 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 597 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 598 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 599 |
|
---|
| 600 | # default path + source dep.
|
---|
| 601 | ifneq ($(defpath),)
|
---|
[1771] | 602 | local source := $(abspathex $(source),$(defpath))
|
---|
| 603 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 604 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[1671] | 605 | else
|
---|
| 606 | local deps += $(source)
|
---|
| 607 | endif
|
---|
| 608 |
|
---|
| 609 | # call the tool
|
---|
| 610 | ifndef TOOL_$(tool)_RCC_QRC_CMDS
|
---|
| 611 | $(error kBuild: qt rcc tool not found: TOOL_$(tool)_RCC_QRC_CMDS)
|
---|
| 612 | endif
|
---|
| 613 | local cmds := $(TOOL_$(tool)_RCC_QRC_CMDS)
|
---|
| 614 | local more_output := $(TOOL_$(tool)_RCC_QRC_OUTPUT)
|
---|
| 615 | local maybe_output := $(TOOL_$(tool)_RCC_QRC_OUTPUT_MAYBE)
|
---|
| 616 | local deps += $(TOOL_$(tool)_RCC_QRC_DEPEND)
|
---|
| 617 | local orderdeps += $(TOOL_$(tool)_RCC_QRC_DEPORD)
|
---|
| 618 |
|
---|
| 619 | # generate the link rule and update some source and target variables.
|
---|
| 620 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 621 | $(eval includedep $(dep))
|
---|
| 622 | endif
|
---|
| 623 | $(eval $(def_unit_qt4_target_pre_handle_rcc_dx))
|
---|
| 624 |
|
---|
| 625 | endef # def_unit_qt4_src_handler_qrc
|
---|
| 626 |
|
---|
| 627 |
|
---|
[1675] | 628 |
|
---|
[1671] | 629 | ## wrapper for the UIC command dependencies.
|
---|
| 630 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[1683] | 631 | _UNIT_QT4_UIC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_UIC_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1671] | 632 | else
|
---|
[1683] | 633 | _UNIT_QT4_UIC_CMDS_DEP =
|
---|
[1671] | 634 | endif
|
---|
| 635 |
|
---|
| 636 | ##
|
---|
[1675] | 637 | # def_unit_qt4_src_handler_ui helper that is expanded before evaluation.
|
---|
[1671] | 638 | #
|
---|
| 639 | # This is necessary to resolve reference to local variables before doing
|
---|
| 640 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 641 | # later in a different context and the result would be completely wrong.
|
---|
| 642 | #
|
---|
| 643 | define def_unit_qt4_target_pre_handle_ui_dx
|
---|
| 644 |
|
---|
| 645 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
| 646 | $(deps) \
|
---|
[1683] | 647 | $(value _UNIT_QT4_UIC_CMDS_DEP) \
|
---|
[1671] | 648 | | \
|
---|
| 649 | $(orderdeps)
|
---|
| 650 | %$$(call MSG_TOOL,uic,$(target),$(source),$$@)
|
---|
| 651 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
| 652 |
|
---|
| 653 | $(cmds)
|
---|
| 654 |
|
---|
| 655 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
| 656 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 657 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[1683] | 658 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_UIC_CMDS_PREV_'
|
---|
[1671] | 659 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 660 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 661 | endif
|
---|
| 662 |
|
---|
| 663 | $(target)_INTERMEDIATES += $(realout)
|
---|
[2197] | 664 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 665 |
|
---|
| 666 | endef # def_unit_qt4_target_pre_handle_ui_dx
|
---|
| 667 |
|
---|
| 668 | ##
|
---|
| 669 | # Source handler for .ui sources.
|
---|
| 670 | #
|
---|
| 671 | # @remarks $(evalvalctx me).
|
---|
| 672 | define def_unit_qt4_src_handler_ui
|
---|
| 673 | local type := UIC
|
---|
| 674 |
|
---|
| 675 | # fetch the properties.
|
---|
| 676 | local tool := $(kb-src-tool dummy_var)
|
---|
[2239] | 677 | local qtuicdir := $($(target)_0_OUTDIR)/qtuic
|
---|
[1671] | 678 | local outbase := $(qtuicdir)/$(notdir $(basename $(source)))
|
---|
| 679 | local out := $(outbase).tmp.gen.h
|
---|
| 680 | local realout := $(outbase).gen.h
|
---|
| 681 | local dep := $(realout).dep
|
---|
| 682 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 683 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 684 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 685 |
|
---|
| 686 | # default path + source dep.
|
---|
| 687 | ifneq ($(defpath),)
|
---|
[1771] | 688 | local source := $(abspathex $(source),$(defpath))
|
---|
| 689 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 690 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[1671] | 691 | else
|
---|
| 692 | local deps += $(source)
|
---|
| 693 | endif
|
---|
| 694 |
|
---|
| 695 | # call the tool
|
---|
| 696 | ifndef TOOL_$(tool)_UIC_UI_CMDS
|
---|
| 697 | $(error kBuild: qt uic tool not found: TOOL_$(tool)_UIC_UI_CMDS)
|
---|
| 698 | endif
|
---|
| 699 | local cmds := $(TOOL_$(tool)_UIC_UI_CMDS)
|
---|
| 700 | local more_output := $(TOOL_$(tool)_UIC_UI_OUTPUT)
|
---|
| 701 | local maybe_output := $(TOOL_$(tool)_UIC_UI_OUTPUT_MAYBE)
|
---|
| 702 | local deps += $(TOOL_$(tool)_UIC_UI_DEPEND)
|
---|
| 703 | local orderdeps += $(TOOL_$(tool)_UIC_UI_DEPORD)
|
---|
| 704 |
|
---|
| 705 | # generate the link rule and update some source and target variables.
|
---|
| 706 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 707 | $(eval includedep $(dep))
|
---|
| 708 | endif
|
---|
| 709 | $(eval $(def_unit_qt4_target_pre_handle_ui_dx))
|
---|
| 710 |
|
---|
| 711 | endef # def_unit_qt4_src_handler_ui
|
---|
| 712 |
|
---|
| 713 |
|
---|
[1675] | 714 |
|
---|
[1671] | 715 | ## wrapper for the MOC command dependencies.
|
---|
| 716 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[1683] | 717 | _UNIT_QT4_MOC_HPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_MOC_HPP_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
[1671] | 718 | else
|
---|
[1683] | 719 | _UNIT_QT4_MOC_HPP_CMDS_DEP =
|
---|
[1671] | 720 | endif
|
---|
| 721 |
|
---|
| 722 | ##
|
---|
| 723 | # def_unit_qt4_target_pre_handle_moc_hdr helper that is expanded before evaluation.
|
---|
| 724 | #
|
---|
| 725 | # This is necessary to resolve reference to local variables before doing
|
---|
| 726 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 727 | # later in a different context and the result would be completely wrong.
|
---|
| 728 | #
|
---|
| 729 | define def_unit_qt4_target_pre_handle_moc_hdr_dx
|
---|
| 730 |
|
---|
| 731 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
| 732 | $(deps) \
|
---|
[1683] | 733 | $(value _UNIT_QT4_MOC_HPP_CMDS_DEP) \
|
---|
[1671] | 734 | | \
|
---|
| 735 | $(orderdeps)
|
---|
| 736 | %$$(call MSG_TOOL,moc,$(target),$(source),$$@)
|
---|
| 737 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
| 738 |
|
---|
| 739 | $(cmds)
|
---|
| 740 |
|
---|
| 741 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
| 742 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 743 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[1683] | 744 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_MOC_HPP_CMDS_PREV_'
|
---|
[1671] | 745 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 746 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 747 | endif
|
---|
| 748 |
|
---|
| 749 | $(target)_INTERMEDIATES += $(realout)
|
---|
| 750 | $(target)_GEN_SOURCES_ += $(realout)
|
---|
[2197] | 751 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 752 |
|
---|
| 753 | endef
|
---|
| 754 |
|
---|
| 755 | ##
|
---|
[1683] | 756 | # Handle a source file listed in QT_MOCHDRS.
|
---|
[1671] | 757 | #
|
---|
[1675] | 758 | # The files listed in QT_MOCHDRS uses the Q_OBJECT macro and we will
|
---|
| 759 | # generate a .cpp file for each of them and add it to the generated
|
---|
| 760 | # sources so that it's compiled and linked. (There is an alternative
|
---|
| 761 | # way to do this where the .cpp file is included, this isn't currently
|
---|
| 762 | # supported by this unit.)
|
---|
[1671] | 763 | #
|
---|
| 764 | # @remarks Invoked via $(evalvalctx ).
|
---|
| 765 | define def_unit_qt4_target_pre_handle_moc_hdr
|
---|
| 766 | local type := MOC
|
---|
| 767 |
|
---|
| 768 | # fetch the properties.
|
---|
| 769 | local tool := $(kb-src-tool dummy_var)
|
---|
| 770 | local outbase := $(qtmocdir)/$(notdir $(basename $(source)))
|
---|
| 771 | local out := $(outbase).tmp.cpp
|
---|
| 772 | local realout := $(outbase).cpp
|
---|
| 773 | local dep := $(realout).dep
|
---|
| 774 | local defs := $(kb-src-prop DEFS,dummy_var,left-to-right)
|
---|
| 775 | local incs := $(kb-src-prop INCS,dummy_var,right-to-left)
|
---|
| 776 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 777 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 778 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 779 |
|
---|
| 780 | # default path + source dep.
|
---|
| 781 | ifneq ($(defpath),)
|
---|
[1771] | 782 | local source := $(abspathex $(source),$(defpath))
|
---|
| 783 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 784 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[1671] | 785 | else
|
---|
| 786 | local deps += $(source)
|
---|
| 787 | endif
|
---|
| 788 |
|
---|
| 789 | # call the tool
|
---|
| 790 | ifndef TOOL_$(tool)_MOC_HPP_CMDS
|
---|
| 791 | $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_HPP_CMDS)
|
---|
| 792 | endif
|
---|
| 793 | local cmds := $(TOOL_$(tool)_MOC_HPP_CMDS)
|
---|
| 794 | local more_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT)
|
---|
| 795 | local maybe_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT_MAYBE)
|
---|
| 796 | local deps += $(TOOL_$(tool)_MOC_HPP_DEPEND)
|
---|
| 797 | local orderdeps += $(TOOL_$(tool)_MOC_HPP_DEPORD)
|
---|
| 798 |
|
---|
| 799 | # generate the link rule and update some source and target variables.
|
---|
| 800 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 801 | $(eval includedep $(dep))
|
---|
| 802 | endif
|
---|
| 803 | $(eval $(def_unit_qt4_target_pre_handle_moc_hdr_dx))
|
---|
| 804 |
|
---|
| 805 | endef # def_unit_qt4_target_pre_handle_moc_hdr
|
---|
| 806 |
|
---|
| 807 |
|
---|
[1683] | 808 | ## wrapper for the MOC command dependencies.
|
---|
| 809 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 810 | _UNIT_QT4_MOC_CPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_MOC_CPP_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
| 811 | else
|
---|
| 812 | _UNIT_QT4_MOC_CPP_CMDS_DEP =
|
---|
| 813 | endif
|
---|
| 814 |
|
---|
[1671] | 815 | ##
|
---|
| 816 | # def_unit_qt4_target_pre_handle_moc_src helper that is expanded before evaluation.
|
---|
| 817 | #
|
---|
| 818 | # This is necessary to resolve reference to local variables before doing
|
---|
| 819 | # assignments and setting up commands. They would otherwise be resolved
|
---|
| 820 | # later in a different context and the result would be completely wrong.
|
---|
| 821 | #
|
---|
| 822 | define def_unit_qt4_target_pre_handle_moc_src_dx
|
---|
| 823 |
|
---|
| 824 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
| 825 | $(deps) \
|
---|
[1683] | 826 | $(value _UNIT_QT4_MOC_CPP_CMDS_DEP) \
|
---|
[1671] | 827 | | \
|
---|
| 828 | $(orderdeps)
|
---|
| 829 | %$$(call MSG_TOOL,moc,$(target),$(source),$$@)
|
---|
| 830 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
| 831 |
|
---|
| 832 | $(cmds)
|
---|
| 833 |
|
---|
| 834 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
| 835 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 836 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
[1683] | 837 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_MOC_CPP_CMDS_PREV_'
|
---|
[1671] | 838 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
| 839 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
| 840 | endif
|
---|
| 841 |
|
---|
| 842 | $(target)_INTERMEDIATES += $(realout)
|
---|
[2197] | 843 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
[1671] | 844 |
|
---|
| 845 | endef
|
---|
| 846 |
|
---|
| 847 | ##
|
---|
| 848 | # Handle a source file listed in QT_MOCSRCS.
|
---|
| 849 | #
|
---|
| 850 | # The files listed in QT_MOCSRCS uses the Q_OBJECT macro and will include
|
---|
| 851 | # a .moc file that we're expected to generate here.
|
---|
| 852 | #
|
---|
| 853 | # @remarks Invoked via $(evalvalctx ).
|
---|
| 854 | define def_unit_qt4_target_pre_handle_moc_src
|
---|
| 855 | local type := MOC
|
---|
| 856 |
|
---|
| 857 | # fetch the properties.
|
---|
| 858 | local tool := $(kb-src-tool dummy_var)
|
---|
| 859 | local outbase := $(qtmocdir)/$(notdir $(basename $(source)))
|
---|
| 860 | local out := $(outbase).tmp.moc
|
---|
| 861 | local realout := $(outbase).moc
|
---|
| 862 | local dep := $(realout).dep
|
---|
| 863 | local defs := $(kb-src-prop DEFS,dummy_var,left-to-right)
|
---|
| 864 | local incs := $(kb-src-prop INCS,dummy_var,right-to-left)
|
---|
| 865 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
| 866 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
| 867 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
| 868 |
|
---|
| 869 | # default path + source dep.
|
---|
| 870 | ifneq ($(defpath),)
|
---|
[1771] | 871 | local source := $(abspathex $(source),$(defpath))
|
---|
| 872 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
| 873 | local incs := $(abspathex $(incs),$(defpath))
|
---|
[1671] | 874 | else
|
---|
| 875 | local deps += $(source)
|
---|
| 876 | endif
|
---|
| 877 |
|
---|
| 878 | # call the tool
|
---|
| 879 | ifndef TOOL_$(tool)_MOC_CPP_CMDS
|
---|
| 880 | $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_CPP_CMDS)
|
---|
| 881 | endif
|
---|
| 882 | local cmds := $(TOOL_$(tool)_MOC_CPP_CMDS)
|
---|
| 883 | local more_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT)
|
---|
| 884 | local maybe_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT_MAYBE)
|
---|
| 885 | local deps += $(TOOL_$(tool)_MOC_CPP_DEPEND)
|
---|
| 886 | local orderdeps += $(TOOL_$(tool)_MOC_CPP_DEPORD)
|
---|
| 887 |
|
---|
| 888 | # generate the link rule and update some source and target variables.
|
---|
| 889 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
| 890 | $(eval includedep $(dep))
|
---|
| 891 | endif
|
---|
| 892 | $(eval $(def_unit_qt4_target_pre_handle_moc_src_dx))
|
---|
| 893 |
|
---|
| 894 | endef # def_unit_qt4_target_pre_handle_moc_src
|
---|
| 895 |
|
---|
| 896 |
|
---|
| 897 | ##
|
---|
| 898 | # Adds sources containing Q_OBJECT to QT_MOCSRCS.
|
---|
| 899 | define def_unit_qt4_target_pre_cpp_source
|
---|
| 900 | ifneq ($(file-size $(source)),-1)
|
---|
| 901 | ifneq ($(strip $(shell $(SED) -f $(KBUILD_PATH)/units/qt-Q_OBJECT.sed $(source))),)
|
---|
| 902 | $(eval $(target)_QT_MOCSRCS += $(source))
|
---|
| 903 | endif
|
---|
| 904 | endif
|
---|
| 905 | endef # def_unit_qt4_target_pre_cpp_source
|
---|
| 906 |
|
---|
| 907 | ##
|
---|
| 908 | # Invoked early in the processing of a target that uses the Qt unit.
|
---|
| 909 | #
|
---|
| 910 | # It will append the qt source handlers to the target (.h, .ui, .ts,
|
---|
| 911 | # .png, .bmp, .gif).
|
---|
| 912 | #
|
---|
| 913 | # It will then check all the C++ sources and check which needs
|
---|
| 914 | # a .moc files and generate rules and dependencies fofor these
|
---|
| 915 | #
|
---|
| 916 | define def_unit_qt4_target_pre
|
---|
| 917 |
|
---|
[1675] | 918 | # Make QTTOOL the default for the specific Qt tools instead of TOOL.
|
---|
| 919 | ifneq ($($(target)_QTTOOL),)
|
---|
| 920 | ifeq ($($(target)_MOCTOOL),)
|
---|
[1682] | 921 | $(target)_MOCTOOL := $($(target)_QTTOOL)
|
---|
[1675] | 922 | endif
|
---|
| 923 | ifeq ($($(target)_UICTOOL),)
|
---|
[1682] | 924 | $(target)_UICTOOL := $($(target)_QTTOOL)
|
---|
[1675] | 925 | endif
|
---|
| 926 | ifeq ($($(target)_RCCTOOL),)
|
---|
[1682] | 927 | $(target)_RCCTOOL := $($(target)_QTTOOL)
|
---|
[1675] | 928 | endif
|
---|
| 929 | ifeq ($($(target)_LRCTOOL),)
|
---|
[1682] | 930 | $(target)_LRCTOOL := $($(target)_QTTOOL)
|
---|
[1675] | 931 | endif
|
---|
| 932 | endif
|
---|
| 933 |
|
---|
[2176] | 934 | # Deal with QT_MODULES, QT_PREFIX and QT_INFIX.
|
---|
[1677] | 935 | local qt_modules := \
|
---|
[1761] | 936 | $($(target)_QT_MODULES.$(bld_trg)) \
|
---|
| 937 | $($(target)_QT_MODULES.$(bld_trg_arch)) \
|
---|
| 938 | $($(target)_QT_MODULES.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 939 | $($(target)_QT_MODULES.$(bld_trg_cpu)) \
|
---|
| 940 | $($(target)_QT_MODULES.$(bld_type)) \
|
---|
[1677] | 941 | $($(target)_QT_MODULES)
|
---|
| 942 | local qt_prefix := $(firstword \
|
---|
[1761] | 943 | $($(target)_QT_PREFIX.$(bld_trg)) \
|
---|
| 944 | $($(target)_QT_PREFIX.$(bld_trg_arch)) \
|
---|
| 945 | $($(target)_QT_PREFIX.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 946 | $($(target)_QT_PREFIX.$(bld_trg_cpu)) \
|
---|
| 947 | $($(target)_QT_PREFIX.$(bld_type)) \
|
---|
[1677] | 948 | $($(target)_QT_PREFIX))
|
---|
[2176] | 949 | local qt_infix := $(firstword \
|
---|
| 950 | $($(target)_QT_INFIX.$(bld_trg)) \
|
---|
| 951 | $($(target)_QT_INFIX.$(bld_trg_arch)) \
|
---|
| 952 | $($(target)_QT_INFIX.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 953 | $($(target)_QT_INFIX.$(bld_trg_cpu)) \
|
---|
| 954 | $($(target)_QT_INFIX.$(bld_type)) \
|
---|
| 955 | $($(target)_QT_INFIX))
|
---|
[1677] | 956 | ifeq ($(bld_trg),darwin)
|
---|
[1681] | 957 | # Adding -F to CXXFLAGS is necessary to make #include <QtCore/qstring.h> stuff work...
|
---|
| 958 | $(eval $(target)_CXXFLAGS += -F$(PATH_SDK_QT4_LIB) )
|
---|
[2368] | 959 | $(eval $(target)_OBJCXXFLAGS += -F$(PATH_SDK_QT4_LIB) )
|
---|
[2176] | 960 | $(eval $(target)_LDFLAGS += -F$(PATH_SDK_QT4_LIB) $(foreach module,$(qt_modules), -framework $(qt_prefix)Qt$(module)$(qt_infix)) )
|
---|
| 961 | $(eval $(target)_INCS += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/$(qt_prefix)Qt$(module)$(qt_infix).framework/Versions/4/Headers) )
|
---|
[1677] | 962 | else
|
---|
[1679] | 963 | ifeq ($(bld_trg),win)
|
---|
[2245] | 964 | $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/$(qt_prefix)Qt$(module)$(qt_infix)4$(SUFF_LIB)) )
|
---|
[1681] | 965 | ifeq ($(tool_do),LINK_PROGRAM)
|
---|
[2245] | 966 | $(eval $(target)_LIBS += $(PATH_SDK_QT4_LIB)/$(qt_prefix)qtmain$(qt_infix)$(SUFF_LIB) )
|
---|
[1681] | 967 | endif
|
---|
[1679] | 968 | else
|
---|
[2176] | 969 | $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/lib$(qt_prefix)Qt$(module)$(qt_infix)$(SUFF_DLL)) )
|
---|
[1679] | 970 | endif
|
---|
[1681] | 971 | $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT4_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT4_INC) )
|
---|
[1677] | 972 | endif
|
---|
[1681] | 973 | $(eval $(target)_DEFS += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) )
|
---|
[1677] | 974 |
|
---|
| 975 |
|
---|
[1671] | 976 | # Autodetect source files with Q_OBJECT references if QT_MOCSRCS is undefined. (slow)
|
---|
| 977 | # Tip: Use target_QT_MOCSRCS = $(NO_SUCH_VARIABLE) to avoid this.
|
---|
| 978 | ifndef $(target)_QT_MOCSRCS
|
---|
| 979 | $(foreach source, $(filter %.cxx %.CXX %.cpp %.CPP %.cc %.CC,\
|
---|
[1761] | 980 | $($(target)_SOURCES.$(bld_trg)) \
|
---|
| 981 | $($(target)_SOURCES.$(bld_trg_arch)) \
|
---|
| 982 | $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 983 | $($(target)_SOURCES.$(bld_trg_cpu)) \
|
---|
| 984 | $($(target)_SOURCES.$(bld_type)) \
|
---|
[1671] | 985 | $($(target)_SOURCES) \
|
---|
| 986 | ), $(evalval def_unit_qt4_target_pre_cpp_source))
|
---|
| 987 | endif
|
---|
| 988 |
|
---|
| 989 | # Install source handlers for .ui files.
|
---|
| 990 | $(target)_SRC_HANDLERS += \
|
---|
| 991 | .ui:def_unit_qt4_src_handler_ui \
|
---|
| 992 | .UI:def_unit_qt4_src_handler_ui \
|
---|
| 993 | .qrc:def_unit_qt4_src_handler_qrc \
|
---|
[1675] | 994 | .qrc:def_unit_qt4_src_handler_qrc
|
---|
[1671] | 995 |
|
---|
| 996 | # Calc the MOC and UI output directories and add them to BLDDIRS and INCS.
|
---|
[2239] | 997 | local qtmocdir := $($(target)_0_OUTDIR)/qtmoc
|
---|
| 998 | local qtuicdir := $($(target)_0_OUTDIR)/qtuic
|
---|
| 999 | local qtrccdir := $($(target)_0_OUTDIR)/qtrcc
|
---|
| 1000 | local qtnlsdir := $($(target)_0_OUTDIR)/qtnls
|
---|
[1675] | 1001 | $(eval $(target)_BLDDIRS += $(qtmocdir) $(qtuicdir) $(qtrccdir) $(qtnlsdir))
|
---|
| 1002 | $(eval $(target)_INCS += $(qtmocdir) $(qtuicdir))
|
---|
[1671] | 1003 |
|
---|
| 1004 | # Deal with QT_MOCSRCS.
|
---|
| 1005 | $(foreach source, \
|
---|
[1761] | 1006 | $($(target)_QT_MOCSRCS.$(bld_trg)) \
|
---|
| 1007 | $($(target)_QT_MOCSRCS.$(bld_trg_arch)) \
|
---|
| 1008 | $($(target)_QT_MOCSRCS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1009 | $($(target)_QT_MOCSRCS.$(bld_trg_cpu)) \
|
---|
| 1010 | $($(target)_QT_MOCSRCS.$(bld_type)) \
|
---|
[1671] | 1011 | $($(target)_QT_MOCSRCS) \
|
---|
| 1012 | , $(evalvalctx def_unit_qt4_target_pre_handle_moc_src))
|
---|
| 1013 |
|
---|
| 1014 | # Deal with QT_MOCHDRS.
|
---|
| 1015 | $(foreach source, \
|
---|
[1761] | 1016 | $($(target)_QT_MOCHDRS.$(bld_trg)) \
|
---|
| 1017 | $($(target)_QT_MOCHDRS.$(bld_trg_arch)) \
|
---|
| 1018 | $($(target)_QT_MOCHDRS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1019 | $($(target)_QT_MOCHDRS.$(bld_trg_cpu)) \
|
---|
| 1020 | $($(target)_QT_MOCHDRS.$(bld_type)) \
|
---|
[1671] | 1021 | $($(target)_QT_MOCHDRS) \
|
---|
| 1022 | , $(evalvalctx def_unit_qt4_target_pre_handle_moc_hdr))
|
---|
| 1023 |
|
---|
[1675] | 1024 | # Deal with QT_TRANSLATIONS.
|
---|
| 1025 | # ASSUMES (_ALL_)INSTALLS is processed after the targets using this unit.
|
---|
| 1026 | local translations := \
|
---|
[1761] | 1027 | $($(target)_QT_TRANSLATIONS.$(bld_trg)) \
|
---|
| 1028 | $($(target)_QT_TRANSLATIONS.$(bld_trg_arch)) \
|
---|
| 1029 | $($(target)_QT_TRANSLATIONS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1030 | $($(target)_QT_TRANSLATIONS.$(bld_trg_cpu)) \
|
---|
| 1031 | $($(target)_QT_TRANSLATIONS.$(bld_type)) \
|
---|
[1675] | 1032 | $($(target)_QT_TRANSLATIONS)
|
---|
| 1033 | ifneq ($(strip $(translations)),)
|
---|
| 1034 | local expr := _ALL_INSTALLS += $(target)-inst-nls
|
---|
| 1035 | $(eval $(expr))
|
---|
| 1036 | ifdef $(target)_QT_TRANSLATIONS_TEMPLATE
|
---|
| 1037 | $(target)-inst-nls_TEMPLATE := $($(target)_QT_TRANSLATIONS_TEMPLATE)
|
---|
[1688] | 1038 | else
|
---|
| 1039 | $(target)-inst-nls_MODE := 0644
|
---|
[1675] | 1040 | endif
|
---|
| 1041 | ifdef $(target)_QT_TRANSLATIONS_INST
|
---|
| 1042 | $(target)-inst-nls_INST := $($(target)_QT_TRANSLATIONS_INST)
|
---|
| 1043 | endif
|
---|
| 1044 | $(target)-inst-nls_SOURCES :=
|
---|
| 1045 | $(foreach source, $(translations)\
|
---|
| 1046 | , $(evalvalctx def_unit_qt4_target_pre_handle_translation))
|
---|
| 1047 | endif
|
---|
| 1048 |
|
---|
[1671] | 1049 | endef # def_unit_qt4_target_pre
|
---|
| 1050 |
|
---|
[1767] | 1051 |
|
---|
| 1052 | #
|
---|
| 1053 | # Rule for debugging.
|
---|
| 1054 | #
|
---|
| 1055 | unit-qt4-show-vars:
|
---|
| 1056 | @$(ECHO) 'The Qt4 SDK variables:'
|
---|
| 1057 | @$(ECHO) ' PATH_SDK_QT4 = "$(PATH_SDK_QT4)"'
|
---|
| 1058 | @$(ECHO) ' PATH_SDK_QT4_INC = "$(PATH_SDK_QT4_INC)"'
|
---|
| 1059 | @$(ECHO) ' PATH_SDK_QT4_LIB = "$(PATH_SDK_QT4_LIB)"'
|
---|
| 1060 | @$(ECHO) ' PATH_SDK_QT4_LIB.amd64 = "$(PATH_SDK_QT4_LIB.amd64)"'
|
---|
| 1061 | @$(ECHO) ' PATH_SDK_QT4_LIB.x86 = "$(PATH_SDK_QT4_LIB.x86)"'
|
---|
| 1062 | @$(ECHO) 'The Qt4 TOOL variables:'
|
---|
| 1063 | @$(ECHO) ' PATH_TOOL_QT4_BIN = "$(PATH_TOOL_QT4_BIN)"'
|
---|
| 1064 | @$(ECHO) ' TOOL_QT4_BIN_SUFF = "$(TOOL_QT4_BIN_SUFF)"'
|
---|
| 1065 | @$(ECHO) ' TOOL_QT4_MOC = "$(TOOL_QT4_MOC)"'
|
---|
| 1066 | @$(ECHO) ' TOOL_QT4_UIC = "$(TOOL_QT4_UIC)"'
|
---|
| 1067 | @$(ECHO) ' TOOL_QT4_RCC = "$(TOOL_QT4_RCC)"'
|
---|
| 1068 | @$(ECHO) ' TOOL_QT4_LRC = "$(TOOL_QT4_LRC)"'
|
---|
| 1069 | @$(ECHO) ' TOOL_QT4_LUPDATE = "$(TOOL_QT4_LUPDATE)"'
|
---|
[1769] | 1070 |
|
---|