2011-04-27 10:05:43 +00:00
|
|
|
qtPrepareTool(QMAKE_RCC, rcc)
|
|
|
|
|
|
|
|
isEmpty(RCC_DIR):RCC_DIR = .
|
|
|
|
isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc
|
|
|
|
|
|
|
|
resource_combine {
|
|
|
|
rcc.CONFIG += combine
|
|
|
|
rcc.output = $$RCC_DIR/$${first(QMAKE_MOD_RCC)}_combined$${first(QMAKE_EXT_CPP)}
|
|
|
|
} else {
|
|
|
|
rcc.output = $$RCC_DIR/$${first(QMAKE_MOD_RCC)}_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_CPP)}
|
|
|
|
}
|
|
|
|
!contains(QMAKE_RESOURCE_FLAGS, -root):!isEmpty(QMAKE_RESOURCE_ROOT):QMAKE_RESOURCE_FLAGS += -root $$QMAKE_RESOURCE_ROOT
|
|
|
|
!contains(QMAKE_RESOURCE_FLAGS, -name) {
|
|
|
|
resource_combine {
|
|
|
|
isEmpty(QMAKE_RESOURCE_NAME):!isEmpty(TARGET):QMAKE_RESOURCE_NAME = $$TARGET
|
|
|
|
!isEmpty(QMAKE_RESOURCE_NAME):QMAKE_RESOURCE_FLAGS += -name $$QMAKE_RESOURCE_NAME
|
|
|
|
} else {
|
|
|
|
QMAKE_RESOURCE_FLAGS += -name ${QMAKE_FILE_BASE}
|
|
|
|
}
|
|
|
|
}
|
2013-06-11 13:38:52 +00:00
|
|
|
rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" -o "${QMAKE_FILE_OUT}"
|
|
|
|
rcc.depend_command = $$QMAKE_RCC -list $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}"
|
qmake: Allow extra compilers to have the makefile depend on its inputs
And enable this configuration option for the resource compiler. This
results in a re-run of qmake whenever you touch a qrc file, which is
needed to keep the dependencies up to date. Otherwise you might end
up in the situation where you add a file to a qrc, edit the file some
time later, but a rebuild does not regenerate a cpp file and compile
that, so the final binary is stale.
Technically this dependency problem is present for all source files,
and qrc files are no different than any cpp file that you add a new
header #include to, or adding a Q_OBJECT macro to a header. To pick
up these changes we have to re-run qmake, so that qmake can run its
internal dependency checking, and any extra compiler dependency
commands.
The reason we're making this change for rcc files it that conceptually
people treat them as a "project" files, and expect them to behave similarly
to .pro or .pri files, in that editing the file will invalidate the
makefile. In practice this is often what happens when adding new
headers, as you touch the project file when changing the HEADERS
variable.
Task-number: QTBUG-13334
Change-Id: If69149678e7fba6d812d31dcc17877427f9a6122
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2011-11-24 15:03:19 +00:00
|
|
|
rcc.CONFIG += add_inputs_as_makefile_deps
|
2011-04-27 10:05:43 +00:00
|
|
|
rcc.input = RESOURCES
|
|
|
|
rcc.variable_out = SOURCES
|
|
|
|
rcc.name = RCC ${QMAKE_FILE_IN}
|
|
|
|
silent:rcc.commands = @echo rcc "${QMAKE_FILE_IN}" && $$rcc.commands
|
|
|
|
QMAKE_EXTRA_COMPILERS += rcc
|