Here is a simple way to have conditional .pro file options:
// *.pro
contains(opt,x) {
SOURCES += x_file.cpp
....
} else {
SOURCES += no_x_file.cpp
...
}
// *.pro
contains(opt,x) {
SOURCES += x_file.cpp
....
} else {
SOURCES += no_x_file.cpp
...
}
To copy to clipboard, switch view to plain text mode
When building your project, you can simply activate the "x" option by using qmake parameter:
// this will cause x_file.cpp to be compiled
qmake opt=x
// this will skip x_file.cpp and add no_x_file.cpp
qmake
// or
qmake opt=<anything but x>
// this will cause x_file.cpp to be compiled
qmake opt=x
// this will skip x_file.cpp and add no_x_file.cpp
qmake
// or
qmake opt=<anything but x>
To copy to clipboard, switch view to plain text mode
Bookmarks