DEPENDPATH in .pro file



  • Hi
    In my .pro file I make reference to a .pri file -
    @
    include (C://SoftwareDevelopment//Shared//CommonUI//ApplicationCode//ASLLog.pri)
    @

    I have also added a DEPENDPATH section
    @
    C://SoftwareDevelopment//Shared//CommonUI//ApplicationCode//Widgets
    @

    The .pri file specifies the files in the Widgets folder to be compiled

    I thought that with this arrangement a change made to a file in the Widgets folder would result in my application compiling this changed file. This does not happen - I have to change a file in my base project to force a compile and then the Widgets file is compiled.

    Have I misunderstood the DEPENDPATH directive ot am I using it incorrectly

    Any advice would be appreciated

    Thanks



  • DEPENDPATH defines the path of the FILES which needed by your project when building.



  • If you want files to be compiled as part of your project, you need to add them as HEADERS and SOURCES

    I have used DEPENDPATH only for referencing libraries that I link to my project. It allows changes to these libraries to be detected, and re-links the project in this case.
    (If the DEPENDPATH has other uses, I don't know about it).



  • Hi
    My .pri files adds the to the list of files and headers.
    Editing a file referenced in the .pri file does not result in that file being compiled



  • Maybe the files are not found.

    Files and Headers are always searched relative to the position of the .pro-File, NOT the position of the .pri file.
    So if you use relative path names, you need to be aware of that.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.