mirror of
https://github.com/Fishwaldo/libqtihandclient.git
synced 2025-03-15 19:31:30 +00:00
Windows Build Fixes.
This commit is contained in:
parent
a83995caca
commit
a27bd3429d
8 changed files with 153 additions and 70 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include <QtCore/QAbstractListModel>
|
#include <QtCore/QAbstractListModel>
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
#include "QtiHanClientDefs.h"
|
||||||
#include "iHanClient/varcontainer.hpp"
|
#include "iHanClient/varcontainer.hpp"
|
||||||
#include "iHanClient/MessageBus.hpp"
|
#include "iHanClient/MessageBus.hpp"
|
||||||
#include "iHanClient/MsgTypes.hpp"
|
#include "iHanClient/MsgTypes.hpp"
|
||||||
|
@ -35,7 +36,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class DeviceModel_t : public QAbstractItemModel {
|
class QTIHANCLIENT_EXPORT DeviceModel_t : public QAbstractItemModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
enum DeviceRoles {
|
enum DeviceRoles {
|
||||||
|
@ -97,7 +98,7 @@ typedef QMap<int, QString> VarList_t;
|
||||||
Q_DECLARE_METATYPE(DeviceModel_t*)
|
Q_DECLARE_METATYPE(DeviceModel_t*)
|
||||||
Q_DECLARE_METATYPE(VarList_t);
|
Q_DECLARE_METATYPE(VarList_t);
|
||||||
|
|
||||||
class VarStorageElement: public QObject {
|
class QTIHANCLIENT_EXPORT VarStorageElement: public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VarStorageElement() {};
|
VarStorageElement() {};
|
||||||
|
@ -358,7 +359,7 @@ public:
|
||||||
VarStorage var;
|
VarStorage var;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VarStorageHelper_t {
|
class QTIHANCLIENT_EXPORT VarStorageHelper_t {
|
||||||
public:
|
public:
|
||||||
VarStorageHelper_t(VarStorage value, VarStorage descriptor, QString Serial);
|
VarStorageHelper_t(VarStorage value, VarStorage descriptor, QString Serial);
|
||||||
~VarStorageHelper_t();
|
~VarStorageHelper_t();
|
||||||
|
|
|
@ -20,11 +20,12 @@
|
||||||
#include "iHanClient/varcontainer.hpp"
|
#include "iHanClient/varcontainer.hpp"
|
||||||
#include "iHanClient/MessageBus.hpp"
|
#include "iHanClient/MessageBus.hpp"
|
||||||
#include "iHanClient/MsgTypes.hpp"
|
#include "iHanClient/MsgTypes.hpp"
|
||||||
|
#include "QtiHanClientDefs.h"
|
||||||
class QTcpDataIO;
|
class QTcpDataIO;
|
||||||
|
|
||||||
typedef enum State_e {S_DISCONNECTED, S_CONNECTED, S_READY} State_e;
|
typedef enum State_e {S_DISCONNECTED, S_CONNECTED, S_READY} State_e;
|
||||||
|
|
||||||
class MessageHandler : public QObject, public muscle::AbstractGatewayMessageReceiver
|
class QTIHANCLIENT_EXPORT MessageHandler : public QObject, public muscle::AbstractGatewayMessageReceiver
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -35,7 +35,9 @@
|
||||||
#include <QtiHanClient/kdescendantsproxymodel.h>
|
#include <QtiHanClient/kdescendantsproxymodel.h>
|
||||||
#include <QtiHanClient/modeltest.h>
|
#include <QtiHanClient/modeltest.h>
|
||||||
|
|
||||||
class QtiHanClient : public QObject {
|
#include "QtiHanClientDefs.h"
|
||||||
|
|
||||||
|
class QTIHANCLIENT_EXPORT QtiHanClient : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
51
include/QtiHanClient/QtiHanClientDefs.h
Normal file
51
include/QtiHanClient/QtiHanClientDefs.h
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
/* controlpanel - QtiHanClientDefs.h
|
||||||
|
** Copyright (c) 2010 Justin Hammond
|
||||||
|
**
|
||||||
|
** This program is free software; you can redistribute it and/or modify
|
||||||
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
** the Free Software Foundation; either version 2 of the License, or
|
||||||
|
** (at your option) any later version.
|
||||||
|
**
|
||||||
|
** This program 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 General Public License for more details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU General Public License
|
||||||
|
** along with this program; if not, write to the Free Software
|
||||||
|
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||||
|
** USA
|
||||||
|
**
|
||||||
|
** controlpanel SVN Identification:
|
||||||
|
** $Rev$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @file QtiHanClientDefs.h
|
||||||
|
* @brief
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTIHANCLIENTDEF_H_
|
||||||
|
#define QTIHANCLIENTDEF_H_
|
||||||
|
|
||||||
|
#include <QtCore\QtGlobal>
|
||||||
|
|
||||||
|
|
||||||
|
#if (defined _WINDOWS || defined WIN32 || defined _MSC_VER) && !defined MINGW
|
||||||
|
# if defined QTIHANCLIENT_MAKEDLL // Create the dynamic library.
|
||||||
|
# define QTIHANCLIENT_EXPORT Q_DECL_EXPORT
|
||||||
|
# elif defined QTIHANCLIENT_USEDLL // Use the dynamic library
|
||||||
|
# define QTIHANCLIENT_EXPORT Q_DECL_IMPORT
|
||||||
|
# else // Create/Use the static library
|
||||||
|
# define QTIHANCLIENT_EXPORT
|
||||||
|
# endif
|
||||||
|
// Disable export warnings
|
||||||
|
# define QTIHANCLIENT_EXPORT_WARNINGS_OFF __pragma( warning(push) )\
|
||||||
|
__pragma( warning(disable: 4251 4275) )
|
||||||
|
# define QTIHANCLIENT_EXPORT_WARNINGS_ON __pragma( warning(pop) )
|
||||||
|
#else
|
||||||
|
# define QTIHANCLIENT_EXPORT
|
||||||
|
# define QTIHANCLIENT_EXPORT_WARNINGS_OFF
|
||||||
|
# define QTIHANCLIENT_EXPORT_WARNINGS_ON
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -25,6 +25,7 @@
|
||||||
class KDescendantsProxyModelPrivate;
|
class KDescendantsProxyModelPrivate;
|
||||||
|
|
||||||
#include "kitemmodels_export.h"
|
#include "kitemmodels_export.h"
|
||||||
|
#include "QtiHanClientDefs.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Proxy Model for restructuring a Tree into a list.
|
@brief Proxy Model for restructuring a Tree into a list.
|
||||||
|
@ -66,7 +67,7 @@ view->setModel(descProxy);
|
||||||
@since 4.6
|
@since 4.6
|
||||||
@author Stephen Kelly <steveire@gmail.com>
|
@author Stephen Kelly <steveire@gmail.com>
|
||||||
*/
|
*/
|
||||||
class KITEMMODELS_EXPORT KDescendantsProxyModel : public QAbstractProxyModel
|
class QTIHANCLIENT_EXPORT KDescendantsProxyModel : public QAbstractProxyModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/include/
|
INCLUDEPATH += $$PWD/include/
|
||||||
DEPENDPATH += $$PWD
|
DEPENDPATH += $$PWD
|
||||||
DEFINES += MUSCLE_SINGLE_THREAD_ONLY
|
DEFINES += MUSCLE_SINGLE_THREAD_ONLY KITEMMODELS_STATIC_DEFINE
|
||||||
|
|
||||||
SOURCES += $$PWD/src/DeviceModel.cpp \
|
SOURCES += $$PWD/src/DeviceModel.cpp \
|
||||||
$$PWD/src/MessageHandler.cpp \
|
$$PWD/src/MessageHandler.cpp \
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
#
|
#
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += core gui widgets
|
QT += core gui widgets network
|
||||||
|
|
||||||
|
|
||||||
include (qtihanclientconfig.pri)
|
include (qtihanclientconfig.pri)
|
||||||
|
|
||||||
|
@ -13,41 +12,66 @@ include (qtihanclientconfig.pri)
|
||||||
|
|
||||||
TARGET = qt$${QT_MAJOR_VERSION}ihanclient
|
TARGET = qt$${QT_MAJOR_VERSION}ihanclient
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += lib_bundle c++11 shared link_pkgconfig create_pc create_prl no_install_prl silent
|
CONFIG += lib_bundle c++11 shared silent debug_and_release
|
||||||
|
|
||||||
!isEmpty(IHANCLIENTPATH) {
|
unix {
|
||||||
#message($$IHANCLIENTPATH/include/iHanClient/MsgTypes.hpp)
|
CONFIG += link_pkgconfig create_pc create_prl no_install_prl
|
||||||
exists($$IHANCLIENTPATH/include/iHanClient/MsgTypes.hpp) {
|
}
|
||||||
message("Using Custom Path to iHanClient")
|
win32 {
|
||||||
INCLUDEPATH += $$IHANCLIENTPATH/include/ $$IHANCLIENTPATH/muscle/
|
DEFINES += NOMINMAX QTIHANCLIENT_MAKEDLL
|
||||||
LIBS += -L$$IHANCLIENTPATH -lihanclient
|
}
|
||||||
CONFIG += staticlib
|
|
||||||
CONFIG -= create_pc create_prl no_install_prl
|
unix {
|
||||||
|
!isEmpty(IHANCLIENTPATH) {
|
||||||
|
#message($$IHANCLIENTPATH/include/iHanClient/MsgTypes.hpp)
|
||||||
|
exists($$IHANCLIENTPATH/include/iHanClient/MsgTypes.hpp) {
|
||||||
|
message("Using Custom Path to iHanClient")
|
||||||
|
INCLUDEPATH += $$IHANCLIENTPATH/include/ $$IHANCLIENTPATH/muscle/
|
||||||
|
LIBS += -L$$IHANCLIENTPATH -lihanclient
|
||||||
|
CONFIG += staticlib
|
||||||
|
CONFIG -= create_pc create_prl no_install_prl
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
PKGCONFIG += libihanclient
|
||||||
|
}
|
||||||
|
}
|
||||||
|
win32 {
|
||||||
|
exists(ihanclient/include/iHanClient/MsgTypes.hpp) {
|
||||||
|
message("Using iHanClient Export at ihanclient")
|
||||||
|
INCLUDEPATH += ihanclient/include/ ihanclient/include/muscle/
|
||||||
|
CONFIG(debug, debug|release) {
|
||||||
|
LIBS += -Lihanclient/Debug/libs/ -lihanclient
|
||||||
|
}
|
||||||
|
CONFIG(release, debug|release) {
|
||||||
|
LIBS += -Lihanclient/Release/libs/ -lihanclient
|
||||||
|
}
|
||||||
|
message("Using Libs: $${LIBS}")
|
||||||
|
} else {
|
||||||
|
error("ihanclient headers and libs not at $$PWD/ihanclient")
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
PKGCONFIG += libihanclient
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
include (libqtihanclient.pri)
|
include (libqtihanclient.pri)
|
||||||
|
unix {
|
||||||
|
target.path = $${QIC_INSTALL_LIBS}
|
||||||
|
headers.files = $${HEADERS}
|
||||||
|
headers.path = $${QIC_INSTALL_HEADERS}
|
||||||
|
|
||||||
target.path = $${QIC_INSTALL_LIBS}
|
docs.path = $${QIC_INSTALL_DOCS}
|
||||||
headers.files = $${HEADERS}
|
docs.files = README AUTHORS ChangeLog COPYING NEWS
|
||||||
headers.path = $${QIC_INSTALL_HEADERS}
|
pkgconfig.path = $${QIC_INSTALL_PC}
|
||||||
|
|
||||||
docs.path = $${QIC_INSTALL_DOCS}
|
QMAKE_PKGCONFIG_NAME = libQTiHanClient
|
||||||
docs.files = README AUTHORS ChangeLog COPYING NEWS
|
QMAKE_PKGCONFIG_DESCRIPTION = Qt bindings for the iHanClient Library
|
||||||
pkgconfig.path = $${QIC_INSTALL_PC}
|
QMAKE_PKGCONFIG_PREFIX = $$INSTALLBASE
|
||||||
|
QMAKE_PKGCONFIG_LIBDIR = $$target.path
|
||||||
|
QMAKE_PKGCONFIG_INCDIR = $$QIC_HEADERS_PATH
|
||||||
|
QMAKE_PKGCONFIG_VERSION = $$VERSION
|
||||||
|
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
|
||||||
|
|
||||||
QMAKE_PKGCONFIG_NAME = libQTiHanClient
|
INSTALLS += target headers docs
|
||||||
QMAKE_PKGCONFIG_DESCRIPTION = Qt bindings for the iHanClient Library
|
|
||||||
QMAKE_PKGCONFIG_PREFIX = $$INSTALLBASE
|
|
||||||
QMAKE_PKGCONFIG_LIBDIR = $$target.path
|
|
||||||
QMAKE_PKGCONFIG_INCDIR = $$QIC_HEADERS_PATH
|
|
||||||
QMAKE_PKGCONFIG_VERSION = $$VERSION
|
|
||||||
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
INSTALLS += target headers docs
|
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
isEmpty(PREFIX) {
|
|
||||||
PREFIX=/usr/local
|
|
||||||
}
|
|
||||||
|
|
||||||
QIC_VER_MAJ = 0
|
QIC_VER_MAJ = 0
|
||||||
QIC_VER_MIN = 1
|
QIC_VER_MIN = 1
|
||||||
isEmpty(QIC_VER_PAT) {
|
isEmpty(QIC_VER_PAT) {
|
||||||
|
@ -11,30 +5,39 @@ isEmpty(QIC_VER_PAT) {
|
||||||
}
|
}
|
||||||
VERSION = $${QIC_VER_MAJ}.$${QIC_VER_MIN}.$${QIC_VER_PAT}
|
VERSION = $${QIC_VER_MAJ}.$${QIC_VER_MIN}.$${QIC_VER_PAT}
|
||||||
|
|
||||||
isEmpty(DOCDIR) {
|
|
||||||
QIC_INSTALL_DOCS = $${PREFIX}/share/doc/Qt$${QT_MAJOR_VERSION}iHanClient-$${VERSION}/
|
|
||||||
} else {
|
unix {
|
||||||
QIC_INSTALL_DOCS = $${DOCDIR}/Qt$${QT_MAJOR_VERSION}iHanClient-$${VERSION}
|
isEmpty(PREFIX) {
|
||||||
}
|
PREFIX=/usr/local
|
||||||
isEmpty(INCDIR) {
|
}
|
||||||
QIC_INSTALL_HEADERS = $${PREFIX}/include/qt$${QT_MAJOR_VERSION}/QtiHanClient
|
|
||||||
QIC_HEADERS_PATH = $${PREFIX}/include/qt$${QT_MAJOR_VERSION}
|
|
||||||
} else {
|
isEmpty(DOCDIR) {
|
||||||
QIC_INSTALL_HEADERS = $${INCDIR}/qt$${QT_MAJOR_VERSION}/QtiHanClient
|
QIC_INSTALL_DOCS = $${PREFIX}/share/doc/Qt$${QT_MAJOR_VERSION}iHanClient-$${VERSION}/
|
||||||
QIC_HEADERS_PATH = $${INCDIR}/qt$${QT_MAJOR_VERSION}
|
} else {
|
||||||
}
|
QIC_INSTALL_DOCS = $${DOCDIR}/Qt$${QT_MAJOR_VERSION}iHanClient-$${VERSION}
|
||||||
isEmpty(LIBDIR) {
|
}
|
||||||
QIC_INSTALL_LIBS = $${PREFIX}/lib64/
|
isEmpty(INCDIR) {
|
||||||
} else {
|
QIC_INSTALL_HEADERS = $${PREFIX}/include/qt$${QT_MAJOR_VERSION}/QtiHanClient
|
||||||
QIC_INSTALL_LIBS = $${LIBDIR}
|
QIC_HEADERS_PATH = $${PREFIX}/include/qt$${QT_MAJOR_VERSION}
|
||||||
}
|
} else {
|
||||||
isEmpty(PKGCONFIGDIR) {
|
QIC_INSTALL_HEADERS = $${INCDIR}/qt$${QT_MAJOR_VERSION}/QtiHanClient
|
||||||
TMP_PATH = $$system(pkg-config pkg-config --variable=pc_path)
|
QIC_HEADERS_PATH = $${INCDIR}/qt$${QT_MAJOR_VERSION}
|
||||||
QIC_INSTALL_PC = $$section(TMP_PATH, :, 0, 0)
|
}
|
||||||
} else {
|
isEmpty(LIBDIR) {
|
||||||
QIC_INSTALL_PC = $${PKGCONFIGDIR}
|
QIC_INSTALL_LIBS = $${PREFIX}/lib64/
|
||||||
}
|
} else {
|
||||||
message(Docs Install Path: $${QIC_INSTALL_DOCS})
|
QIC_INSTALL_LIBS = $${LIBDIR}
|
||||||
message(Include Install Path: $${QIC_INSTALL_HEADERS})
|
}
|
||||||
message(Lib Install Path: $${QIC_INSTALL_LIBS})
|
isEmpty(PKGCONFIGDIR) {
|
||||||
message(PkgConfig Path: $${QIC_INSTALL_PC})
|
TMP_PATH = $$system(pkg-config pkg-config --variable=pc_path)
|
||||||
|
QIC_INSTALL_PC = $$section(TMP_PATH, :, 0, 0)
|
||||||
|
} else {
|
||||||
|
QIC_INSTALL_PC = $${PKGCONFIGDIR}
|
||||||
|
}
|
||||||
|
message(Docs Install Path: $${QIC_INSTALL_DOCS})
|
||||||
|
message(Include Install Path: $${QIC_INSTALL_HEADERS})
|
||||||
|
message(Lib Install Path: $${QIC_INSTALL_LIBS})
|
||||||
|
message(PkgConfig Path: $${QIC_INSTALL_PC})
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue