2015-12-08 08:36:36 +01:00
|
|
|
# specify build directories for moc, object and rcc files
|
2015-04-22 18:57:44 +02:00
|
|
|
MOC_DIR = ./moc
|
|
|
|
OBJECTS_DIR = ./obj
|
|
|
|
RCC_DIR = ./res
|
2015-12-08 08:36:36 +01:00
|
|
|
|
|
|
|
# compiler flags: enable C++11
|
2015-04-22 18:57:44 +02:00
|
|
|
QMAKE_CXXFLAGS += -std=c++11
|
|
|
|
QMAKE_LFLAGS += -std=c++11
|
2015-12-08 08:36:36 +01:00
|
|
|
|
2015-12-13 20:42:37 +01:00
|
|
|
# disable new ABI (can't catch ios_base::failure with new ABI)
|
|
|
|
DEFINES += _GLIBCXX_USE_CXX11_ABI=0
|
|
|
|
|
2015-12-08 08:36:36 +01:00
|
|
|
# variables to check target architecture
|
|
|
|
win32-g++:QMAKE_TARGET.arch = $$QMAKE_HOST.arch
|
|
|
|
win32-g++-32:QMAKE_TARGET.arch = x86
|
|
|
|
win32-g++-64:QMAKE_TARGET.arch = x86_64
|
|
|
|
linux-g++:QMAKE_TARGET.arch = $$QMAKE_HOST.arch
|
|
|
|
linux-g++-32:QMAKE_TARGET.arch = x86
|
|
|
|
linux-g++-64:QMAKE_TARGET.arch = x86_64
|
|
|
|
|
|
|
|
# determine and print target prefix
|
2015-06-24 00:50:31 +02:00
|
|
|
targetprefix = $$(TARGET_PREFIX)
|
|
|
|
message("Using target prefix \"$${targetprefix}\".")
|
2015-12-08 08:36:36 +01:00
|
|
|
|
2015-06-24 00:50:31 +02:00
|
|
|
# print install root
|
|
|
|
message("Using install root \"$$(INSTALL_ROOT)\".")
|
2015-12-08 08:36:36 +01:00
|
|
|
|
|
|
|
# set target
|
2015-04-22 18:57:44 +02:00
|
|
|
CONFIG(debug, debug|release) {
|
2015-07-17 23:56:38 +02:00
|
|
|
TARGET = $${targetprefix}$${projectname}d
|
2015-04-22 18:57:44 +02:00
|
|
|
} else {
|
2015-07-17 23:56:38 +02:00
|
|
|
TARGET = $${targetprefix}$${projectname}
|
2015-04-22 18:57:44 +02:00
|
|
|
}
|
2015-12-08 08:36:36 +01:00
|
|
|
|
|
|
|
# add defines for meta data
|
2015-12-05 22:50:38 +01:00
|
|
|
DEFINES += "APP_METADATA_AVAIL"
|
2015-07-27 23:23:49 +02:00
|
|
|
DEFINES += "'PROJECT_NAME=\"$${projectname}\"'"
|
|
|
|
DEFINES += "'APP_NAME=\"$${appname}\"'"
|
|
|
|
DEFINES += "'APP_AUTHOR=\"$${appauthor}\"'"
|
|
|
|
DEFINES += "'APP_URL=\"$${appurl}\"'"
|
|
|
|
DEFINES += "'APP_VERSION=\"$${VERSION}\"'"
|
2015-12-08 08:36:36 +01:00
|
|
|
|
|
|
|
# configure Qt modules and defines
|
2015-04-22 18:57:44 +02:00
|
|
|
mobile {
|
|
|
|
DEFINES += CONFIG_MOBILE
|
|
|
|
} else:desktop {
|
|
|
|
DEFINES += CONFIG_DESKTOP
|
|
|
|
} else:android {
|
|
|
|
CONFIG += mobile
|
|
|
|
DEFINES += CONFIG_MOBILE
|
|
|
|
} else {
|
|
|
|
CONFIG += desktop
|
|
|
|
DEFINES += CONFIG_DESKTOP
|
|
|
|
}
|
|
|
|
no-gui {
|
|
|
|
QT -= gui
|
|
|
|
DEFINES += GUI_NONE
|
|
|
|
guiqtquick || guiqtwidgets {
|
|
|
|
error("Can not use no-gui with guiqtquick or guiqtwidgets.")
|
|
|
|
} else {
|
|
|
|
message("Configured for no GUI support.")
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
QT += gui
|
|
|
|
mobile {
|
|
|
|
CONFIG += guiqtquick
|
|
|
|
}
|
|
|
|
desktop {
|
|
|
|
CONFIG += guiqtwidgets
|
|
|
|
}
|
|
|
|
}
|
|
|
|
guiqtquick {
|
|
|
|
message("Configured for Qt Quick GUI support.")
|
2015-12-08 08:36:36 +01:00
|
|
|
QT += quick
|
2015-04-22 18:57:44 +02:00
|
|
|
CONFIG(debug, debug|release) {
|
|
|
|
CONFIG += qml_debug
|
|
|
|
}
|
|
|
|
DEFINES += GUI_QTQUICK
|
|
|
|
}
|
|
|
|
guiqtwidgets {
|
|
|
|
message("Configured for Qt widgets GUI support.")
|
2015-12-08 08:36:36 +01:00
|
|
|
QT += widgets
|
2015-04-22 18:57:44 +02:00
|
|
|
DEFINES += GUI_QTWIDGETS
|
|
|
|
DEFINES += MODEL_UNDO_SUPPORT
|
|
|
|
}
|
2015-12-08 08:36:36 +01:00
|
|
|
|
|
|
|
# configuration for cross compliation with mingw-w64
|
2015-09-22 01:49:12 +02:00
|
|
|
win32 {
|
|
|
|
QMAKE_TARGET_PRODUCT = "$${appname}"
|
|
|
|
QMAKE_TARGET_COPYRIGHT = "by $${appauthor}"
|
|
|
|
}
|
2015-07-17 23:56:38 +02:00
|
|
|
mingw-w64-manualstrip-dll {
|
|
|
|
QMAKE_POST_LINK=$${CROSS_COMPILE}strip --strip-unneeded ./release/$(TARGET); \
|
|
|
|
$${CROSS_COMPILE}strip --strip-unneeded ./release/lib$(TARGET).a
|
|
|
|
}
|
|
|
|
mingw-w64-manualstrip-exe {
|
|
|
|
QMAKE_POST_LINK=$${CROSS_COMPILE}strip --strip-unneeded ./release/$(TARGET)
|
|
|
|
}
|
|
|
|
mingw-w64-noversion {
|
2015-09-22 01:49:12 +02:00
|
|
|
TARGET_EXT = ".dll"
|
|
|
|
TARGET_VERSION_EXT = ""
|
|
|
|
CONFIG += skip_target_version_ext
|
2015-07-17 23:56:38 +02:00
|
|
|
}
|