I have found that rcc does not have a mechanism allowing file locations to be changed based on platform. I have a large number of third party icons that I would like to remove from the build environment, placing in subdirectories under a location containing other third party assets. The location of these third party libraries necessarily needs to be platform dependent.
I would also prefer to keep the call to invoke the rcc compiler within the project build environment as different product versions would be able to control what resources get included. I also need to be able to include additional icons that would be maintained under the project directory.
There are two elegant solutions that I see although I am sure other solutions exist.
- Add support in rcc for environment variables. An environment variable could be set by the build tool to point to the top level directory containing third party resources.
- Allow include directories to be specified on the rcc command line. The include directories would then need to be searched in a manner similar to how most C++ compilers search include directories.
The snippet below shows what a .qrc file might look like using solution 1.
The snippet below shows what a .qrc file might look like using solution 2.
For now, I can work around this limitation by pre-processing the .qrc file using a Python script. Longer term a Qt officially supported solution would be greatly preferred.