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