Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Qmake test function not working as documented
Qt 6.11 is out! See what's new in the release blog

[SOLVED] Qmake test function not working as documented

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.1k Views 2 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.
  • D Offline
    D Offline
    DRoscoe
    wrote on last edited by DRoscoe
    #1

    According to the documentation at http://doc.qt.io/qt-5/qmake-test-function-reference.html#files-pattern-recursive-false:

    files(pattern[, recursive=false])

    Expands the specified wildcard pattern and returns a list of filenames. If recursive is true, this function descends into subdirectories.

    However, even if I set recursive=true, qmake does not descend into the subdirectories:

    SOURCES += $$files($$aop_srcdir/core/aop_interface/.cpp, recursive=true)
    HEADERS += $$files($$aop_srcdir/core/aop_interface/
    .hpp, recursive=true)

    All I get is the top level files with no recursion. I am using Qt 5.4

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      SOURCES += $$files($$aop_srcdir/core/aop_interface/*.cpp, true)
      HEADERS += $$files($$aop_srcdir/core/aop_interface/*.hpp, true)
      

      should work

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • D Offline
        D Offline
        DRoscoe
        wrote on last edited by
        #3

        Yes, that did the trick. I read the documentation a bit too literally and qmake didn't complain. It just ignored me!

        Thank you!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I agree that sometimes a little example could be useful especially in such a case

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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