diff --git a/ScStwLibraries/ScStwLibraries.pri b/ScStwLibraries/ScStwLibraries.pri index ae2576f..e34d9f9 100644 --- a/ScStwLibraries/ScStwLibraries.pri +++ b/ScStwLibraries/ScStwLibraries.pri @@ -1,22 +1,41 @@ -QT += qml quickcontrols2 - !isEmpty(SCSTWLIBRARIES_LIB):error("ScStwLibraries.pri already included") SCSTWLIBRARIES_LIB = 1 -#DEPENDS -CONFIG(release, debug|release): { - SCSTWLIBRARIES_LIB_OUTPUT_DIR="$$PWD/build/release" -} else { - SCSTWLIBRARIES_LIB_OUTPUT_DIR="$$PWD/build/debug" +ScStwLibraries_QML { + QT += qml quickcontrols2 + DEFINES += ScStwLibraries_QML } -unix:LIBS += -L$$SCSTWLIBRARIES_LIB_OUTPUT_DIR -lScStwLibraries - -win32:LIBS += -L$$SCSTWLIBRARIES_LIB_OUTPUT_DIR -lScStwLibraries1 - -android { - ANDROID_EXTRA_LIBS += $$SCSTWLIBRARIES_LIB_OUTPUT_DIR/libScStwLibraries.so +ScStwLibraries_ClientLibs { + DEFINES += ScStwLibraries_ClientLibs } -INCLUDEPATH += "$$PWD" -INCLUDEPATH += "$$PWD"/headers +INCLUDEPATH += $$PWD/headers $$PWD + +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 diff --git a/ScStwLibraries/ScStwLibraries.pro b/ScStwLibraries/ScStwLibraries.pro deleted file mode 100644 index 73f691d..0000000 --- a/ScStwLibraries/ScStwLibraries.pro +++ /dev/null @@ -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 diff --git a/ScStwLibraries/headers/scstwlibraries.h b/ScStwLibraries/headers/scstwlibraries.h index df9f878..f6b1857 100644 --- a/ScStwLibraries/headers/scstwlibraries.h +++ b/ScStwLibraries/headers/scstwlibraries.h @@ -20,10 +20,15 @@ #define SCSTWLIBRARIES_H #include +#ifdef ScStwLibraries_QML #include -#include "scstwclient.h" +#endif #include "scstwtimer.h" #include "scstwrace.h" +#ifdef ScStwLibraries_ClientLibs +#include "scstwremotemonitorrace.h" +#include "scstwclient.h" +#endif class ScStwLibraries : public QObject { diff --git a/ScStwLibraries/sources/scstwlibraries.cpp b/ScStwLibraries/sources/scstwlibraries.cpp index 95a56da..427078c 100644 --- a/ScStwLibraries/sources/scstwlibraries.cpp +++ b/ScStwLibraries/sources/scstwlibraries.cpp @@ -24,11 +24,16 @@ ScStwLibraries::ScStwLibraries(QObject *parent) : QObject(parent) } void ScStwLibraries::init() { +#ifdef ScStwLibraries_QML qmlRegisterType("de.itsblue.ScStw", 2, 0, "ScStw"); qRegisterMetaType("ScStw::BaseStationSetting"); qRegisterMetaType("ScStw::SocketCommand"); qmlRegisterType("de.itsblue.ScStw", 2, 0, "ScStwRace"); qmlRegisterType("de.itsblue.ScStw", 2, 0, "ScStwTimer"); + +#ifdef ScStwLibraries_ClientLibs qmlRegisterType("de.itsblue.ScStw", 2, 0, "ScStwClient"); +#endif +#endif }