|
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(staticconfig.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) { |
|
84 DESTDIR = $$OUTPUT_DIR/lib |
|
85 symbian:defFilePath=../s60installs |
|
86 } else { |
|
87 DESTDIR = $$OUTPUT_DIR/bin |
|
88 } |
|
89 } else { |
|
90 testplugin:DESTDIR = $$OUTPUT_DIR/build/tests/bin/plugins/$$PLUGIN_TYPE |
|
91 !testplugin:DESTDIR = $$OUTPUT_DIR/plugins/$$PLUGIN_TYPE |
|
92 } |
|
93 |
|
94 MOC_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/moc |
|
95 RCC_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/rcc |
|
96 UI_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/ui |
|
97 QMAKE_RPATHDIR += $$QT_MOBILITY_LIB |
|
98 } else { |
|
99 # Unit test code (no plugins! test plugins are just normal plugins installed elsewhere) |
|
100 QT *= testlib |
|
101 CONFIG += console |
|
102 CONFIG -= app_bundle |
|
103 OBJECTS_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET |
|
104 DESTDIR = $$OUTPUT_DIR/build/tests/bin |
|
105 MOC_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/moc |
|
106 RCC_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/rcc |
|
107 UI_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/ui |
|
108 QMAKE_RPATHDIR += $$OUTPUT_DIR/lib |
|
109 } |
|
110 |
|
111 # On Symbian, we are freezing libraryies only |
|
112 #symbian:!isEmpty(defFilePath) { |
|
113 # MMP_RULES += "EXPORTUNFROZEN" |
|
114 #} |
|
115 |
|
116 contains(TEMPLATE,.*lib):DEFINES += QT_SHARED |
|
117 |
|
118 maemo6 { |
|
119 DEFINES+= Q_WS_MAEMO_6 |
|
120 contains(TEMPLATE,.*app.*): QMAKE_LIB_FLAGS+= -Wl,-rpath-link $$[QT_INSTALL_LIBS] |
|
121 QMAKE_LIB_FLAGS+= -Wl,-rpath-link $$[QT_INSTALL_LIBS] |
|
122 QMAKE_RPATHDIR += $$[QT_INSTALL_LIBS] |
|
123 } |
|
124 maemo5 { |
|
125 DEFINES+= Q_WS_MAEMO_5 |
|
126 } |
|
127 maemo* { |
|
128 LIBS += -L/opt/qt4-maemo5/lib |
|
129 QMAKE_LFLAGS += -Wl,-rpath,/opt/qt4-maemo5/lib |
|
130 } |
|
131 |
|
132 wince* { |
|
133 ### Bearer Management |
|
134 BEARERLIB.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtBearer).dll |
|
135 BEARERLIB.path = . |
|
136 DEPLOYMENT += BEARERLIB |
|
137 |
|
138 ### Contacts |
|
139 # Main library |
|
140 CONTACTS_DEPLOYMENT.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtContacts).dll |
|
141 CONTACTS_DEPLOYMENT.path = /Windows |
|
142 |
|
143 # Plugins |
|
144 CONTACTS_PLUGINS_DEPLOYMENT.sources = $$OUTPUT_DIR/plugins/contacts/*.dll |
|
145 CONTACTS_PLUGINS_DEPLOYMENT.path = plugins/contacts |
|
146 DEPLOYMENT += CONTACTS_DEPLOYMENT CONTACTS_PLUGINS_DEPLOYMENT |
|
147 |
|
148 ### Service Framework |
|
149 SFW_DEPLOYMENT.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtServiceFramework).dll |
|
150 SFW_DEPLOYMENT.path = . |
|
151 DEPLOYMENT += SFW_DEPLOYMENT |
|
152 |
|
153 ### Location |
|
154 LOCATION.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtLocation).dll |
|
155 LOCATION.path = . |
|
156 DEPLOYMENT += LOCATION |
|
157 } |
|
158 |
|
159 symbian { |
|
160 #For some reason the default include path doesn't include MOC_DIR on symbian |
|
161 INCLUDEPATH += $$MOC_DIR |
|
162 } |
|
163 |
|
164 # Add the output dirs to the link path too |
|
165 mac:contains(QT_CONFIG,qt_framework) { |
|
166 #add framework option |
|
167 ##contains(TEMPLATE, app)|contains(CONFIG,plugin):LIBS+=-F$$OUTPUT_DIR/lib |
|
168 LIBS+=-F$$OUTPUT_DIR/lib |
|
169 } |
|
170 LIBS += -L$$OUTPUT_DIR/lib |
|
171 |
|
172 |
|
173 DEPENDPATH += . $$SOURCE_DIR |
|
174 INCLUDEPATH += $$SOURCE_DIR/src/global |
|
175 |