moved away from shared libraries

This commit is contained in:
Dorian Zedler 2020-07-01 12:26:34 +02:00
parent 549edda9b0
commit 1b970ae7f6
Signed by: dorian
GPG key ID: 989DE36109AFA354
4 changed files with 45 additions and 73 deletions

View file

@ -1,22 +1,41 @@
QT += qml quickcontrols2
!isEmpty(SCSTWLIBRARIES_LIB):error("ScStwLibraries.pri already included") !isEmpty(SCSTWLIBRARIES_LIB):error("ScStwLibraries.pri already included")
SCSTWLIBRARIES_LIB = 1 SCSTWLIBRARIES_LIB = 1
#DEPENDS ScStwLibraries_QML {
CONFIG(release, debug|release): { QT += qml quickcontrols2
SCSTWLIBRARIES_LIB_OUTPUT_DIR="$$PWD/build/release" DEFINES += ScStwLibraries_QML
} else {
SCSTWLIBRARIES_LIB_OUTPUT_DIR="$$PWD/build/debug"
} }
unix:LIBS += -L$$SCSTWLIBRARIES_LIB_OUTPUT_DIR -lScStwLibraries ScStwLibraries_ClientLibs {
DEFINES += ScStwLibraries_ClientLibs
win32:LIBS += -L$$SCSTWLIBRARIES_LIB_OUTPUT_DIR -lScStwLibraries1
android {
ANDROID_EXTRA_LIBS += $$SCSTWLIBRARIES_LIB_OUTPUT_DIR/libScStwLibraries.so
} }
INCLUDEPATH += "$$PWD" INCLUDEPATH += $$PWD/headers $$PWD
INCLUDEPATH += "$$PWD"/headers
SOURCES += \
$$PWD/sources/ScStw.cpp \
$$PWD/sources/scstwsoundplayer.cpp \
$$PWD/sources/scstwlibraries.cpp \
$$PWD/sources/scstwrace.cpp \
$$PWD/sources/scstwtimer.cpp
HEADERS += \
$$PWD/headers/ScStw.hpp \
$$PWD/headers/ScStwLibraries_global.h \
$$PWD/headers/scstwlibraries.h \
$$PWD/headers/scstwrace.h \
$$PWD/headers/scstwsoundplayer.h \
$$PWD/headers/scstwtimer.h
ScStwLibraries_ClientLibs {
SOURCES += \
$$PWD/sources/scstwclient.cpp
$$PWD/sources/scstwremotemonitorrace.cpp
HEADERS += \
$$PWD/headers/scstwclient.h \
$$PWD/headers/scstwremotemonitorrace.h
}
RESOURCES += \
$$PWD/resources/ScStwLibrariesShared.qrc

View file

@ -1,57 +0,0 @@
QT -= gui
QT += network multimedia quick
CONFIG(contains(QMAKE_LFLAGS_CONSOLE)){
message("this is console")
}
TEMPLATE = lib
DEFINES += SCSTWLIBRARIES_LIBRARY
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked 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 it uses 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 += \
sources/ScStw.cpp \
sources/scstwclient.cpp \
sources/scstwlibraries.cpp \
sources/scstwrace.cpp \
sources/scstwremotemonitorrace.cpp \
sources/scstwsoundplayer.cpp \
sources/scstwtimer.cpp
HEADERS += \
headers/ScStw.hpp \
headers/ScStwLibraries_global.h \
headers/scstwlibraries.h \
headers/scstwrace.h \
headers/scstwclient.h \
headers/scstwremotemonitorrace.h \
headers/scstwsoundplayer.h \
headers/scstwtimer.h
RESOURCES += \
resources/ScStwLibrariesShared.qrc
DISTFILES +=
#DEPENDS
CONFIG(release, debug|release): {
DESTDIR="$$PWD/build/release"
} else {
DESTDIR="$$PWD/build/debug"
}
# Default rules for deployment.
target.path = /usr/local/lib
!isEmpty(target.path): INSTALLS += target

View file

@ -20,10 +20,15 @@
#define SCSTWLIBRARIES_H #define SCSTWLIBRARIES_H
#include <QObject> #include <QObject>
#ifdef ScStwLibraries_QML
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include "scstwclient.h" #endif
#include "scstwtimer.h" #include "scstwtimer.h"
#include "scstwrace.h" #include "scstwrace.h"
#ifdef ScStwLibraries_ClientLibs
#include "scstwremotemonitorrace.h"
#include "scstwclient.h"
#endif
class ScStwLibraries : public QObject class ScStwLibraries : public QObject
{ {

View file

@ -24,11 +24,16 @@ ScStwLibraries::ScStwLibraries(QObject *parent) : QObject(parent)
} }
void ScStwLibraries::init() { void ScStwLibraries::init() {
#ifdef ScStwLibraries_QML
qmlRegisterType<ScStw>("de.itsblue.ScStw", 2, 0, "ScStw"); qmlRegisterType<ScStw>("de.itsblue.ScStw", 2, 0, "ScStw");
qRegisterMetaType<ScStw::BaseStationSetting>("ScStw::BaseStationSetting"); qRegisterMetaType<ScStw::BaseStationSetting>("ScStw::BaseStationSetting");
qRegisterMetaType<ScStw::SocketCommand>("ScStw::SocketCommand"); qRegisterMetaType<ScStw::SocketCommand>("ScStw::SocketCommand");
qmlRegisterType<ScStwRace>("de.itsblue.ScStw", 2, 0, "ScStwRace"); qmlRegisterType<ScStwRace>("de.itsblue.ScStw", 2, 0, "ScStwRace");
qmlRegisterType<ScStwTimer>("de.itsblue.ScStw", 2, 0, "ScStwTimer"); qmlRegisterType<ScStwTimer>("de.itsblue.ScStw", 2, 0, "ScStwTimer");
#ifdef ScStwLibraries_ClientLibs
qmlRegisterType<ScStwClient>("de.itsblue.ScStw", 2, 0, "ScStwClient"); qmlRegisterType<ScStwClient>("de.itsblue.ScStw", 2, 0, "ScStwClient");
#endif
#endif
} }