Reputation: 1051
I have a project, which looks like this:
Structure:
MyProject
--- MyProject.pro
--- .qmake.conf
--- src
--- src.pro
--- tmp
--- MyClass.cpp
--- MyClass.h
MyProject.pro
TEMPLATE = subdirs
SUBDIRS = src
.qmake.conf
TOP_DIR=$$PWD
src.pro
...
INCLUDEPATH += "$$TOP_DIR/src/tmp/"
SOURCES += MyClass.cpp
HEADERS += MyClass.h
...
Now If I try to run qmake I'm getting warning Failure to find MyClass.cpp
. Is there another way I can tell qmake where should he look for *.cpp/h files?
I am using Qt 5.7 (which means that DEPENDPATH won't work).
Upvotes: 0
Views: 534
Reputation: 5370
Include paths (INCLUDEPATH
) are only used for include statements inside the cpp/header file. Like those:
#include <someHeader>
For the project file you have to specify the relative path.
SOURCES += tmp/MyClass.cpp
Upvotes: 1