source: trunk/kBuild/units/qt4.kmk@ 2015

Last change on this file since 2015 was 1774, checked in by bird, 17 years ago

qt4: More detection fixes. Don't suffix RCC.

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