PDA

View Full Version : qmake HEADERS/SOURCES and INCLUDEPATH



conti
26th January 2012, 12:13
Hi i hope someone can help me i don'T know what i'm doing wrong here. Im trying to include sources and headers from another directory to my project on a windows system im doing the following:
in the .pro file:
win32:INCLUDEPATH += "C:/Users/John/workspace/lib"
win32:INCLUDEPATH += $$quote(C:/Users/John/workspace/lib)

HEADERS += ...
...
...
extras/headerclassx.h \
extras/headerclassy.h
SOURCES+= ...
...
...
extras/sourceclassx.cc \
extras/sourceclassy.cc

This doesn't work, qmake allways prints the error "Failure to find extras\headerclassx.h" which is located in the "C:/Users/John/workspace/lib" path that is included with INCLUDEPATH.

However it works well when i change the path in the HEADERS and SOURCES to the absolute path of the files C:/Users/John/workspace/lib/extras/headerclassx.h
How can i tell qmake to use relative paths? What am i doing wrong?

stampede
28th January 2012, 17:31
Why can't you just add the full path to INCLUDEPATH ?


win32:INCLUDEPATH += "C:/Users/John/workspace/lib" "C:/Users/John/workspace/lib/extras"
win32:DEPENDPATH += "C:/Users/John/workspace/lib" "C:/Users/John/workspace/lib/extras"

HEADERS += ...
...
...
headerclassx.h \
headerclassy.h
SOURCES+= ...
...
...
sourceclassx.cc \
sourceclassy.cc

wysota
28th January 2012, 18:29
INCLUDEPATH is for including files from within C++ code. What you want is DEPENDPATH.