Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-8925

Recursive use of wildcards in .pro files

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      When setting up .pro files for projects for my coworkers, I often have found it helpful to specify the HEADERS and SOURCES using wildcards, e.g.,

      HEADERS += *.h
      SOURCES += *.cpp

      This works great for files within the root project directory. Unfortunately, if there are sub directories within this project directory that contain header and source files, the wildcard does not seem to recursively traverse these directories.

      In some cases, we have a lot of sub directories and it can be a bit painful to add a new line manually for each subdirectory, e.g.,

      HEADERS += *.h \
      sub1*.h \
      sub2*.h
      subn*.h
      SOURCES += *.cpp \
      sub1*.cpp \
      sub2*.cpp
      subn*.cpp

      I know Qt Creator provides a way to import an existing project, but in that case it doesn't use wildcards for HEADERS and SOURCES, it includes each file individually.

      It would be great if there were a way to specify a recursive option for the wildcards. Perhaps even a way to use the wildcard recursively and then exclude a particular subdirectory with, e.g.,

      HEADERS -= unwanteddir*.h

      would be great.

      This would make writing .pro files by hand for complex codebases a breeze.

        Attachments

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

          Activity

            People

            Assignee:
            dt Daniel Teske
            Reporter:
            fonzi337 Alfonso Chartier
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes