Results 1 to 3 of 3

Thread: qmake HEADERS/SOURCES and INCLUDEPATH

  1. #1
    Join Date
    Jan 2012
    Posts
    15
    Thanks
    4
    Qt products
    Qt4

    Default qmake HEADERS/SOURCES and INCLUDEPATH

    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?

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qmake HEADERS/SOURCES and INCLUDEPATH

    Why can't you just add the full path to INCLUDEPATH ?
    Qt Code:
    1. win32:INCLUDEPATH += "C:/Users/John/workspace/lib" "C:/Users/John/workspace/lib/extras"
    2. win32:DEPENDPATH += "C:/Users/John/workspace/lib" "C:/Users/John/workspace/lib/extras"
    3.  
    4. HEADERS += ...
    5. ...
    6. ...
    7. headerclassx.h \
    8. headerclassy.h
    9. SOURCES+= ...
    10. ...
    11. ...
    12. sourceclassx.cc \
    13. sourceclassy.cc
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake HEADERS/SOURCES and INCLUDEPATH

    INCLUDEPATH is for including files from within C++ code. What you want is DEPENDPATH.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. The following user says thank you to wysota for this useful post:

    conti (17th February 2012)

Similar Threads

  1. Replies: 2
    Last Post: 20th May 2010, 13:42
  2. Replies: 1
    Last Post: 2nd December 2008, 11:31
  3. another qmake INCLUDEPATH spaces problem
    By mmueller in forum Qt Programming
    Replies: 4
    Last Post: 31st July 2008, 14:12
  4. qmake multiple INCLUDEPATH in Linux
    By rajeshs in forum Qt Programming
    Replies: 12
    Last Post: 15th November 2007, 10:38
  5. qmake INCLUDEPATH with spaces
    By bitChanger in forum Qt Programming
    Replies: 8
    Last Post: 28th April 2006, 05:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.