Windows Build Fixes

This commit is contained in:
Justin Hammond 2019-08-23 16:53:31 +08:00
parent 2a185b54de
commit 157363775d
27 changed files with 108 additions and 80 deletions

View file

@ -36,12 +36,24 @@ unix {
}
win32 {
CONFIG(debug,debug|release) BUILDTYPE = debug
CONFIG(release,debug|release) BUILDTYPE = release
exists( $$top_srcdir/../open-zwave/cpp/src/) {
message("Found OZW in $$absolute_path($$top_srcdir/../open-zwave/cpp/src)")
OZW_LIB_PATH = $$absolute_path($$top_srcdir/../open-zwave/)
INCLUDEPATH += $$absolute_path($$top_srcdir/../open-zwave/cpp/src/)/
exists( $$OZW_LIB_PATH/cpp/build/windows/vs2010/ReleaseDLL/OpenZWave.dll) {
LIBS += -L$$absolute_path($$top_srcdir/../open-zwave/cpp/build/windows/vs2010/ReleaseDLL) -lopenzwave
} else {
exists ( $$top_srcdir../open-zwave/cpp/build/windows/vs2010/DebugDLL/OpenZWave.dll) {
LIBS += -L$$absolute_path($$top_srcdir/../open-zwave/cpp/build/windows/vs2010/DebugDLL) -lopenzwave
} else {
error("Can't find a copy of OpenZWave.dll in the DebugDLL or ReleaseDLL Directory");
}
}
} else {
error("Can't Find a copy of OpenZwave")
}
CONFIG(debug,debug|release) BUILDTYPE = debug
CONFIG(release,debug|release) BUILDTYPE = release
}

View file

@ -12,3 +12,7 @@ SUBDIRS = qt-openzwave \
qt-openzwavedatabase \
qt-ozwdaemon \
qt-simpleclient
win32 {
SUBDIRS -= qt-openzwavedatabase
}

View file

@ -29,8 +29,18 @@
#include <QObject>
#include <QtRemoteObjects>
#include "qt-openzwave_global.h"
#include "qtozwmanager.h"
#include <QtCore/qglobal.h>
#if defined(QTOPENZWAVE_LIBRARY)
#define QTOPENZWAVESHARED_EXPORT Q_DECL_EXPORT
#else
#define QTOPENZWAVESHARED_EXPORT Q_DECL_IMPORT
#define OPENZWAVE_USEDLL 1
#endif
//#include "qtozwmanager.h"
/**
* \mainpage QT-OpenZWave
@ -79,6 +89,8 @@
* class which is the main interface to QT-OpenZWave
*/
class QTOZWManager;
class QTOPENZWAVESHARED_EXPORT QTOpenZwave : public QObject
{
Q_OBJECT

View file

@ -27,6 +27,9 @@
#ifndef QTOZW_PODS_H
#define QTOZW_PODS_H
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QtGlobal>
#include <QDataStream>

View file

@ -28,10 +28,13 @@
#ifndef QTOZWASSOCIATIONS_H
#define QTOZWASSOCIATIONS_H
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QAbstractItemModel>
class QTOZW_Associations : public QAbstractTableModel {
class QTOPENZWAVESHARED_EXPORT QTOZW_Associations : public QAbstractTableModel {
Q_OBJECT
public:
enum associationColumns {

View file

@ -28,12 +28,14 @@
#ifndef QTOZWLOGGING_H
#define QTOZWLOGGING_H
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QAbstractTableModel>
#include <QDateTime>
class QTOZW_Log : public QAbstractTableModel {
class QTOPENZWAVESHARED_EXPORT QTOZW_Log : public QAbstractTableModel {
Q_OBJECT
public:
enum LogColumns {

View file

@ -28,6 +28,8 @@
#ifndef QTOZWMANAGER_H
#define QTOZWMANAGER_H
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QUrl>
#include <QtRemoteObjects>
@ -46,7 +48,7 @@ class QTOZWManager_Internal;
class QTOZWManagerReplica;
class QTOZWOptionsReplica;
class QTOZWManager : public QObject {
class QTOPENZWAVESHARED_EXPORT QTOZWManager : public QObject {
Q_OBJECT
public:
enum connectionType {

View file

@ -28,10 +28,12 @@
#ifndef QTOZWNODEMODEL_H
#define QTOZWNODEMODEL_H
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QAbstractItemModel>
class QTOZW_Nodes : public QAbstractTableModel {
class QTOPENZWAVESHARED_EXPORT QTOZW_Nodes : public QAbstractTableModel {
Q_OBJECT
public:
enum NodeColumns {

View file

@ -28,6 +28,8 @@
#ifndef QTOZWOPTIONS_H
#define QTOZWOPTIONS_H
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QtRemoteObjects>
#include "qt-openzwave/qtozw_pods.h"
@ -37,7 +39,7 @@ class QTOZWOptions_Internal;
class QTOZWOptionsReplica;
class QTOZWManager;
class QTOZWOptions : public QObject {
class QTOPENZWAVESHARED_EXPORT QTOZWOptions : public QObject {
friend class QTOZWManager;

View file

@ -28,6 +28,8 @@
#ifndef QTOZWPROXYMODELS_H
#define QTOZWPROXYMODELS_H
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QSortFilterProxyModel>
#include <QItemSelectionModel>
@ -35,7 +37,7 @@
#include "qtozwnodemodel.h"
#include "qtozwvalueidmodel.h"
class QTOZW_proxyNodeModel : public QSortFilterProxyModel
class QTOPENZWAVESHARED_EXPORT QTOZW_proxyNodeModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
@ -47,7 +49,7 @@ public slots:
};
class QTOZW_proxyValueModel : public QSortFilterProxyModel
class QTOPENZWAVESHARED_EXPORT QTOZW_proxyValueModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
@ -69,7 +71,7 @@ private:
};
class QTOZW_proxyAssociationModel : public QSortFilterProxyModel
class QTOPENZWAVESHARED_EXPORT QTOZW_proxyAssociationModel : public QSortFilterProxyModel
{
Q_OBJECT
public:

View file

@ -28,6 +28,7 @@
#ifndef QTOZWVALUEIDMODEL_H
#define QTOZWVALUEIDMODEL_H
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QAbstractTableModel>
#include <QBitArray>
@ -55,7 +56,7 @@ QDataStream & operator>>(QDataStream & dataStream, QTOZW_ValueIDBitSet & list);
Q_DECLARE_METATYPE(QTOZW_ValueIDBitSet);
class QTOZW_ValueIds : public QAbstractTableModel {
class QTOPENZWAVESHARED_EXPORT QTOZW_ValueIds : public QAbstractTableModel {
Q_OBJECT
public:
enum ValueIdColumns {

View file

@ -1,40 +0,0 @@
//-----------------------------------------------------------------------------
//
// qt-openzwave_global.h
//
// Global Definition Header
//
// Copyright (c) 2019 Justin Hammond <Justin@dynam.ac>
//
// SOFTWARE NOTICE AND LICENSE
//
// This file is part of QT-OpenZWave.
//
// OpenZWave is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// OpenZWave is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
#ifndef QTOPENZWAVE_GLOBAL_H
#define QTOPENZWAVE_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(QTOPENZWAVE_LIBRARY)
# define QTOPENZWAVESHARED_EXPORT Q_DECL_EXPORT
#else
# define QTOPENZWAVESHARED_EXPORT Q_DECL_IMPORT
# define OPENZWAVE_USEDLL
#endif
#endif // QTOPENZWAVE_GLOBAL_H

View file

@ -25,11 +25,11 @@
//
//-----------------------------------------------------------------------------
#include "qt-openzwave_global.h"
#include <QLoggingCategory>
#ifndef QTOZW_LOGGING_H
#define QTOZW_LOGGING_H
#include "qt-openzwave/qtopenzwave.h"
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(manager);
Q_DECLARE_LOGGING_CATEGORY(valueModel);

View file

@ -28,7 +28,7 @@
#ifndef QTOZWASSOCIATIONMODEL_P_H
#define QTOZWASSOCIATIONMODEL_P_H
#include "qt-openzwave_global.h"
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include "qt-openzwave/qtozwassociationmodel.h"

View file

@ -27,7 +27,7 @@
#ifndef QTOZW_LOG_P_H
#define QTOZW_LOG_P_H
#include "qt-openzwave_global.h"
#include "qt-openzwave/qtopenzwave.h"
#include "qt-openzwave/qtozwlog.h"
#include <platform/Log.h>

View file

@ -29,7 +29,7 @@
#ifndef QTOZWMANAGER_P_H
#define QTOZWMANAGER_P_H
#include "qt-openzwave_global.h"
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QUrl>

View file

@ -28,7 +28,7 @@
#ifndef QTOZWNODEMODEL_P_H
#define QTOZWNODEMODEL_P_H
#include "qt-openzwave_global.h"
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include "qt-openzwave/qtozwnodemodel.h"

View file

@ -28,7 +28,7 @@
#ifndef QTOZWNOTIFICATION_H
#define QTOZWNOTIFICATION_H
#include "qt-openzwave_global.h"
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include "Notification.h"

View file

@ -28,7 +28,7 @@
#ifndef QTOZWOPTIONS_P_H
#define QTOZWOPTIONS_P_H
#include "qt-openzwave_global.h"
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include <QUrl>

View file

@ -28,7 +28,7 @@
#ifndef QTOZWVALUEIDMODEL_P_H
#define QTOZWVALUEIDMODEL_P_H
#include "qt-openzwave_global.h"
#include "qt-openzwave/qtopenzwave.h"
#include <QObject>
#include "qt-openzwave/qtozwvalueidmodel.h"

View file

@ -60,7 +60,7 @@ HEADERS += include/qt-openzwave/qtopenzwave.h \
include/qt-openzwave/qtozwoptions.h \
include/qtozwlog_p.h \
include/qtozwoptions_p.h \
include/qt-openzwave_global.h \ \
\ \
include/qtozw_logging.h \
include/qt-openzwave/qtozwassociationmodel.h \
include/qtozwassociationmodel_p.h \
@ -88,7 +88,7 @@ unix {
target.path = /usr/local/lib
INSTALLS += target
}
LIBS += -L../../open-zwave -lopenzwave
#LIBS += -L../../open-zwave -lopenzwave
macx {
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/

View file

@ -1,5 +1,7 @@
#include "qt-openzwave/qtopenzwave.h"
#include "qt-openzwave/qtozwmanager.h"
#include "qt-openzwave/qtozw_pods.h"
#include "qt-openzwave/qtozwvalueidmodel.h"
#include "qtozw_logging.h"

View file

@ -28,6 +28,7 @@
#include <QDebug>
#include <QBitArray>
#include "qtozw_logging.h"
#include "qt-openzwave/qtozwmanager.h"
#include "qt-openzwave/qtozwnodemodel.h"
#include "qt-openzwave/qtopenzwave.h"

View file

@ -4,23 +4,26 @@ TEMPLATE = lib
VERSION = 1.0.0
CONFIG += silent file_copies
CONFIG += silent file_copies resources_big
!versionAtLeast(QT_VERSION, 5.11.2):error("Use at least Qt version 5.11.2")
ozwconfig.target=config/qrc_ozwconfig.cpp
ozwconfig.commands=cp -R ../../open-zwave/config config/ && cd config && $$[QT_INSTALL_BINS]/rcc -project -o ozwconfig.qrc && $$[QT_INSTALL_BINS]/rcc --name="ozwconfig" --root="/config/" ozwconfig.qrc -o qrc_ozwconfig.cpp
QMAKE_EXTRA_TARGETS += ozwconfig
PRE_TARGETDEPS += config/qrc_ozwconfig.cpp
SOURCES += config/qrc_ozwconfig.cpp \
!win32 {
QMAKE_EXTRA_TARGETS += ozwconfig
PRE_TARGETDEPS += config/qrc_ozwconfig.cpp
SOURCES += config/qrc_ozwconfig.cpp \
source/qt-openzwavedatabase.cpp
macx {
macx {
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
}
}
HEADERS += \
HEADERS += \
include/qt-openzwave/qt-openzwavedatabase.h
INCLUDEPATH += include/
INCLUDEPATH += include/
}

View file

@ -4,7 +4,7 @@ QT += remoteobjects
TARGET = ../ozwdaemon
CONFIG += c++11 console silent
CONFIG += c++11 console
CONFIG -= app_bundle
# The following define makes your compiler emit warnings if you use
@ -30,12 +30,20 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
HEADERS += \
qtozwdaemon.h
LIBS += -lresolv -L../qt-openzwave/ -lqt-openzwave
include(../qt-openzwave.pri)
INCLUDEPATH += ../qt-openzwave/include/
unix {
LIBS += -lresolv -L../qt-openzwave/ -lqt-openzwave
}
win32 {
LIBS += -lDnsapi -L../qt-openzwave/$$BUILDTYPE/ -lqt-openzwave1
}
macx {
ICON = res/ozw_logo.icns
QMAKE_POST_LINK=$$top_srcdir/updaterpath.sh $(TARGET)
}
include(../qt-openzwave.pri)

View file

@ -1,10 +1,12 @@
#include <QAbstractItemModelTester>
#include <qt-openzwave/qtozwproxymodels.h>
#include <qt-openzwave/qtozwmanager.h>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "startup.h"
#include "qtozw_itemdelegate.h"
#include <qt-openzwave/qtozwproxymodels.h>
#define CONNECTSIGNALS(x) QObject::connect(this->m_qtozwmanager, &QTOZWManager::x, this, &MainWindow::x)

View file

@ -33,7 +33,15 @@ HEADERS += \
RESOURCES += \
simpleclient.qrc
LIBS += -lresolv -L../qt-openzwave/ -lqt-openzwave
include(../qt-openzwave.pri)
unix {
LIBS += -lresolv -L../qt-openzwave/ -lqt-openzwave
}
win32 {
LIBS += -lDnsapi -L../qt-openzwave/$$BUILDTYPE/ -lqt-openzwave1
}
INCLUDEPATH += ../qt-openzwave/include/
macx {
@ -43,4 +51,3 @@ macx {
QMAKE_BUNDLE_DATA += BUNDLE LIBOZW
QMAKE_POST_LINK=$$top_srcdir/updaterpath.sh $(TARGET)
}
include(../qt-openzwave.pri)