diff options
author | Laszlo Papp <lpapp@kde.org> | 2012-04-04 01:09:13 +0300 |
---|---|---|
committer | Denis Shienkov <scapig@yandex.ru> | 2012-04-04 08:46:39 +0200 |
commit | 537c8db46aa8b521c82285c8d4d6ad48f2e1a626 (patch) | |
tree | 738cbdb1eef01cb938c9418d5eb1ce9aecc0ce8f | |
parent | 5b1c20b1b74d1aba5642f632745ce24dadc2e131 (diff) | |
download | qtserialport-537c8db46aa8b521c82285c8d4d6ad48f2e1a626.tar.gz |
Make the .pri/.pro files compatible with Qt4
There were some warnings previously due to the relevant lines inside the .pro
and .pri files:
WARNING: foobar/qtserialport/src/src.pro:10: Unable to find
file for inclusion qt_module
WARNING: foobar/qtserialport/src/src.pro:11: Unable to find
file for inclusion qt_module_config
Project MESSAGE: Warning: unknown QT: core-private
WARNING: Failure to find: qtaddonserialportversion.h
These warnings are caused by statements that are only available in Qt5. Hence,
all these are now being properly adressed according to the transition wikipage
that you can find here:
http://wiki.qt-project.org/Transition_from_Qt_4.x_to_Qt5
One additional thing that had to be done in case Qt4, is to include qtserialport
module .pri file in order to get the relevant variables filled in, and therefore
usable inside the src.pro file. Otherwise those variables do not consist of the
expected values since they are not initialized before the relevant project file.
You can find some details about that in here:
http://wiki.qt-project.org/Creating_a_new_module_or_tool_for_Qt#Library_specific_.pro_files
Change-Id: Ie43a583bc11226bbd86132433c6b7a378032d80b
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <scapig@yandex.ru>
-rw-r--r-- | src/src-lib.pri | 4 | ||||
-rw-r--r-- | src/src.pro | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/src-lib.pri b/src/src-lib.pri index 36ee3ae..352680c 100644 --- a/src/src-lib.pri +++ b/src/src-lib.pri @@ -2,7 +2,9 @@ INCLUDEPATH += $$PWD linux*:DEFINES += HAVE_LIBUDEV -HEADERS += qtaddonserialportversion.h +greaterThan(QT_MAJOR_VERSION, 4) { + HEADERS += qtaddonserialportversion.h +} PUBLIC_HEADERS += \ $$PWD/serialport-global.h \ diff --git a/src/src.pro b/src/src.pro index 8e33097..ec5551e 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,16 +1,19 @@ +greaterThan(QT_MAJOR_VERSION, 4) { + load(qt_module) + load(qt_module_config) + QT += core-private +} else { + include($$PWD/../modules/qt_serialport.pri) +} + TEMPLATE = lib TARGET = $$QT.serialport.name MODULE = serialport -load(qt_module) -load(qt_module_config) - DESTDIR = $$QT.serialport.libs VERSION = $$QT.serialport.VERSION DEFINES += QT_ADDON_SERIALPORT_LIB -QT += core-private - CONFIG += module create_prl MODULE_PRI = ../modules/qt_serialport.pri @@ -18,3 +21,4 @@ include($$PWD/src-lib.pri) mac:QMAKE_FRAMEWORK_BUNDLE_NAME = $$QT.serialport.name + |