diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2012-11-01 21:23:04 +0400 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2012-11-05 13:57:20 +0100 |
commit | db46db74eb0b1afb6a2ff34712b419e20a17f49a (patch) | |
tree | 5756528ef5d7ad6538d997e5d1900d50d288fe6e | |
parent | eca1a6d30a98861cb811cb2faf8d01334e60dd7c (diff) | |
download | qtserialport-db46db74eb0b1afb6a2ff34712b419e20a17f49a.tar.gz |
Updating a project tree for compilation fixing
For optimization and build correction for Qt4/Qt5 there was a need for
unification and modification of a tree of projects.
The previous structure of the project didn't meet the changed requirements
for Qt5 that led to errors of build and complication of possibility of
correction of errors of build.
It is necessary to note the main changes:
* Removed not used /modules direcrory with all content, because it is
autogenerated.
* Moved all contents from /src directory to /src/serialport directory. It
was necessary for simplification of the qmake commands at building
for Qt5 (in particular, there is no need to fill out a module name since
it is the name of directory /serialport).
* Changed the exported macro defines Q_ADDON_SERIALPORT_EXPORT to
Q_SERIALPORT_EXPORT and QT_ADDON_SERIALPORT_LIB to QT_SERIALPORT_LIB. It
was necessary for fixing compilation error for unknown reason on Windows
and Qt5 when used MSVC compiler.
Checked on Windows and Gnu/Linux, also this patch fixes bug:
Task-number: QTPLAYGROUND-5
Change-Id: Idc9ba98115d5961a22ae307c0e4034a56f3223b5
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r-- | examples/cenumerator/cenumerator.pro | 2 | ||||
-rw-r--r-- | examples/enumerator/enumerator.pro | 2 | ||||
-rw-r--r-- | examples/terminal/terminal.pro | 2 | ||||
-rw-r--r-- | modules/qt_serialport.pri | 16 | ||||
-rw-r--r-- | qtserialport.pro (renamed from serialport.pro) | 9 | ||||
-rw-r--r-- | src/qt4support/serialport.pri | 14 | ||||
-rw-r--r-- | src/serialport/qt4support/install-helper.pri (renamed from src/qt4support/install-helper.pri) | 2 | ||||
-rw-r--r-- | src/serialport/qt4support/qringbuffer_p.h (renamed from src/qt4support/qringbuffer_p.h) | 0 | ||||
-rw-r--r-- | src/serialport/qt4support/qwineventnotifier_p.h (renamed from src/qt4support/qwineventnotifier_p.h) | 0 | ||||
-rw-r--r-- | src/serialport/qt4support/serialport.prf (renamed from src/qt4support/serialport.prf) | 2 | ||||
-rw-r--r-- | src/serialport/serialport-global.h (renamed from src/serialport-global.h) | 6 | ||||
-rw-r--r-- | src/serialport/serialport-lib.pri (renamed from src/src-lib.pri) | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | src/serialport/serialport.cpp (renamed from src/serialport.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/serialport.h (renamed from src/serialport.h) | 2 | ||||
-rw-r--r-- | src/serialport/serialport.pro | 18 | ||||
-rw-r--r--[-rwxr-xr-x] | src/serialport/serialport_p.h (renamed from src/serialport_p.h) | 0 | ||||
-rw-r--r-- | src/serialport/serialport_symbian.cpp (renamed from src/serialport_symbian.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/serialport_symbian_p.h (renamed from src/serialport_symbian_p.h) | 0 | ||||
-rw-r--r-- | src/serialport/serialport_unix.cpp (renamed from src/serialport_unix.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/serialport_unix_p.h (renamed from src/serialport_unix_p.h) | 0 | ||||
-rw-r--r-- | src/serialport/serialport_win.cpp (renamed from src/serialport_win.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/serialport_win_p.h (renamed from src/serialport_win_p.h) | 0 | ||||
-rw-r--r-- | src/serialport/serialport_wince.cpp (renamed from src/serialport_wince.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/serialportinfo.cpp (renamed from src/serialportinfo.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/serialportinfo.h (renamed from src/serialportinfo.h) | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | src/serialport/serialportinfo_mac.cpp (renamed from src/serialportinfo_mac.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/serialportinfo_p.h (renamed from src/serialportinfo_p.h) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/serialport/serialportinfo_symbian.cpp (renamed from src/serialportinfo_symbian.cpp) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/serialport/serialportinfo_unix.cpp (renamed from src/serialportinfo_unix.cpp) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/serialport/serialportinfo_win.cpp (renamed from src/serialportinfo_win.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/serialportinfo_wince.cpp (renamed from src/serialportinfo_wince.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/ttylocker_unix.cpp (renamed from src/ttylocker_unix.cpp) | 0 | ||||
-rw-r--r-- | src/serialport/ttylocker_unix_p.h (renamed from src/ttylocker_unix_p.h) | 0 | ||||
-rw-r--r-- | src/src.pro | 28 | ||||
-rw-r--r-- | sync.profile | 19 | ||||
-rw-r--r-- | tests/manual/serialport/serialport.pro | 2 | ||||
-rw-r--r-- | tests/manual/serialportinfo/serialportinfo.pro | 2 |
37 files changed, 46 insertions, 86 deletions
diff --git a/examples/cenumerator/cenumerator.pro b/examples/cenumerator/cenumerator.pro index 3a77a70..3e20020 100644 --- a/examples/cenumerator/cenumerator.pro +++ b/examples/cenumerator/cenumerator.pro @@ -1,7 +1,7 @@ greaterThan(QT_MAJOR_VERSION, 4) { QT += core serialport } else { - include($$SERIALPORT_PROJECT_ROOT/src/qt4support/serialport.prf) + include($$SERIALPORT_PROJECT_ROOT/src/serialport/qt4support/serialport.prf) } TARGET = cenumerator diff --git a/examples/enumerator/enumerator.pro b/examples/enumerator/enumerator.pro index 92ecb5e..e66ee9e 100644 --- a/examples/enumerator/enumerator.pro +++ b/examples/enumerator/enumerator.pro @@ -1,7 +1,7 @@ greaterThan(QT_MAJOR_VERSION, 4) { QT += widgets serialport } else { - include($$SERIALPORT_PROJECT_ROOT/src/qt4support/serialport.prf) + include($$SERIALPORT_PROJECT_ROOT/src/serialport/qt4support/serialport.prf) } TARGET = enumerator diff --git a/examples/terminal/terminal.pro b/examples/terminal/terminal.pro index 81cc90f..3cdfa22 100644 --- a/examples/terminal/terminal.pro +++ b/examples/terminal/terminal.pro @@ -1,7 +1,7 @@ greaterThan(QT_MAJOR_VERSION, 4) { QT += widgets serialport } else { - include($$SERIALPORT_PROJECT_ROOT/src/qt4support/serialport.prf) + include($$SERIALPORT_PROJECT_ROOT/src/serialport/qt4support/serialport.prf) } TARGET = terminal diff --git a/modules/qt_serialport.pri b/modules/qt_serialport.pri deleted file mode 100644 index a3dcd8f..0000000 --- a/modules/qt_serialport.pri +++ /dev/null @@ -1,16 +0,0 @@ -QT.serialport.VERSION = 1.0.0 -QT.serialport.MAJOR_VERSION = 1 -QT.serialport.MINOR_VERSION = 0 -QT.serialport.PATCH_VERSION = 0 - -QT.serialport.name = QtAddOnSerialPort -QT.serialport.bins = $$QT_MODULE_BIN_BASE -QT.serialport.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/$$QT.serialport.name -QT.serialport.private_includes = $$QT_MODULE_INCLUDE_BASE/$$QT.serialport.name/$$QT.serialport.VERSION -QT.serialport.sources = $$QT_MODULE_BASE/src -QT.serialport.libs = $$QT_MODULE_LIB_BASE -QT.serialport.plugins = $$QT_MODULE_PLUGIN_BASE -QT.serialport.imports = $$QT_MODULE_IMPORT_BASE -QT.serialport.depends = core core-private - -QT_CONFIG += serialport diff --git a/serialport.pro b/qtserialport.pro index d0512bf..2d03c94 100644 --- a/serialport.pro +++ b/qtserialport.pro @@ -1,11 +1,14 @@ -TEMPLATE = subdirs -SUBDIRS = src examples tests -CONFIG += ordered include(doc/doc.pri) lessThan(QT_MAJOR_VERSION, 5) { + TEMPLATE = subdirs + SUBDIRS = src examples tests + CONFIG += ordered + !infile($$OUT_PWD/.qmake.cache, SERIALPORT_PROJECT_ROOT) { system("echo SERIALPORT_PROJECT_ROOT = $$PWD >> $$OUT_PWD/.qmake.cache") system("echo SERIALPORT_BUILD_ROOT = $$OUT_PWD >> $$OUT_PWD/.qmake.cache") } +} else { + load(qt_parts) } diff --git a/src/qt4support/serialport.pri b/src/qt4support/serialport.pri deleted file mode 100644 index 06c66a1..0000000 --- a/src/qt4support/serialport.pri +++ /dev/null @@ -1,14 +0,0 @@ -QT.serialport.VERSION = 1.0.0 -QT.serialport.MAJOR_VERSION = 1 -QT.serialport.MINOR_VERSION = 0 -QT.serialport.PATCH_VERSION = 0 - -QT.serialport.name = SerialPort -QT.serialport.bins = $$QT_MODULE_BIN_BASE -QT.serialport.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtAddOnSerialPort -QT.serialport.private_includes = $$QT_MODULE_INCLUDE_BASE/$$QT.serialport.name/$$QT.serialport.VERSION -QT.serialport.sources = $$QT_MODULE_BASE/src -QT.serialport.libs = $$QT_MODULE_LIB_BASE -QT.serialport.plugins = $$QT_MODULE_PLUGIN_BASE -QT.serialport.imports = $$QT_MODULE_IMPORT_BASE -QT.serialport.depends = core diff --git a/src/qt4support/install-helper.pri b/src/serialport/qt4support/install-helper.pri index 657299f..657dbd6 100644 --- a/src/qt4support/install-helper.pri +++ b/src/serialport/qt4support/install-helper.pri @@ -12,7 +12,7 @@ target_headers.files = $$PUBLIC_HEADERS target_headers.path = $$[QT_INSTALL_PREFIX]/include/QtAddOnSerialPort INSTALLS += target_headers -mkspecs_features.files = $$SERIALPORT_PROJECT_ROOT/src/qt4support/serialport.prf +mkspecs_features.files = $$SERIALPORT_PROJECT_ROOT/src/serialport/qt4support/serialport.prf mkspecs_features.path = $$[QT_INSTALL_DATA]/mkspecs/features INSTALLS += mkspecs_features diff --git a/src/qt4support/qringbuffer_p.h b/src/serialport/qt4support/qringbuffer_p.h index 65eb8d7..65eb8d7 100644 --- a/src/qt4support/qringbuffer_p.h +++ b/src/serialport/qt4support/qringbuffer_p.h diff --git a/src/qt4support/qwineventnotifier_p.h b/src/serialport/qt4support/qwineventnotifier_p.h index a87994d..a87994d 100644 --- a/src/qt4support/qwineventnotifier_p.h +++ b/src/serialport/qt4support/qwineventnotifier_p.h diff --git a/src/qt4support/serialport.prf b/src/serialport/qt4support/serialport.prf index 5f9e030..489acb5 100644 --- a/src/qt4support/serialport.prf +++ b/src/serialport/qt4support/serialport.prf @@ -1,7 +1,7 @@ !exists($$[QT_INSTALL_HEADERS]/QtAddOnSerialPort) { INCLUDEPATH += $$SERIALPORT_BUILD_ROOT/include $$SERIALPORT_BUILD_ROOT/include/QtAddOnSerialPort - SERIALPORT_BUILD_SUBDIR = src + SERIALPORT_BUILD_SUBDIR = src/serialport win32 { CONFIG(debug, debug|release) { SERIALPORT_BUILD_SUBDIR = $$SERIALPORT_BUILD_SUBDIR/debug diff --git a/src/serialport-global.h b/src/serialport/serialport-global.h index 786ce99..d0f7680 100644 --- a/src/serialport-global.h +++ b/src/serialport/serialport-global.h @@ -44,10 +44,10 @@ #include "qglobal.h" -#if defined(QT_ADDON_SERIALPORT_LIB) -# define Q_ADDON_SERIALPORT_EXPORT Q_DECL_EXPORT +#if defined(QT_SERIALPORT_LIB) +# define Q_SERIALPORT_EXPORT Q_DECL_EXPORT #else -# define Q_ADDON_SERIALPORT_EXPORT Q_DECL_IMPORT +# define Q_SERIALPORT_EXPORT Q_DECL_IMPORT #endif #if defined(QT_NAMESPACE) diff --git a/src/src-lib.pri b/src/serialport/serialport-lib.pri index 6363cbb..3d946c1 100644 --- a/src/src-lib.pri +++ b/src/serialport/serialport-lib.pri @@ -2,10 +2,6 @@ INCLUDEPATH += $$PWD linux*:DEFINES += HAVE_LIBUDEV -greaterThan(QT_MAJOR_VERSION, 4) { - HEADERS += qtaddonserialportversion.h -} - PUBLIC_HEADERS += \ $$PWD/serialport-global.h \ $$PWD/serialport.h \ diff --git a/src/serialport.cpp b/src/serialport/serialport.cpp index 178a835..178a835 100755..100644 --- a/src/serialport.cpp +++ b/src/serialport/serialport.cpp diff --git a/src/serialport.h b/src/serialport/serialport.h index 184d88e..769ecfb 100644 --- a/src/serialport.h +++ b/src/serialport/serialport.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE_SERIALPORT class SerialPortInfo; class SerialPortPrivate; -class Q_ADDON_SERIALPORT_EXPORT SerialPort : public QIODevice +class Q_SERIALPORT_EXPORT SerialPort : public QIODevice { Q_OBJECT diff --git a/src/serialport/serialport.pro b/src/serialport/serialport.pro new file mode 100644 index 0000000..5fdec9f --- /dev/null +++ b/src/serialport/serialport.pro @@ -0,0 +1,18 @@ +QT = core +DEFINES += QT_SERIALPORT_LIB +VERSION = 1.0.0 + +include($$PWD/serialport-lib.pri) + +greaterThan(QT_MAJOR_VERSION, 4) { + load(qt_build_config) + QT += core-private + TARGET = QtAddOnSerialPort + load(qt_module) +} else { + TEMPLATE = lib + TARGET = $$qtLibraryTarget(SerialPort$$QT_LIBINFIX) + include($$PWD/qt4support/install-helper.pri) + CONFIG += module create_prl + mac:QMAKE_FRAMEWORK_BUNDLE_NAME = $$TARGET +} diff --git a/src/serialport_p.h b/src/serialport/serialport_p.h index 852e7f5..852e7f5 100755..100644 --- a/src/serialport_p.h +++ b/src/serialport/serialport_p.h diff --git a/src/serialport_symbian.cpp b/src/serialport/serialport_symbian.cpp index c2542fd..c2542fd 100644 --- a/src/serialport_symbian.cpp +++ b/src/serialport/serialport_symbian.cpp diff --git a/src/serialport_symbian_p.h b/src/serialport/serialport_symbian_p.h index 647585c..647585c 100644 --- a/src/serialport_symbian_p.h +++ b/src/serialport/serialport_symbian_p.h diff --git a/src/serialport_unix.cpp b/src/serialport/serialport_unix.cpp index 4bb314b..4bb314b 100644 --- a/src/serialport_unix.cpp +++ b/src/serialport/serialport_unix.cpp diff --git a/src/serialport_unix_p.h b/src/serialport/serialport_unix_p.h index 76a6494..76a6494 100644 --- a/src/serialport_unix_p.h +++ b/src/serialport/serialport_unix_p.h diff --git a/src/serialport_win.cpp b/src/serialport/serialport_win.cpp index af43f79..af43f79 100644 --- a/src/serialport_win.cpp +++ b/src/serialport/serialport_win.cpp diff --git a/src/serialport_win_p.h b/src/serialport/serialport_win_p.h index 171f2cb..171f2cb 100644 --- a/src/serialport_win_p.h +++ b/src/serialport/serialport_win_p.h diff --git a/src/serialport_wince.cpp b/src/serialport/serialport_wince.cpp index 7489747..7489747 100644 --- a/src/serialport_wince.cpp +++ b/src/serialport/serialport_wince.cpp diff --git a/src/serialportinfo.cpp b/src/serialport/serialportinfo.cpp index 82d927a..82d927a 100644 --- a/src/serialportinfo.cpp +++ b/src/serialport/serialportinfo.cpp diff --git a/src/serialportinfo.h b/src/serialport/serialportinfo.h index 2594427..049a468 100644 --- a/src/serialportinfo.h +++ b/src/serialport/serialportinfo.h @@ -54,7 +54,7 @@ class SerialPort; class SerialPortInfoPrivate; class SerialInfoPrivateDeleter; -class Q_ADDON_SERIALPORT_EXPORT SerialPortInfo +class Q_SERIALPORT_EXPORT SerialPortInfo { Q_DECLARE_PRIVATE(SerialPortInfo) public: diff --git a/src/serialportinfo_mac.cpp b/src/serialport/serialportinfo_mac.cpp index 6672a84..6672a84 100755..100644 --- a/src/serialportinfo_mac.cpp +++ b/src/serialport/serialportinfo_mac.cpp diff --git a/src/serialportinfo_p.h b/src/serialport/serialportinfo_p.h index 262efa8..262efa8 100644 --- a/src/serialportinfo_p.h +++ b/src/serialport/serialportinfo_p.h diff --git a/src/serialportinfo_symbian.cpp b/src/serialport/serialportinfo_symbian.cpp index 057c760..057c760 100755..100644 --- a/src/serialportinfo_symbian.cpp +++ b/src/serialport/serialportinfo_symbian.cpp diff --git a/src/serialportinfo_unix.cpp b/src/serialport/serialportinfo_unix.cpp index 2869d44..2869d44 100755..100644 --- a/src/serialportinfo_unix.cpp +++ b/src/serialport/serialportinfo_unix.cpp diff --git a/src/serialportinfo_win.cpp b/src/serialport/serialportinfo_win.cpp index a0e4c73..a0e4c73 100755..100644 --- a/src/serialportinfo_win.cpp +++ b/src/serialport/serialportinfo_win.cpp diff --git a/src/serialportinfo_wince.cpp b/src/serialport/serialportinfo_wince.cpp index 1fbbd86..1fbbd86 100644 --- a/src/serialportinfo_wince.cpp +++ b/src/serialport/serialportinfo_wince.cpp diff --git a/src/ttylocker_unix.cpp b/src/serialport/ttylocker_unix.cpp index 3e36d67..3e36d67 100644 --- a/src/ttylocker_unix.cpp +++ b/src/serialport/ttylocker_unix.cpp diff --git a/src/ttylocker_unix_p.h b/src/serialport/ttylocker_unix_p.h index ed93fb1..ed93fb1 100644 --- a/src/ttylocker_unix_p.h +++ b/src/serialport/ttylocker_unix_p.h diff --git a/src/src.pro b/src/src.pro index 2647b84..1426d64 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,27 +1,3 @@ -TEMPLATE = lib -MODULE = serialport -QT -= gui - -greaterThan(QT_MAJOR_VERSION, 4) { - TARGET = $$QT.serialport.name$$QT_LIBINFIX - load(qt_module) - load(qt_module_config) - QT += core-private - include($$PWD/src-lib.pri) -} else { - include($$PWD/qt4support/serialport.pri) - TARGET = $$qtLibraryTarget($$QT.serialport.name$$QT_LIBINFIX) - include($$PWD/src-lib.pri) - include($$PWD/qt4support/install-helper.pri) -} - -DESTDIR = $$QT.serialport.libs -VERSION = $$QT.serialport.VERSION -DEFINES += QT_ADDON_SERIALPORT_LIB - -CONFIG += module create_prl -MODULE_PRI = ../modules/qt_serialport.pri - -mac:QMAKE_FRAMEWORK_BUNDLE_NAME = $$QT.serialport.name - +TEMPLATE = subdirs +SUBDIRS = serialport diff --git a/sync.profile b/sync.profile index 23b9ac5..43eb9ad 100644 --- a/sync.profile +++ b/sync.profile @@ -1,22 +1,19 @@ -%modules = ( # path to module name map - "QtAddOnSerialPort" => "$basedir/src", +%modules = ( + "QtAddOnSerialPort" => "$basedir/src/serialport", ); -%moduleheaders = ( # restrict the module headers to those found in relative path + +%moduleheaders = ( ); + %classnames = ( - "qtaddonserialportversion.h" => "QtAddOnSerialPortVersion", ); + %mastercontent = ( ); + %modulepris = ( - "QtAddOnSerialPort" => "$basedir/modules/qt_serialport.pri", ); -# Module dependencies. -# Every module that is required to build this module should have one entry. -# Each of the module version specifiers can take one of the following values: -# - A specific Git revision. -# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch) -# + %dependencies = ( "qtbase" => "refs/heads/master", ); diff --git a/tests/manual/serialport/serialport.pro b/tests/manual/serialport/serialport.pro index 3e5e0d2..1126f50 100644 --- a/tests/manual/serialport/serialport.pro +++ b/tests/manual/serialport/serialport.pro @@ -5,7 +5,7 @@ QT = core testlib greaterThan(QT_MAJOR_VERSION, 4) { QT += serialport } else { - include($$SERIALPORT_PROJECT_ROOT/src/qt4support/serialport.prf) + include($$SERIALPORT_PROJECT_ROOT/src/serialport/qt4support/serialport.prf) } SOURCES += tst_serialport.cpp diff --git a/tests/manual/serialportinfo/serialportinfo.pro b/tests/manual/serialportinfo/serialportinfo.pro index 941cfb7..1334472 100644 --- a/tests/manual/serialportinfo/serialportinfo.pro +++ b/tests/manual/serialportinfo/serialportinfo.pro @@ -5,7 +5,7 @@ QT = core testlib greaterThan(QT_MAJOR_VERSION, 4) { QT += serialport } else { - include($$SERIALPORT_PROJECT_ROOT/src/qt4support/serialport.prf) + include($$SERIALPORT_PROJECT_ROOT/src/serialport/qt4support/serialport.prf) } SOURCES += tst_serialportinfo.cpp |