summaryrefslogtreecommitdiffstats
path: root/src/systeminfo/systeminfo.pro
blob: aa5664d20f9c3182bec0493026d0b07678865660 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
TEMPLATE = lib
TARGET = QtSystemInfo
QT += network gui

include(../../common.pri)

# Input
PUBLIC_HEADERS += \
    qsysteminfo.h \
    qsystemgeneralinfo.h \
    qsystemdeviceinfo.h \
    qsystemdisplayinfo.h \
    qsystemnetworkinfo.h \
    qsystemscreensaver.h \
    qsystemstorageinfo.h  \
    qsystembatteryinfo.h \
    qsystemalignedtimer.h

SOURCES += \
    qsystemgeneralinfo.cpp \
    qsystemdeviceinfo.cpp \
    qsystemdisplayinfo.cpp \
    qsystemnetworkinfo.cpp \
    qsystemscreensaver.cpp \
    qsystemstorageinfo.cpp \
    qsystembatteryinfo.cpp \
    qsystemalignedtimer.cpp

PRIVATE_HEADERS += qsysteminfocommon_p.h

DEFINES += QT_BUILD_SYSINFO_LIB QT_MAKEDLL

simulator {
    SOURCES += qsystemalignedtimer_stub.cpp
    HEADERS += qsystemalignedtimer_stub_p.h
}

win32:!simulator {
    contains(CONFIG,release) {
       CONFIG -= console
    }

    SOURCES += qsysteminfo_win.cpp qsystemalignedtimer_stub.cpp
    HEADERS += qsysteminfo_win_p.h qsystemalignedtimer_stub_p.h

    win32-msvc*: {
        SOURCES += windows/qwmihelper_win.cpp
        HEADERS += windows/qwmihelper_win_p.h

        LIBS += \
            -lOle32 \
            -lUser32 \
            -lGdi32 \
            -lIphlpapi \
            -lOleaut32 \
            -lDxva2 \
            -lPowrProf \
            -lSetupapi

    }

    win32-g++: {
        LIBS += -luser32 -lgdi32
    }

    wince*: {
        LIBS += \
            -Laygshell \
            -lcellcore \
            -lCoredll
    }
}

unix:!simulator {
    QT += gui
    PRIVATE_HEADERS += linux/qsysteminfo_dbus_p.h

    maemo5|maemo6|linux-*: {
        contains(bluez_enabled, yes): DEFINES += BLUEZ_SUPPORTED

        SOURCES += linux/qsysteminfo_linux_common.cpp
        HEADERS += linux/qsysteminfo_linux_common_p.h

        contains(blkid_enabled, yes): {
            DEFINES += BLKID_SUPPORTED
            LIBS += -lblkid
        }

        !embedded:!contains(QT_CONFIG,qpa): {
            LIBS += -lX11 -lXrandr
        }

        # alignedtimer on Linux/MeeGo
        contains(iphb_enabled, yes): {
            SOURCES += qsystemalignedtimer_meego.cpp
            HEADERS += qsystemalignedtimer_meego_p.h
            PKGCONFIG += libiphb
            DEFINES += ALIGNEDTIMER_MEEGO
            LIBS += -liphb
        } else {
            SOURCES += qsystemalignedtimer_stub.cpp
            HEADERS += qsystemalignedtimer_stub_p.h
        }
    }

    !maemo5:!maemo6:linux-*: {
        SOURCES += linux/qsysteminfo_linux.cpp
        HEADERS += linux/qsysteminfo_linux_p.h
        contains(QT_CONFIG, dbus): {
            QT += dbus
            SOURCES += \
                linux/qhalservice_linux.cpp \
                linux/qsysteminfodbushelper.cpp \
                linux/qdevicekitservice_linux.cpp

            HEADERS += \
                linux/qhalservice_linux_p.h \
                linux/qsysteminfodbushelper_p.h \
                linux/qdevicekitservice_linux_p.h \
                linux/qsysteminfo_dbus_p.h

            # udev should not be enabled on maemo5 and maemo6
            contains(udev_enabled, yes): {
                DEFINES += UDEV_SUPPORTED
                LIBS += -ludev
                SOURCES += linux/qudevservice_linux.cpp
                HEADERS += linux/qudevservice_linux_p.h
            }

            contains(networkmanager_enabled, yes): {
                SOURCES += linux/qnetworkmanagerservice_linux.cpp linux/qnmdbushelper.cpp
                HEADERS += linux/qnetworkmanagerservice_linux_p.h linux/qnmdbushelper_p.h
            } else {
                DEFINES += QT_NO_NETWORKMANAGER
            }

            contains(CONFIG,meego): {
                #for now... udisks
            } else {
                DEFINES += QT_NO_UDISKS
                !embedded:!contains(QT_CONFIG,qpa): LIBS += -lX11 -lXrandr
            }

            contains(connman_enabled, yes): {
                SOURCES+= linux/qconnmanservice_linux.cpp linux/qofonoservice_linux.cpp
                HEADERS+= linux/qconnmanservice_linux_p.h linux/qofonoservice_linux_p.h
            } else {
                DEFINES += QT_NO_CONNMAN
            }
        } else {
            DEFINES += QT_NO_NETWORKMANAGER QT_NO_UDISKS QT_NO_CONNMAN
            !embedded:!contains(QT_CONFIG,qpa): LIBS += -lX11 -lXrandr
        }
    }

    maemo5|maemo6: {
        #Qt GConf wrapper added here until a proper place is found for it.
        CONFIG += link_pkgconfig
        SOURCES += qsysteminfo_maemo.cpp linux/gconfitem.cpp
        HEADERS += qsysteminfo_maemo_p.h linux/gconfitem_p.h
        DEFINES += QT_NO_CONNMAN QT_NO_UDISKS  QT_NO_NETWORKMANAGER

        contains(QT_CONFIG,dbus): {
            QT += dbus
            SOURCES += linux/qhalservice_linux.cpp
            HEADERS += linux/qhalservice_linux_p.h
        }

        PKGCONFIG += glib-2.0 gconf-2.0
        CONFIG += create_pc create_prl
        QMAKE_PKGCONFIG_REQUIRES = glib-2.0 gconf-2.0
        pkgconfig.path = $$QT_MOBILITY_LIB/pkgconfig
        pkgconfig.files = QtSystemInfo.pc
    }

    mac: {
        SOURCES += qsysteminfo_mac.mm qsystemalignedtimer_stub.cpp
        HEADERS += qsysteminfo_mac_p.h qsystemalignedtimer_stub_p.h
        LIBS += -framework SystemConfiguration -framework CoreFoundation \
            -framework IOKit -framework ApplicationServices -framework Foundation \
            -framework CoreServices -framework ScreenSaver -framework QTKit \
            -framework DiskArbitration -framework IOBluetooth

        contains(corewlan_enabled, yes) {
            isEmpty(QMAKE_MAC_SDK) {
                SDK6="yes"
            } else {
                contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") {
                    SDK6="yes"
                }
            }

            !isEmpty(SDK6) {
                LIBS += -framework CoreWLAN  -framework CoreLocation
                DEFINES += MAC_SDK_10_6
            }
        } else {
            CONFIG += no_keywords
        }

        TEMPLATE = lib
    }

    symbian: {
        contains(S60_VERSION, 3.1) {
            DEFINES += SYMBIAN_3_1
        }

        contains(S60_VERSION, 5.2) {
            DEFINES += SYMBIAN_3_PLATFORM
        }

        contains(LockandFlipPSkeys_enabled, yes) {
            message("LockandFlipPSKeys available")
            DEFINES += LOCKANDFLIP_SUPPORTED
            SOURCES += lockandflipstatus_s60.cpp
            HEADERS += lockandflipstatus_s60.h
        }

        contains(FmTxClient_enabled, yes) {
            message("FmTxClient available")
            DEFINES += FMTXCLIENT_SUPPORTED
            LIBS += -lhwrmfmtxclient
        }

        contains(DiskNotifyClient_tenabled, yes) {
            message("DiskNotiferClient available")
            DEFINES += DISKNOTIFY_SUPPORTED
            LIBS += -ldisknotifyhandler
            SOURCES += storagedisknotifier_s60.cpp
            HEADERS += storagedisknotifier_s60.h
        }

        contains(hb_symbian_enabled, yes) {
            ## for symbian ^4
            CONFIG += qt hb
            DEFINES += HB_SUPPORTED
            message("s60_HbKeymap enabled")
            LIBS += -lhbcore
        } else {
            LIBS += -lptiengine
        }

        contains(symbianflextimer_tenabled, yes) { #disabled until test crash is fixed
            message("SymbianFlexTimer enabled")
            SOURCES += qsystemalignedtimer_symbian.cpp heartbeattimer_s60.cpp
            HEADERS += qsystemalignedtimer_symbian_p.h heartbeattimer_s60.h
            DEFINES += ALIGNEDTIMER_SYMBIAN
            LIBS += -lflextimerclient
        } else {
            SOURCES += qsystemalignedtimer_stub.cpp
            HEADERS += qsystemalignedtimer_stub_p.h
        }

        INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
        DEPENDPATH += symbian

        SOURCES += \
            qsysteminfo_s60.cpp \
            telephonyinfo_s60.cpp \
            chargingstatus_s60.cpp \
            wlaninfo_s60.cpp \
            storagestatus_s60.cpp \
            pubandsubkey_s60.cpp \
            batterystatus_s60.cpp \
            networkinfo_s60.cpp

        HEADERS += \
            qsysteminfo_s60_p.h \
            telephonyinfo_s60.h \
            chargingstatus_s60.h \
            wlaninfo_s60.h \
            storagestatus_s60.h \
            pubandsubkey_s60.h \
            batterystatus_s60.h \
            networkinfo_s60.h

        LIBS += \
            -lprofileengine \
            -letel3rdparty \
            -lsysutil \
            -lcentralrepository \
            -lcenrepnotifhandler \
            -lefsrv \
            -lfeatdiscovery \
            -lhwrmvibraclient \
            -lavkon \    #Used by AknLayoutUtils::PenEnabled(). Try to remove this dependency.
            -lcone \
            -lws32 \
            -lcentralrepository \
            -lbluetooth \
            -lgdi \
            -lecom \
            -lplatformenv \
            -lhwrmlightclient \
            -letel

        contains(S60_VERSION, 5.1) | contains(S60_VERSION, 5.2) {
            LIBS += -lhwrmpowerclient -lusbman
        }

        contains(symbiancntsim_enabled, yes) {
            LIBS += -letelmm
            DEFINES += ETELMM_SUPPORTED
            message("ETELMM enabled")
        }

        contains(thermalstatus_symbian_enabled, yes) {
            DEFINES += THERMALSTATUS_SUPPORTED
            SOURCES += thermalstatus_s60.cpp
            HEADERS += thermalstatus_s60.h
            message("Thermalstatus enabled")
        }

        TARGET.CAPABILITY = ALL -TCB
#        TARGET.CAPABILITY = LocalServices NetworkServices ReadUserData UserEnvironment Location ReadDeviceData TrustedUI

        TARGET.EPOCALLOWDLLDATA = 1
        TARGET.UID3 = 0x2002ac7d

        QtSystemInfoDeployment.sources = QtSystemInfo.dll
        QtSystemInfoDeployment.path = /sys/bin
        DEPLOYMENT += QtSystemInfoDeployment
    }
}

simulator {
    SOURCES += qsysteminfo_simulator.cpp qsysteminfodata_simulator.cpp
    HEADERS += qsysteminfo_simulator_p.h qsysteminfodata_simulator_p.h
    INCLUDEPATH += ../mobilitysimulator
    qtAddLibrary(QtMobilitySimulator)
}

HEADERS += $$PUBLIC_HEADERS
CONFIG += middleware
include (../../features/deploy.pri)