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

Declare variable of path in .pro file



  • Hi,

    I have repeated "../../GreenhouseApp/src" in the code very many times, how can I create a variable that holds the path value. And how to insert it into the path declaration in SOURCES?

    SOURCES += \ 
        testsection.cpp \
        ../../GreenhouseApp/src/SectionWidget/section.cpp \
        ../../GreenhouseApp/src/SectionWidget/device.cpp \
        ../../GreenhouseApp/src/SectionWidget/settingsdialog.cpp \
        ../../GreenhouseApp/src/messenger.cpp
    

  • Lifetime Qt Champion

    Hi

    COMMONDIR=../../../Common
    SOURCES +=  $$COMMONDIR/path/xxx.cpp \
    $$COMMONDIR/otherpath/yyy.cpp 
    
    

Log in to reply