I sometimes have to write qmake pro file like this:
QMAKE_EXTRA_TARGETS += activate
macos {
clear_cache.commands += defaults write io.delille.$$TARGET activated 1;
}
win32 {
clear_cache.commands += another working command;
}
linux {
clear_cache.commands += echo unsupported;
}
ios {
clear_cache.commands += echo unsupported;
}
Is there a way to have avoid listing all unsupported plateform in a simpler way like most language allow if if/else if statement?
qmake knowns about if/else: https://doc.qt.io/qt-5/qmake-language.html#scopes
win32:xml {
message(Building for Windows)
SOURCES += xmlhandler_win.cpp
} else:xml {
SOURCES += xmlhandler.cpp
} else {
message("Unknown configuration")
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With