PRI files and indirect dependencies

  • Hi all,

    in my repo I have tens of different libraries. When I add a new dependency in one of them I have to modify all the applications and libraries that depended on them, all the .pro files. It's so time consuming, I don't know if there is a better way, but now I'm trying to create a .pri for each library in order to make this process easier in some way. During this process I've found the following issue:

    I have created a qmake function that includes a .pri file:

    defineTest(add_my_lib) {
        lib_name = $$1
        message("adding lib$$lib_name ")

    in this .pri file I have added lines to include a library:

    INCLUDEPATH += /pathToLib/src
    LIBS += -L/pathToLib/lib -lmylibname

    The problem is that for some reason in the .pro that calls add_my_lib the INCLUDEPATH gets reset. It looks like INCLUDEPATH is a variable that cannot be modified by functions. Or better, it can inside the function but the values do not get propagated in the caller .pro file.

    Is this the correct behavior or am I doing something wrong?

  • Lifetime Qt Champion


    Please don't post the same question in multiple sub-forums. One is enough.

    You had an answer in your other thread.

    Closing this one

Log in to reply