From a579f324d7ea1b389da7302b35834d68594bd340 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Fri, 2 Mar 2018 16:10:07 +0300 Subject: [PATCH 1/6] Install missing stream header --- src/src.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/src/src.pro b/src/src.pro index 6bbf7eb..d71d5bf 100644 --- a/src/src.pro +++ b/src/src.pro @@ -43,6 +43,7 @@ HEADERS_INSTALL = \ msgpackstream.h \ STREAM_HEADERS_INSTALL = \ + stream/geometry.h \ stream/time.h qtHaveModule(location) { From ca968dbb4ee3e44f16423b29bdef77ca80fc805a Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 20 Nov 2018 16:57:27 +0300 Subject: [PATCH 2/6] Make the QtGui module an optional dependency detect and link with it, if found --- qmsgpack.pri | 4 ++++ src/src.pro | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/qmsgpack.pri b/qmsgpack.pri index c0caae2..8ad2460 100644 --- a/qmsgpack.pri +++ b/qmsgpack.pri @@ -26,6 +26,10 @@ HEADERS += \ $$PWD/src/stream/time.h \ $$PWD/src/stream/geometry.h +qtHaveModule(gui) { + QT += gui +} + qtHaveModule(location) { QT += location diff --git a/src/src.pro b/src/src.pro index d71d5bf..d330ca5 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,4 +1,4 @@ -QT += core gui +QT += core TARGET = qmsgpack CONFIG -= app_bundle @@ -46,6 +46,10 @@ STREAM_HEADERS_INSTALL = \ stream/geometry.h \ stream/time.h +qtHaveModule(gui) { + QT += gui +} + qtHaveModule(location) { QT += location From b15b5efdb4c839ea17fdca446c1b332cf3634a95 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 20 Nov 2018 17:16:25 +0300 Subject: [PATCH 3/6] Re-use qmsgpack.pri in library builds Deduplicates the build rules and ensures no differences in source-in and library build rules --- qmsgpack.pri | 2 -- src/src.pro | 32 +------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/qmsgpack.pri b/qmsgpack.pri index 8ad2460..026f721 100644 --- a/qmsgpack.pri +++ b/qmsgpack.pri @@ -1,7 +1,5 @@ QT += core -DEFINES += MSGPACK_MAKE_LIB - INCLUDEPATH += $$PWD/src SOURCES += \ diff --git a/src/src.pro b/src/src.pro index d330ca5..36b056b 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,5 +1,3 @@ -QT += core - TARGET = qmsgpack CONFIG -= app_bundle @@ -13,27 +11,7 @@ CONFIG(debug, debug|release) { TARGET = $$join(TARGET,,,d) } - -SOURCES += msgpack.cpp \ - msgpackcommon.cpp \ - private/pack_p.cpp \ - private/unpack_p.cpp \ - private/qt_types_p.cpp \ - msgpackstream.cpp \ - stream/time.cpp \ - stream/geometry.cpp - -HEADERS += \ - msgpack.h \ - private/pack_p.h \ - private/unpack_p.h \ - endianhelper.h \ - msgpackcommon.h \ - msgpack_export.h \ - private/qt_types_p.h \ - msgpackstream.h \ - stream/time.h \ - stream/geometry.h +include(../qmsgpack.pri) HEADERS_INSTALL = \ msgpack.h \ @@ -46,15 +24,7 @@ STREAM_HEADERS_INSTALL = \ stream/geometry.h \ stream/time.h -qtHaveModule(gui) { - QT += gui -} - qtHaveModule(location) { - QT += location - - SOURCES += stream/location.cpp - HEADERS += stream/location.h STREAM_HEADERS_INSTALL += stream/location.h } From 172c71b0277bd567d72f7be1bc7160cfc90e463b Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 20 Nov 2018 19:58:10 +0300 Subject: [PATCH 4/6] Consolidate target lib name, path and version across platforms and configs --- src/src.pro | 10 ++++++---- tests/tests.pri | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/src.pro b/src/src.pro index 36b056b..3ca344e 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,15 +1,17 @@ TARGET = qmsgpack +VER_MAJ = 0 +VER_MIN = 1 +VER_PAT = 0 CONFIG -= app_bundle TEMPLATE = lib DEFINES += MSGPACK_MAKE_LIB -DESTDIR = $$PWD/../bin +DESTDIR = $$shadowed($$PWD/../bin) QMAKE_CXXFLAGS += -fPIC CONFIG += debug_and_release -CONFIG(debug, debug|release) { - TARGET = $$join(TARGET,,,d) -} +TARGET = $$qtLibraryTarget($$TARGET) +VERSION = $$join($$list($$VER_MAJ $$VER_MIN $$VER_PAT), .) include(../qmsgpack.pri) diff --git a/tests/tests.pri b/tests/tests.pri index 9a83f26..4392d1c 100644 --- a/tests/tests.pri +++ b/tests/tests.pri @@ -1,2 +1,2 @@ INCLUDEPATH += ../../src -LIBS += -L"$$PWD/../bin" -lqmsgpackd +LIBS += -L$$shadowed($$PWD/../bin) -l$$qtLibraryTarget(qmsgpack) From 6455058b4f6f5f7b996df22175c65f408cf48c1d Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 20 Nov 2018 21:21:05 +0300 Subject: [PATCH 5/6] Do not override user configs and flags the default ones from Qt should be fine --- src/src.pro | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/src.pro b/src/src.pro index 3ca344e..e81a138 100644 --- a/src/src.pro +++ b/src/src.pro @@ -2,14 +2,10 @@ TARGET = qmsgpack VER_MAJ = 0 VER_MIN = 1 VER_PAT = 0 -CONFIG -= app_bundle TEMPLATE = lib DEFINES += MSGPACK_MAKE_LIB DESTDIR = $$shadowed($$PWD/../bin) -QMAKE_CXXFLAGS += -fPIC - -CONFIG += debug_and_release TARGET = $$qtLibraryTarget($$TARGET) VERSION = $$join($$list($$VER_MAJ $$VER_MIN $$VER_PAT), .) From d9f37afe2ef52a59280bdf30b01c958e48372b99 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 20 Nov 2018 20:24:19 +0300 Subject: [PATCH 6/6] Build and run tests with qmake as of now, running tests is as simple as just typing qmake && make check --- tests/mixed/mixed.pro | 21 +++------------------ tests/pack/pack-test.pro | 22 ---------------------- tests/pack/pack.pro | 7 +++++++ tests/qttypes/qttypes.pro | 7 +++++++ tests/stream/stream.pro | 34 ++++------------------------------ tests/tests.pro | 6 +++++- tests/unpack/unpack.pro | 20 +++----------------- 7 files changed, 29 insertions(+), 88 deletions(-) delete mode 100644 tests/pack/pack-test.pro create mode 100644 tests/pack/pack.pro create mode 100644 tests/qttypes/qttypes.pro diff --git a/tests/mixed/mixed.pro b/tests/mixed/mixed.pro index ba6ee3f..ecdc189 100644 --- a/tests/mixed/mixed.pro +++ b/tests/mixed/mixed.pro @@ -1,22 +1,7 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2014-09-26T19:10:31 -# -#------------------------------------------------- - -QT += testlib - -QT -= gui - TARGET = mixed_test -CONFIG += console -CONFIG -= app_bundle - -TEMPLATE = app - -INCLUDEPATH += ../../src -LIBS += -lqmsgpack +QT += testlib +CONFIG += testcase +include(../tests.pri) SOURCES += mixed_test.cpp -DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/pack/pack-test.pro b/tests/pack/pack-test.pro deleted file mode 100644 index 8aa092e..0000000 --- a/tests/pack/pack-test.pro +++ /dev/null @@ -1,22 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2014-09-20T15:17:37 -# -#------------------------------------------------- - -QT += testlib - -QT -= gui - -TARGET = pack_test -CONFIG += console -CONFIG -= app_bundle - -TEMPLATE = app - -LIBS += -lqmsgpack -INCLUDEPATH += ../../src - - -SOURCES += pack_test.cpp -DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/pack/pack.pro b/tests/pack/pack.pro new file mode 100644 index 0000000..29a8692 --- /dev/null +++ b/tests/pack/pack.pro @@ -0,0 +1,7 @@ +TARGET = pack_test +QT += testlib +CONFIG += testcase + +include(../tests.pri) + +SOURCES += pack_test.cpp diff --git a/tests/qttypes/qttypes.pro b/tests/qttypes/qttypes.pro new file mode 100644 index 0000000..fd29df2 --- /dev/null +++ b/tests/qttypes/qttypes.pro @@ -0,0 +1,7 @@ +TARGET = qttypes_test +QT += testlib +CONFIG += testcase + +include(../tests.pri) + +SOURCES += qttypes_test.cpp diff --git a/tests/stream/stream.pro b/tests/stream/stream.pro index cdf1737..87b57ee 100644 --- a/tests/stream/stream.pro +++ b/tests/stream/stream.pro @@ -1,33 +1,7 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2017-07-10T14:58:18 -# -#------------------------------------------------- - -QT += testlib - -QT -= gui - -TARGET = tst_streamtest -CONFIG += console -CONFIG -= app_bundle - -TEMPLATE = app +TARGET = stream_test +QT += testlib +CONFIG += testcase include(../tests.pri) -# The following define makes your compiler emit warnings if you use -# any feature of Qt which as been marked as deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if you use deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - - -SOURCES += \ - stream_test.cpp -DEFINES += SRCDIR=\\\"$$PWD/\\\" +SOURCES += stream_test.cpp diff --git a/tests/tests.pro b/tests/tests.pro index 8fc7f92..397bda5 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,4 +1,8 @@ TEMPLATE = subdirs SUBDIRS += \ - stream + pack \ + unpack \ + mixed \ + stream \ + qttypes diff --git a/tests/unpack/unpack.pro b/tests/unpack/unpack.pro index e25c366..4040d36 100644 --- a/tests/unpack/unpack.pro +++ b/tests/unpack/unpack.pro @@ -1,21 +1,7 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2014-09-25T10:25:22 -# -#------------------------------------------------- - -QT += testlib - -QT -= gui - TARGET = unpack_test -CONFIG += console -CONFIG -= app_bundle - -TEMPLATE = app -include($$PWD/../../qmsgpack.pri) -INCLUDEPATH += ../../src +QT += testlib +CONFIG += testcase +include(../tests.pri) SOURCES += unpack_test.cpp -DEFINES += SRCDIR=\\\"$$PWD/\\\"