Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an 'or' notation in qmake

Tags:

qt5

qmake

I am using win32, macx and unix:!macx aka. Linux if statements in my .pro file, to specify os specific tasks, e.g.

win32 {
    TARGET = myapp
    RC_FILE = myapp.rc
}
macx {
    TARGET = MyApp
    ICON = myapp.icns
    QMAKE_INFO_PLIST = Info.plist
}
unix:!macx { # linux
    CONFIG(debug, debug|release) {
        TARGET = myapp-debug
    }
    CONFIG(release, debug|release) {
        TARGET = myapp
    }
}

This works fine for if X else, if X elseif X else, and if not X where X is an os specifier.

Is there a way to tell qmake it must compile a block for os1 or os2?

like image 929
Simon Warta Avatar asked Mar 23 '15 17:03

Simon Warta


1 Answers

You can use the | operator for a logical or. For example:

win32|macx {
    HEADERS += debugging.h
}

http://doc.qt.io/qt-4.8/qmake-advanced-usage.html

like image 58
Jonathan M Avatar answered Oct 07 '22 02:10

Jonathan M