我有一个结构如下的共享库项目:
图书馆专业版:
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += libs plugins test_programs
...
QT += concurrent
...
# Those files contains pure interfaces (C++ abstract classes)
# with no implementation, and some helper classes with inline implementation.
# So there is no reason to create yet another subproject for them
HEADERS += iface/IInterface1.h \
iface/IInterface2.h \ # IInterface2 needs QtConcurrent
...
接口2.h:
...
#include <QtConcurrent> // ERROR HERE: file not found, i.e. qmake ignores
// "QT += concurrent" statement in library.pro
class MyHelperExc : public QtConcurrent::Exception
{ ... }
class IInterface2: public virtual IBaseInterface
{ ... }
所以,我的问题是:qmake 只是忽略了SUBDIRS
父项目中的变量操作。但它在子项目中工作正常。我究竟做错了什么?