Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED] INCPATH in make file, produced by qmake has two -I



  • Hi all,

    I have a file containing my makefile variables, which I want to include them in INCPATH of the makefile. So, in my .pro file I set:

    @INCLUDEPATH += $$SOME_VAR@

    These variables have an -I in front of the addresses. But, qmake automatically adds an -I before these variables and then include them in the makefile, which causes problem in my case. Is there a way to get rid of this extra -I that qmake adds to my INCPATH variables?

    Thanks


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    AFAIK, no, however you can do something like this

    @
    INCLUDEPATH += $$replace(SOME_VAR, -I,))
    @

    Which will remove all the -I from SOME_VAR

    Hope it helps



  • Dude , You know that you are awesome !!! So , how I should mark this as solved?


  • Lifetime Qt Champion

    Thanks :)

    Easy: edit your original post and update the title


Log in to reply