1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

update mac qt5 build

This commit is contained in:
tianduanrui 2017-10-29 22:18:12 +08:00
parent b379c54ebd
commit c58ec4a5dc
4 changed files with 54 additions and 21 deletions

View File

@ -39,7 +39,8 @@ QT += core gui network sql xml
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
greaterThan(QT_MAJOR_VERSION, 4): DEFINES += __QT5__
TARGET = QQtSdkManager
#this name must be equals to pro name
TARGET = QtSdkManager
TEMPLATE = app
INCLUDEPATH += $$PWD

View File

@ -3,7 +3,8 @@
#include <QMainWindow>
namespace Ui {
namespace Ui
{
class MainWindow;
}
@ -12,11 +13,11 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
explicit MainWindow(QWidget* parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
Ui::MainWindow* ui;
};
#endif // MAINWINDOW_H

View File

@ -11,21 +11,21 @@ class QQTSHARED_EXPORT QQtMessage : public QObject
{
Q_OBJECT
public:
explicit QQtMessage(QObject* parent = 0) : QObject(parent) {}
virtual ~QQtMessage() {}
inline explicit QQtMessage(QObject* parent = 0) : QObject(parent) {}
inline virtual ~QQtMessage() {}
public:
/**
* @brief
* @param m
* @param l
*/
virtual void parser(const QByteArray&) {}
inline virtual void parser(const QByteArray&) {}
/**
* @brief
* @param l
* @param m
*/
virtual void packer(QByteArray&) {}
inline virtual void packer(QByteArray&) {}
/**
* @brief
* @return
@ -36,10 +36,12 @@ signals:
public slots:
private:
//example
//quint32 a;
//QByteArray b;
//quint8 c;
/**
* example
* quint32 a;
* QByteArray b;
* quint8 c;
*/
};

View File

@ -15,22 +15,51 @@ QQT_LIB_PWD = $$PWD/../sdk/lib
message (Link QQt from: $$QQT_LIB_PWD)
contains(DEFINES, __DARWIN__) {
lessThan(QT_MAJOR_VERSION, 5):{
LIBS += -L$${QQT_LIB_PWD}
LIBS += -l QQt
} else {
LIBS += -F$${QQT_LIB_PWD}
LIBS += -framework QQt
}
LIBS += -F$${QQT_LIB_PWD}
LIBS += -framework QQt
} else {
LIBS += -L$${QQT_LIB_PWD}
LIBS += -l QQt
}
equals(QKIT_PRIVATE, macOS) {
MODULE_NAME = QQt
CMD_SEP = &&
QQT_BUNDLE_VER_DIR = Versions/$${QQT_MAJOR_VERSION}
QQT_BUNDLE_CUR_DIR = Versions/Current
QQT_BUNDLE_INC_DIR = $${QQT_BUNDLE_VER_DIR}/Headers
QQT_BUNDLE_RES_DIR = $${QQT_BUNDLE_VER_DIR}/Resources
QQT_BUNDLE_EXE_FILE = $${QQT_BUNDLE_VER_DIR}/$${MODULE_NAME}
QQT_BUNDLE_CUR_INC_DIR = $${QQT_BUNDLE_CUR_DIR}/Headers
QQT_BUNDLE_CUR_RES_DIR = $${QQT_BUNDLE_CUR_DIR}/Resources
QQT_BUNDLE_CUR_EXE_FILE = $${QQT_BUNDLE_CUR_DIR}/$${MODULE_NAME}
QQT_BUNDLE_CUR_LINK = Current
QQT_BUNDLE_INC_LINK = Headers
QQT_BUNDLE_RES_LINK = Resources
QQT_BUNDLE_EXE_LINK = $${MODULE_NAME}
command =
command += mkdir -p $$QQT_BUNDLE_VER_DIR $$CMD_SEP
command += mkdir -p $$QQT_BUNDLE_INC_DIR $$CMD_SEP
#copy lib
command += cp -rf $$QQT_LIB_PWD/$${MODULE_NAME}.framework/$${QQT_BUNDLE_VER_DIR}/* $$QQT_BUNDLE_VER_DIR $$CMD_SEP
#link header current resources
command += cd Versions $$CMD_SEP
command += ln -sf $${QQT_MAJOR_VERSION} $${QQT_BUNDLE_CUR_LINK} $$CMD_SEP
command += cd .. $$CMD_SEP
command += ln -sf $$QQT_BUNDLE_CUR_INC_DIR $${QQT_BUNDLE_INC_LINK} $$CMD_SEP
command += ln -sf $$QQT_BUNDLE_CUR_RES_DIR $${QQT_BUNDLE_RES_LINK} $$CMD_SEP
command += ln -sf $$QQT_BUNDLE_CUR_EXE_FILE $${QQT_BUNDLE_EXE_LINK}
QMAKE_POST_LINK += rm -rf bin/$${TARGET}.app/Contents/Frameworks/QQt.framework &&
QMAKE_POST_LINK += cp -af $${QQT_LIB_PWD}/QQt.framework \
bin/$${TARGET}.app/Contents/Frameworks &&
QMAKE_POST_LINK += mkdir -p bin/$${TARGET}.app/Contents/Frameworks/QQt.framework &&
QMAKE_POST_LINK += cd bin/$${TARGET}.app/Contents/Frameworks/QQt.framework &&
QMAKE_POST_LINK += $${command} &&
QMAKE_POST_LINK += cd $${OUT_PWD} &&
#QMAKE_POST_LINK += cp -rf $${QQT_LIB_PWD}/QQt.framework \
# bin/$${TARGET}.app/Contents/Frameworks &&
QMAKE_POST_LINK += install_name_tool -change QQt.framework/Versions/$${QQT_MAJOR_VERSION}/QQt \
@rpath/QQt.framework/Versions/$${QQT_MAJOR_VERSION}/QQt \
bin/$${TARGET}.app/Contents/MacOS/$$TARGET &&