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

$$files(...) should be able to be case insensitive

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • 6.5
    • Build tools: qmake
    • None
    • All

    Description

      $$files(..) is extremely useful when you work with git and you don't want merge issues each time a file is added to the project.

      But when you add assets, you have to be sure that the extension of the file match with the project file. But if you have a lot of assets and the extension have uppercase, you don't want to rename each files.

      Luckily it was images and the extension was full uppercase so this work.

      FORMATS_SOURCES = .c .cpp
      for(FORMAT, FORMATS_SOURCES) {
          SOURCES += $$files(*$$FORMAT, true)
          SOURCES += $$files(*$$upper($$FORMAT), true)
          SOURCES += $$files(*$$lower($$FORMAT), true)
      }
      SOURCES = $$unique(SOURCES)
      
      FORMATS_HEADERS = .h .hpp
      for(FORMAT, FORMATS_HEADERS) {
          HEADERS += $$files(*$$FORMAT, true)
          HEADERS += $$files(*$$upper($$FORMAT), true)
          HEADERS += $$files(*$$lower($$FORMAT), true)
      }
      HEADERS = $$unique(HEADERS)
      
      FORMATS = .png .jpg .jpeg .svg
      FORMATS += .qml .js qmldir
      for(FORMAT, FORMATS) {
          resources.files += $$files(*$$FORMAT, true)
          resources.files += $$files(*$$upper($$FORMAT), true)
          resources.files += $$files(*$$lower($$FORMAT), true)
      }
      resources.files = $$unique(resources.files) 
      #resources.prefix = /
      RESOURCES += resources

      But it's a bit ugly and it doesn't take every possible case into account.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            dalverny Sébastien Dalverny
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes