[SOLVED] Qmake test function not working as documented
-
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
-
Hi,
SOURCES += $$files($$aop_srcdir/core/aop_interface/*.cpp, true) HEADERS += $$files($$aop_srcdir/core/aop_interface/*.hpp, true)
should work
-
Yes, that did the trick. I read the documentation a bit too literally and qmake didn't complain. It just ignored me!
Thank you!
-
I agree that sometimes a little example could be useful especially in such a case