Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Include all source files in a subfolder
Forum Updated to NodeBB v4.3 + New Features

Include all source files in a subfolder

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 4 Posters 10.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cairo
    wrote on last edited by
    #1

    I'd like to be able to just include all source and header files in a subfolder in the .pro file.

    Something like

    SOURCES += src/*.cpp

    Is this possible?

    Please.. It is such a pain always adding and deleting individual files.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Thanatos.jsse
      wrote on last edited by
      #2

      Take a look to this "thread":http://qt-project.org/forums/viewthread/4730.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Would it be enough to generate the .pro file once? In that case, you can use qmake to generate a .pro file based on what is already there in the source dir.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Cairo
          wrote on last edited by
          #4

          Alright guys, I quickly wrote up a Java file to parse my .pri file to re-generate it based on the INCLUDEPATH.

          If anyone else wants this work around you can find the source code here:
          http://blog.softpoetry.com/2012/05/qt-way-to-include-all-source-files.html

          *Only tested it on my Mac

          1 Reply Last reply
          0
          • S Offline
            S Offline
            stephenju
            wrote on last edited by
            #5

            This will probably work:
            @SOURCES += $$system(ls src/.cpp)
            HEADERS += $$system(ls src/
            .h)
            @
            You'll have to change the command used if you are not on Unix-based OS.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved