qt proファイルで異なるqtバージョンを区別する

3186 ワード

        Qt         ,                   ,   Pro        Qt     

#chec Qt version
QT_VERSION = $$[QT_VERSION]
QT_VERSION = $$split(QT_VERSION, ".")
QT_VER_MAJ = $$member(QT_VERSION, 0) 
QT_VER_MIN = $$member(QT_VERSION, 1)
CONFIG(debug, debug|release) {
    equals(QT_MAJOR_VERSION, 5) {
        LIBS += -L../3Parts/qwt/lib/qt5 -lqwtd
    }
    equals(QT_MAJOR_VERSION, 4) {
        LIBS += -L../3Parts/qwt/lib/qt4 -lqwtd
    }
} else {
    equals(QT_MAJOR_VERSION, 5) {
        LIBS += -L../3Parts/qwt/lib/qt5 -lqwt
    }
    equals(QT_MAJOR_VERSION, 4) {
        LIBS += -L../3Parts/qwt/lib/qt4 -lqwt
    }
}
 
    
    

http://www.qtcentre.org/threads/15416-Qt-version-checking-at-the-project-file