summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/features/moc.prf47
1 files changed, 11 insertions, 36 deletions
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index f60e7b54e3..652d5ea94f 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -5,47 +5,26 @@ isEmpty(MOC_DIR):MOC_DIR = .
isEmpty(QMAKE_H_MOD_MOC):QMAKE_H_MOD_MOC = moc_
isEmpty(QMAKE_EXT_CPP_MOC):QMAKE_EXT_CPP_MOC = .moc
+MOC_INCLUDEPATH = $$QMAKESPEC $$_PRO_FILE_PWD_ $$INCLUDEPATH
+
# On Windows, put the includes into a .inc file which moc will read, if the project
# has too many includes. We do this to overcome a command-line limit on Win < XP
-INCLUDETEMP=
WIN_INCLUDETEMP=
-win32:count(INCLUDEPATH, 40, >) {
- INCLUDETEMP = $$MOC_DIR/mocinclude.tmp
-
- WIN_INCLUDETEMP=$$INCLUDETEMP
-
- EOC = $$escape_expand(\\n\\t)
-
- contains(TEMPLATE, "vc.*") {
- # the VCPROJ generator will replace the \r\h with the coded \r\n: &#x0d;&#x0a;
- EOC = $$escape_expand(\\r\\h)
- }
+win32:count(MOC_INCLUDEPATH, 40, >) {
+ WIN_INCLUDETEMP = $$MOC_DIR/mocinclude.tmp
- RET = @echo -I$$QMAKESPEC > $$WIN_INCLUDETEMP $$EOC
- RET += @echo -I$$_PRO_FILE_PWD_ >> $$WIN_INCLUDETEMP $$EOC
- unset(INCFILELIST)
- for(incfile, INCLUDEPATH) {
- INCFILELIST = -I$$incfile
- RET += @echo $$INCFILELIST>> $$WIN_INCLUDETEMP $$EOC
- }
- !isEmpty(INCFILELIST):RET += @echo $$INCFILELIST>> $$WIN_INCLUDETEMP $$EOC
-
- build_pass|isEmpty(BUILDS) {
- mocinclude.target = $$INCLUDETEMP
- mocinclude.commands = $$RET
- QMAKE_EXTRA_TARGETS += mocinclude
- }
+ WIN_INCLUDETEMP_CONT =
+ for (inc, MOC_INCLUDEPATH): \
+ WIN_INCLUDETEMP_CONT += -I$$inc
+ write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error("Aborting.")
}
defineReplace(mocCmdBase) {
RET =
!isEmpty(WIN_INCLUDETEMP) {
- contains(TEMPLATE, "vc.*") {
- RET += $$mocinclude.commands
- }
incvar = @$$WIN_INCLUDETEMP
} else {
- incvar = -I$$QMAKESPEC -I$$_PRO_FILE_PWD_ $$join(INCLUDEPATH, " -I", -I)
+ incvar = $$join(MOC_INCLUDEPATH, " -I", -I)
incvar += $$QMAKE_FRAMEWORKPATH_FLAGS
}
RET += $$QMAKE_MOC $(DEFINES) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$incvar $$join(QMAKE_DEFAULT_INCDIRS, " -I", -I) $$QMAKE_MOC_OPTIONS
@@ -60,9 +39,7 @@ moc_header.output = $$MOC_DIR/$${QMAKE_H_MOD_MOC}${QMAKE_FILE_BASE}$${first(QMAK
moc_header.input = HEADERS
moc_header.variable_out = SOURCES
moc_header.name = MOC ${QMAKE_FILE_IN}
-!contains(TEMPLATE, "vc.*") {
- !isEmpty(INCLUDETEMP):moc_header.depends += $$INCLUDETEMP
-}
+moc_header.depends += $$WIN_INCLUDETEMP
silent:moc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_header.commands
QMAKE_EXTRA_COMPILERS += moc_header
INCREDIBUILD_XGE += moc_header
@@ -74,9 +51,7 @@ moc_source.commands = ${QMAKE_FUNC_mocCmdBase} ${QMAKE_FILE_IN} -o ${QMAKE_FILE_
moc_source.output = $$MOC_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_EXT_CPP_MOC}
moc_source.input = SOURCES OBJECTIVE_SOURCES
moc_source.name = MOC ${QMAKE_FILE_IN}
-!contains(TEMPLATE, "vc.*") {
- !isEmpty(INCLUDETEMP):moc_source.depends += $$INCLUDETEMP
-}
+moc_source.depends += $$WIN_INCLUDETEMP
silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands
QMAKE_EXTRA_COMPILERS += moc_source
INCREDIBUILD_XGE += moc_source