Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62164

Feature request: Support for environment variables or include paths in RCC

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.9.1
    • Build tools: rcc

    Description

      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.

      1. 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. 
      2. 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.

      <RCC>
        <qresource prefix="/">
          <file alias="edit_copy.png">icons/edit_copy.png</file>
          <file alias="edit_paste.png">${THIRD_PARTY_ICONS}/32/edit_paste.png</file>
          ...
          ...

      The snippet below shows what a .qrc file might look like using solution 2.

      <RCC>
        <qresource prefix="/">
          <file alias="edit_copy.png">icons/edit_copy.png</file>
          <file alias="edit_paste.png">32/edit_paste.png</file>
          ...
          ...

      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.
       
      Thanks !
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            psmith Paul Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes