Unsolved How to use QMAKE_EXTRA_COMPILERS to run rcc -binary
-
Hi
I want to create a project that consists of resources and the build step should simply run the rcc command to build a binary resource file.
rcc -binary -no-compress resources.qrc -o resources.rcc
I've been trying to accomplish this with QMAKE_EXTRA_COMPILERS, but I would appreciate some pointers.
TEMPLATE = lib CONFIG += console CONFIG -= app_bundle resource_build.input = RESOURCES resource_build.commands = rcc -binary -no-compress ${QMAKE_FILE_NAME} -o $$OUT_PWD/test.rcc resource_build.config += no_link QMAKE_EXTRA_COMPILERS += resource_build RESOURCES += \ res.qrc
Thanks.
-
@rincewind said in How to use QMAKE_EXTRA_COMPILERS to run rcc -binary:
RESOURCES += \
This will run
rcc
automatically already.Are you getting any errors? It's complaining that no C++ files are being compiled or something?
-
For anybody else trying to do this, this at least generates the binary resource file.
TEMPLATE = lib CONFIG += console CONFIG -= app_bundle resource_build.input = OTHER_FILES resource_build.output = out.rcc resource_build.depends = $$PWD/res.qrc resource_build.commands = rcc -binary -no-compress ${QMAKE_FILE_NAME} -o $$OUT_PWD/out.rcc resource_build.config += no_link QMAKE_EXTRA_COMPILERS += resource_build OTHER_FILES += \ res.qrc
I still get errors due to the linker not being happy with the rcc file. I obviously don't want to link against it.
According the documentation:
no_link — the files that are created should not be added to OBJECTS — i.e., they are not compiled code which should be linked, -
-
@jsulm
Because it would run the normal rcc command to generate cpp files, which is not what I want as I explained in my message and specified in the title... -
Hi,
Do you have the same issue if you follow the example provided here and just add the no_link option ?
-
Chiming in 5 years later.
CONFIG
needs to be capitalized, and I found that I also had to addtarget_predeps
to get mine to work.resource_build.CONFIG += no_link target_predeps