跨平台准备:调整目录结构

This commit is contained in:
rankun 2018-11-23 13:12:08 +08:00
parent d95a1fb5d7
commit 33bdccdd6a
107 changed files with 39 additions and 14 deletions

View file

@ -39,11 +39,25 @@ FORMS += \
dialog.ui \ dialog.ui \
videoform.ui videoform.ui
# 指定可执行程序输出目录 # ***********************************************************
# 输出目录
# ***********************************************************
# Win平台下输出目录
win32 {
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
DESTDIR = $$PWD/../output/debug DESTDIR = $$PWD/../output/win/debug
} else { } else {
DESTDIR = $$PWD/../output/release DESTDIR = $$PWD/../output/win/release
}
}
# Mac os平台下输出目录
macos {
CONFIG(debug, debug|release) {
DESTDIR = $$PWD/../output/mac/debug
} else {
DESTDIR = $$PWD/../output/mac/release
}
} }
# 子工程 # 子工程
@ -57,7 +71,7 @@ include ($$PWD/inputcontrol/inputcontrol.pri)
# 附加包含路径 # 附加包含路径
INCLUDEPATH += \ INCLUDEPATH += \
$$PWD/ffmpeg/include \ $$PWD/../third_party/ffmpeg/include \
$$PWD/common \ $$PWD/common \
$$PWD/server \ $$PWD/server \
$$PWD/adb \ $$PWD/adb \
@ -66,12 +80,19 @@ INCLUDEPATH += \
$$PWD/android \ $$PWD/android \
$$PWD/inputcontrol $$PWD/inputcontrol
# 依赖库 # ***********************************************************
# 依赖模块
# ***********************************************************
LIBS += \ LIBS += \
-L$$PWD/ffmpeg/lib -lavcodec \ -L$$PWD/../third_party/ffmpeg/lib -lavcodec \
-L$$PWD/ffmpeg/lib -lavformat \ -L$$PWD/../third_party/ffmpeg/lib -lavformat \
-L$$PWD/ffmpeg/lib -lavutil \ -L$$PWD/../third_party/ffmpeg/lib -lavutil \
-L$$PWD/ffmpeg/lib -lswscale -L$$PWD/../third_party/ffmpeg/lib -lswscale
# Win平台下依赖模块
win32 {
LIBS += -lUser32
}
RESOURCES += \ RESOURCES += \
res.qrc res.qrc

View file

@ -1,11 +1,13 @@
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QMouseEvent> #include <QMouseEvent>
#ifdef Q_OS_WIN32
#include <Windows.h>
#endif
#include "videoform.h" #include "videoform.h"
#include "ui_videoform.h" #include "ui_videoform.h"
#include <Windows.h>
#pragma comment(lib, "User32.lib")
VideoForm::VideoForm(const QString& serial, QWidget *parent) : VideoForm::VideoForm(const QString& serial, QWidget *parent) :
QWidget(parent), QWidget(parent),
@ -19,8 +21,9 @@ VideoForm::VideoForm(const QString& serial, QWidget *parent) :
ui->videoWidget->setMouseTracking(true); ui->videoWidget->setMouseTracking(true);
connect(&m_inputConvert, &InputConvertGame::grabCursor, this, [this](bool grab){ connect(&m_inputConvert, &InputConvertGame::grabCursor, this, [this](bool grab){
#ifdef Q_OS_WIN32
if(grab) { if(grab) {
RECT mainRect; //windef.h中被定义 RECT mainRect;
mainRect.left = (LONG)this->geometry().left(); mainRect.left = (LONG)this->geometry().left();
mainRect.right = (LONG)this->geometry().right(); mainRect.right = (LONG)this->geometry().right();
mainRect.top = (LONG)this->geometry().top(); mainRect.top = (LONG)this->geometry().top();
@ -29,6 +32,7 @@ VideoForm::VideoForm(const QString& serial, QWidget *parent) :
} else { } else {
ClipCursor(Q_NULLPTR); ClipCursor(Q_NULLPTR);
} }
#endif
}); });
m_server = new Server(); m_server = new Server();

Some files were not shown because too many files have changed in this diff Show more