1
######################################################################
2
#
3
# Mobility API project - common QMake settings
4
#
5
######################################################################
6
7
include($$PWD/features/utils.pri)
8
9
CONFIG(debug, debug|release) {
10
    WAS_IN_DEBUG=debug
11
} else {
12
    WAS_IN_DEBUG=release
13
}
14
15
include(staticconfig.pri)
16
17
symbian:contains(symbian_symbols_unfrozen,1) {
18
    #see configure.bat for details
19
    MMP_RULES+="EXPORTUNFROZEN"
20
}
21
22
mac {
23
    contains(QT_CONFIG, qt_framework):contains(TEMPLATE, lib) {
24
        #MacOSX always builds debug and release libs when using mac framework
25
        CONFIG+=$$WAS_IN_DEBUG
26
        CONFIG += debug_and_release build_all
27
    } else {
28
        !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) {
29
            CONFIG -= debug_and_release debug release
30
            contains(QT_CONFIG,debug): CONFIG+=debug
31
            contains(QT_CONFIG,release): CONFIG+=release
32
        }
33
    }
34
}
35
36
#In Windows we want to build libraries in debug and release mode if the user
37
#didn't select a version - if Qt is build in debug_and_release
38
#this avoids problems for third party as qmake build debug by default
39
#If mobility selected debug_and_release but Qt only supports
40
#one version but not the other we silently disable the impossible combination
41
win32:contains(CONFIG_WIN32,build_all) {
42
    contains(QT_CONFIG,debug):contains(QT_CONFIG,release) {
43
        contains(TEMPLATE,.*lib) {
44
            CONFIG += $$WAS_IN_DEBUG
45
            CONFIG += debug_and_release build_all
46
        }
47
    } else {
48
        CONFIG -= debug_and_release debug release
49
        contains(QT_CONFIG,debug): CONFIG+=debug
50
        contains(QT_CONFIG,release): CONFIG+=release
51
    }
52
}
53
54
# Make sure this goes everywhere we need it
55
symbian: load(data_caging_paths)
56
57
58
# Figure out the root of where stuff should go (this could be done via configure)
59
OUTPUT_DIR = $$QT_MOBILITY_BUILD_TREE
60
SOURCE_DIR = $$PWD
61
62
CONFIG(debug, debug|release) {
63
    SUBDIRPART=Debug
64
} else {
65
    SUBDIRPART=Release
66
}
67
68
contains(QT_CONFIG, reduce_exports):CONFIG+=hide_symbols
69
70
#export more symbols if we build the unit tests
71
contains(build_unit_tests, yes) {
72
    DEFINES+=QTM_BUILD_UNITTESTS
73
} else {
74
    contains(build_public_unit_tests,yes):DEFINES+=QTM_BUILD_PUBLIC_UNITTESTS
75
}
76
77
78
#test whether we have a unit test
79
!testcase:!testhelper {
80
    OBJECTS_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET
81
    !plugin {
82
        contains(TEMPLATE,.*lib) {
83
            DESTDIR = $$OUTPUT_DIR/lib
84
            symbian:defFilePath=../s60installs
85
            symbian:DEF_FILE=../s60installs
86
            VERSION = 1.2.2
87
        } else {
88
            DESTDIR = $$OUTPUT_DIR/bin
89
        }
90
    } else {
91
        testplugin {
92
            DESTDIR = $$OUTPUT_DIR/build/tests/bin/plugins/$$PLUGIN_TYPE 
93
        } else {
94
            symbian:VERSION = 1.2.2
95
            #check that plugin_type is set or warn otherwise
96
            isEmpty(PLUGIN_TYPE) {
97
                message(PLUGIN_TYPE not specified - install rule may not work)
98
            } else {
99
                target.path=$${QT_MOBILITY_PLUGINS}/$${PLUGIN_TYPE}
100
                INSTALLS += target
101
            }
102
        }
103
    }
104
105
    MOC_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/moc
106
    RCC_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/rcc
107
    UI_DIR = $$OUTPUT_DIR/build/$$SUBDIRPART/$$TARGET/ui
108
    QMAKE_RPATHDIR += $$QT_MOBILITY_LIB
109
} else {
110
    # Unit test code (no plugins! test plugins are just normal plugins installed elsewhere)
111
    testcase:QT *= testlib
112
    CONFIG += console
113
    CONFIG -= app_bundle
114
    OBJECTS_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET
115
    DESTDIR = $$OUTPUT_DIR/build/tests/bin
116
    MOC_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/moc
117
    RCC_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/rcc
118
    UI_DIR = $$OUTPUT_DIR/build/tests/$$SUBDIRPART/$$TARGET/ui
119
    QMAKE_RPATHDIR += $$OUTPUT_DIR/lib
120
}
121
122
contains(TEMPLATE,.*lib):DEFINES += QT_SHARED
123
124
maemo6|meego {
125
    maemo6:DEFINES+= Q_WS_MAEMO_6
126
    meego:DEFINES+= Q_WS_MEEGO
127
    contains(TEMPLATE,.*app.*): QMAKE_LIB_FLAGS+= -Wl,-rpath-link $$[QT_INSTALL_LIBS]
128
    QMAKE_LIB_FLAGS+= -Wl,-rpath-link $$[QT_INSTALL_LIBS]
129
    QMAKE_RPATHDIR += $$[QT_INSTALL_LIBS]
130
}
131
maemo5 {
132
    DEFINES+= Q_WS_MAEMO_5
133
}
134
meego {
135
    DEFINES+= Q_WS_MEEGO
136
}
137
138
wince* {
139
    ### Bearer Management
140
    BEARERLIB.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtBearer).dll
141
    BEARERLIB.path = .
142
    DEPLOYMENT += BEARERLIB
143
144
    ### Contacts
145
    # Main library
146
    CONTACTS_DEPLOYMENT.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtContacts).dll
147
    CONTACTS_DEPLOYMENT.path = /Windows
148
149
    # Plugins
150
    CONTACTS_PLUGINS_DEPLOYMENT.sources = $$OUTPUT_DIR/plugins/contacts/*.dll
151
    CONTACTS_PLUGINS_DEPLOYMENT.path = plugins/contacts
152
    DEPLOYMENT += CONTACTS_DEPLOYMENT CONTACTS_PLUGINS_DEPLOYMENT
153
154
    ### Service Framework    
155
    SFW_DEPLOYMENT.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtServiceFramework).dll
156
    SFW_DEPLOYMENT.path = .
157
    DEPLOYMENT += SFW_DEPLOYMENT
158
    
159
    ### Location
160
    LOCATION.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtLocation).dll
161
    LOCATION.path = .
162
    DEPLOYMENT += LOCATION
163
164
    ### Landmarks
165
    LANDMARKS.sources = $$OUTPUT_DIR/lib/$$mobilityDeployFilename(QtLandmarks).dll
166
    LANDMARKS.path = .
167
    DEPLOYMENT += LANDMARKS
168
}
169
170
symbian {
171
    #For some reason the default include path doesn't include MOC_DIR on symbian
172
    INCLUDEPATH += $$MOC_DIR
173
    
174
    #This is supposed to be defined in symbian_os.hrh
175
    #DEFINES += SYMBIAN_EMULATOR_SUPPORTS_PERPROCESS_WSD
176
}
177
178
# Add the output dirs to the front of the link path.
179
# They must be at the front in case some previous Mobility version is already
180
# installed on the system.
181
# Note that we must use QMAKE_LIBDIR/QMAKE_FRAMEWORKPATH for this, and not
182
# LIBS, because Qt will prepend the Qt library path to LIBS elsewhere.
183
mac:contains(QT_CONFIG,qt_framework) {
184
    #add framework option
185
    QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib
186
}
187
QMAKE_LIBDIR += $$OUTPUT_DIR/lib
188
189
linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
190
191
DEPENDPATH += . $$SOURCE_DIR
192
INCLUDEPATH += $$SOURCE_DIR/src/global
193
194
!symbian:!wince*:DEFINES += QTM_PLUGIN_PATH=\\\"$$replace(QT_MOBILITY_PLUGINS, \\\\, /)\\\"