| 1 |
###################################################################### |
| 2 |
# |
| 3 |
# Mobility API project - common QMake settings |
| 4 |
# |
| 5 |
###################################################################### |
| 6 |
|
| 7 |
|
| 8 |
CONFIG(debug, debug|release) { |
| 9 |
WAS_IN_DEBUG=debug |
| 10 |
} else { |
| 11 |
WAS_IN_DEBUG=release |
| 12 |
} |
| 13 |
|
| 14 |
include($$QT_MOBILITY_BUILD_TREE/config.pri) |
| 15 |
|
| 16 |
mac { |
| 17 |
contains(QT_CONFIG, qt_framework):contains(TEMPLATE, lib) { |
| 18 |
#MacOSX always builds debug and release libs when using mac framework |
| 19 |
CONFIG+=$$WAS_IN_DEBUG |
| 20 |
CONFIG += debug_and_release build_all |
| 21 |
} else { |
| 22 |
!contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) { |
| 23 |
CONFIG -= debug_and_release debug release |
| 24 |
contains(QT_CONFIG,debug): CONFIG+=debug |
| 25 |
contains(QT_CONFIG,release): CONFIG+=release |
| 26 |
} |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
#In Windows we want to build libraries in debug and release mode if the user |
| 31 |
#didn't select a version - if Qt is build in debug_and_release |
| 32 |
#this avoids problems for third party as qmake build debug by default |
| 33 |
#If mobility selected debug_and_release but Qt only supports |
| 34 |
#one version but not the other we slently disable the impossible combination |
| 35 |
win32:contains(CONFIG_WIN32,build_all) { |
| 36 |
contains(QT_CONFIG,debug):contains(QT_CONFIG,release) { |
| 37 |
contains(TEMPLATE,.*lib):!plugin { |
| 38 |
CONFIG += $$WAS_IN_DEBUG |
| 39 |
CONFIG += debug_and_release build_all |
| 40 |
} |
| 41 |
} else { |
| 42 |
CONFIG -= debug_and_release debug release |
| 43 |
contains(QT_CONFIG,debug): CONFIG+=debug |
| 44 |
contains(QT_CONFIG,release): CONFIG+=release |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
# Helper function. This should move to a .prf file |
| 49 |
defineReplace(mobilityDeployFilename) { |
| 50 |
unset(MOBILITY_DEPLOY_NAME) |
| 51 |
MOBILITY_DEPLOY_NAME = $$1 |
| 52 |
CONFIG(debug, debug|release): { |
| 53 |
mac:RET = $$member(MOBILITY_DEPLOY_NAME, 0)_debug |
| 54 |
else:win32:RET = $$member(MOBILITY_DEPLOY_NAME, 0)d |
| 55 |
} |
| 56 |
isEmpty(RET):RET = $$MOBILITY_DEPLOY_NAME |
| 57 |
return($$RET) |
| 58 |
} |
| 59 |
|
| 60 |
# Make sure this goes everywhere we need it |
| 61 |
symbian: load(data_caging_paths) |
| 62 |
|
| 63 |
|
| 64 |
# Figure out the root of where stuff should go (this could be done via configure) |
| 65 |
OUTPUT_DIR = $$QT_MOBILITY_BUILD_TREE |
| 66 |
SOURCE_DIR = $$PWD |
| 67 |
|
| 68 |
CONFIG(debug, debug|release) { |
| 69 |
SUBDIRPART=Debug |
| 70 |
} else { |
| 71 |
SUBDIRPART=Release |
| 72 |
} |
| 73 |
|
| 74 |
contains(QT_CONFIG, reduce_exports):CONFIG+=hide_symbols |
| 75 |
|
| 76 |
#export more symbols if we build the unit tests |
| 77 |
contains(build_unit_tests, yes):DEFINES+=QTM_BUILD_UNITTESTS |
| 78 |
|
| 79 |
#test whether we have a unit test |
| 80 |
!testcase { |
| 81 |
OBJECTS_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET |
| 82 |
!plugin { |
| 83 |
contains(TEMPLATE,.*lib):DESTDIR = $$OUTPUT_DIR/lib |
| 84 |
else:DESTDIR = $$OUTPUT_DIR/bin |
| 85 |
} else { |
| 86 |
testplugin:DESTDIR = $$OUTPUT_DIR/build/tests/bin/plugins/$$PLUGIN_TYPE |
| 87 |
!testplugin:DESTDIR = $$OUTPUT_DIR/plugins/$$PLUGIN_TYPE |
| 88 |
} |
| 89 |
|
| 90 |
MOC_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/moc |
| 91 |
RCC_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/rcc |
| 92 |
UI_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/ui |
| 93 |
QMAKE_RPATHDIR += $$QT_MOBILITY_LIB |
| 94 |
} else { |
| 95 |
# Unit test code (no plugins! test plugins are just normal plugins installed elsewhere) |
| 96 |
QT *= testlib |
| 97 |
CONFIG += console |
| 98 |
CONFIG -= app_bundle |
| 99 |
OBJECTS_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET |
| 100 |
DESTDIR = $$OUTPUT_DIR/build/tests/bin |
| 101 |
MOC_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/moc |
| 102 |
RCC_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/rcc |
| 103 |
UI_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/ui |
| 104 |
QMAKE_RPATHDIR += $$OUTPUT_DIR/lib |
| 105 |
} |
| 106 |
|
| 107 |
maemo6 { |
| 108 |
DEFINES+= Q_WS_MAEMO_6 |
| 109 |
} |
| 110 |
maemo5 { |
| 111 |
DEFINES+= Q_WS_MAEMO_5 |
| 112 |
} |
| 113 |
|
| 114 |
wince* { |
| 115 |
### Bearer Management |
| 116 |
BEARERLIB.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtBearer).dll |
| 117 |
BEARERLIB.path = . |
| 118 |
DEPLOYMENT += BEARERLIB |
| 119 |
|
| 120 |
### Contacts |
| 121 |
# Main library |
| 122 |
CONTACTS_DEPLOYMENT.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtContacts).dll |
| 123 |
CONTACTS_DEPLOYMENT.path = /Windows |
| 124 |
|
| 125 |
# Plugins |
| 126 |
CONTACTS_PLUGINS_DEPLOYMENT.sources = $$OUTPUT_DIR/plugins/contacts/*.dll |
| 127 |
CONTACTS_PLUGINS_DEPLOYMENT.path = plugins/contacts |
| 128 |
DEPLOYMENT += CONTACTS_DEPLOYMENT CONTACTS_PLUGINS_DEPLOYMENT |
| 129 |
|
| 130 |
### Service Framework |
| 131 |
SFW_DEPLOYMENT.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtServiceFramework).dll |
| 132 |
SFW_DEPLOYMENT.path = . |
| 133 |
DEPLOYMENT += SFW_DEPLOYMENT |
| 134 |
|
| 135 |
### Location |
| 136 |
LOCATION.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtLocation).dll |
| 137 |
LOCATION.path = . |
| 138 |
DEPLOYMENT += LOCATION |
| 139 |
} |
| 140 |
|
| 141 |
symbian { |
| 142 |
#For some reason the default include path doesn't include MOC_DIR on symbian |
| 143 |
INCLUDEPATH += $$MOC_DIR |
| 144 |
} |
| 145 |
|
| 146 |
# Add the output dirs to the link path too |
| 147 |
mac:contains(QT_CONFIG,qt_framework) { |
| 148 |
#add framework option |
| 149 |
##contains(TEMPLATE, app)|contains(CONFIG,plugin):LIBS+=-F$$OUTPUT_DIR/lib |
| 150 |
LIBS+=-F$$OUTPUT_DIR/lib |
| 151 |
} |
| 152 |
LIBS += -L$$OUTPUT_DIR/lib |
| 153 |
|
| 154 |
# For symbian, we are not freezing yet |
| 155 |
#symbian:MMP_RULES += "EXPORTUNFROZEN" |
| 156 |
|
| 157 |
DEPENDPATH += . $$SOURCE_DIR |
| 158 |
INCLUDEPATH += $$SOURCE_DIR/src/global |