From dddab507ce399949e813d5522b72b7cf16c50200 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 30 Jan 2020 16:32:24 +0100 Subject: [PATCH] Fix some linux compile issues --- ScreenPlay/ScreenPlay.pro | 43 +++++++++++++++++---- ScreenPlay/src/monitorlistmodel.h | 3 +- ScreenPlay/src/util.cpp | 20 ++++++---- ScreenPlaySDK/Screenplaysdk.pri | 7 ---- ScreenPlaySDK/Screenplaysdk.pro | 35 ----------------- ScreenPlayWallpaper/ScreenPlayWallpaper.pro | 20 ++++++---- ScreenPlayWallpaper/main.cpp | 7 ++-- ScreenPlayWallpaper/src/linuxwindow.cpp | 5 +-- ScreenPlayWallpaper/src/linuxwindow.h | 3 +- ScreenPlayWidget/ScreenPlayWidget.pro | 21 ++++++---- install-dependencies.bat | 2 +- install-dependencies.sh | 4 +- 12 files changed, 86 insertions(+), 84 deletions(-) delete mode 100644 ScreenPlaySDK/Screenplaysdk.pri delete mode 100644 ScreenPlaySDK/Screenplaysdk.pro diff --git a/ScreenPlay/ScreenPlay.pro b/ScreenPlay/ScreenPlay.pro index 3bfb1a58..d50958a2 100644 --- a/ScreenPlay/ScreenPlay.pro +++ b/ScreenPlay/ScreenPlay.pro @@ -65,17 +65,19 @@ HEADERS += \ INCLUDEPATH += \ $$PWD/src/\ -CONFIG(debug, debug|release) { - install_it.path = $${OUT_PWD}/debug/ -} else { - install_it.path = $${OUT_PWD}/release/ -} - - win32 { RC_ICONS += favicon.ico + + CONFIG(debug, debug|release) { + install_it.path = $${OUT_PWD}/debug/ + } else { + install_it.path = $${OUT_PWD}/release/ + } + + + INCLUDEPATH += $$PWD/../Common/vcpkg/installed/x64-windows/include DEPENDPATH += $$PWD/../Common/vcpkg/installed/x64-windows/include @@ -121,5 +123,32 @@ macx { } +unix { + INCLUDEPATH += $$PWD/../Common/vcpkg/installed/x64-linux/include + DEPENDPATH += $$PWD/../Common/vcpkg/installed/x64-linux/include + + LIBS += -L$$PWD/../Common/vcpkg/installed/x64-linux/lib/ -llibzippp -lzip + + install_it.path = $${OUT_PWD} + + CONFIG(debug, debug|release) { + install_it.files += $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/zip.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/zlibd1.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libzippp.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/bz2d.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libcrypto-1_1-x64.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libssl-1_1-x64.so \ + + } else { + install_it.files += $$PWD/../Common/vcpkg/installed/x64-linux/bin/zip.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/zlib1.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/libzippp.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/bz2.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/libcrypto-1_1-x64.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/libssl-1_1-x64.so \ + } +} + + INSTALLS += install_it diff --git a/ScreenPlay/src/monitorlistmodel.h b/ScreenPlay/src/monitorlistmodel.h index 2c9661fa..fd16791e 100644 --- a/ScreenPlay/src/monitorlistmodel.h +++ b/ScreenPlay/src/monitorlistmodel.h @@ -14,8 +14,9 @@ #include "screenplaywallpaper.h" #include "screenplaywidget.h" +#ifdef Q_OS_WIN #include - +#endif #include #include diff --git a/ScreenPlay/src/util.cpp b/ScreenPlay/src/util.cpp index 0d811ea9..57b8ba81 100644 --- a/ScreenPlay/src/util.cpp +++ b/ScreenPlay/src/util.cpp @@ -322,12 +322,14 @@ void Util::downloadFFMPEG() string path = QGuiApplication::instance()->applicationDirPath().toStdString() + "/"; + ZipEntry entryFFMPEG; + std::string entryFFMPEGPath; #ifdef Q_OS_WIN - ZipEntry entryFFMPEG = archive->getEntry(ffmpegVersion.toStdString() + "-win64-static/bin/ffmpeg.exe"); - std::string entryFFMPEGPath = path + "ffmpeg.exe"; + entryFFMPEG = archive->getEntry(ffmpegVersion.toStdString() + "-win64-static/bin/ffmpeg.exe"); + entryFFMPEGPath = path + "ffmpeg.exe"; #elif defined(Q_OS_OSX) - ZipEntry entryFFMPEG = archive->getEntry(ffmpegVersion.toStdString() +"-macos64-static/bin/ffmpeg"); - std::string entryFFMPEGPath = path + "ffmpeg"; + entryFFMPEG = archive->getEntry(ffmpegVersion.toStdString() +"-macos64-static/bin/ffmpeg"); + entryFFMPEGPath = path + "ffmpeg"; #endif if (entryFFMPEG.isNull()) { @@ -344,12 +346,14 @@ void Util::downloadFFMPEG() return; } + ZipEntry entryFFPROBE; + std::string entryFFPROBEPath; #ifdef Q_OS_WIN - ZipEntry entryFFPROBE = archive->getEntry(ffmpegVersion.toStdString() + "-win64-static/bin/ffprobe.exe"); - std::string entryFFPROBEPath = path + "ffprobe.exe"; + entryFFPROBE = archive->getEntry(ffmpegVersion.toStdString() + "-win64-static/bin/ffprobe.exe"); + entryFFPROBEPath = path + "ffprobe.exe"; #elif defined(Q_OS_OSX) - ZipEntry entryFFPROBE = archive->getEntry(ffmpegVersion.toStdString() +"-macos64-static/bin/ffprobe"); - std::string entryFFPROBEPath = path + "ffprobe"; + entryFFPROBE = archive->getEntry(ffmpegVersion.toStdString() +"-macos64-static/bin/ffprobe"); + entryFFPROBEPath = path + "ffprobe"; #endif if (entryFFPROBE.isNull()) { qDebug() << "null"; diff --git a/ScreenPlaySDK/Screenplaysdk.pri b/ScreenPlaySDK/Screenplaysdk.pri deleted file mode 100644 index ad58cb47..00000000 --- a/ScreenPlaySDK/Screenplaysdk.pri +++ /dev/null @@ -1,7 +0,0 @@ -SOURCES += \ - $$PWD/screenplay-sdk_plugin.cpp \ - $$PWD/screenplaysdk.cpp - -HEADERS += \ - $$PWD/screenplay-sdk_plugin.h \ - $$PWD/screenplaysdk.h diff --git a/ScreenPlaySDK/Screenplaysdk.pro b/ScreenPlaySDK/Screenplaysdk.pro deleted file mode 100644 index 1dd6be59..00000000 --- a/ScreenPlaySDK/Screenplaysdk.pro +++ /dev/null @@ -1,35 +0,0 @@ -TEMPLATE = lib -TARGET = ScreenPlaySDK -TARGET = $$qtLibraryTarget($$TARGET) - -QT += qml quick -CONFIG += plugin c++17 - -uri = ScreenPlay.screenplaysdk - -# Input -SOURCES += \ - $$PWD/screenplay-sdk_plugin.cpp \ - $$PWD/screenplaysdk.cpp - -HEADERS += \ - $$PWD/screenplay-sdk_plugin.h \ - $$PWD/screenplaysdk.h - -DISTFILES = qmldir - -!equals(_PRO_FILE_PWD_, $$OUT_PWD) { - copy_qmldir.target = $$OUT_PWD/qmldir - copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir - copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" - QMAKE_EXTRA_TARGETS += copy_qmldir - PRE_TARGETDEPS += $$copy_qmldir.target -} - -qmldir.files = qmldir - -installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) -qmldir.path = $$installPath -target.path = $$installPath -INSTALLS += target qmldir - diff --git a/ScreenPlayWallpaper/ScreenPlayWallpaper.pro b/ScreenPlayWallpaper/ScreenPlayWallpaper.pro index 31650946..0e28558b 100644 --- a/ScreenPlayWallpaper/ScreenPlayWallpaper.pro +++ b/ScreenPlayWallpaper/ScreenPlayWallpaper.pro @@ -74,14 +74,20 @@ macx { } !macx { + + install_it.path = $${OUT_PWD}/ + CONFIG(debug, debug|release) { - LIBS += -lScreenPlaySDKd - QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/debug - } else { - LIBS += -lScreenPlaySDK - QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/release - } - QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK + install_it.files += \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libcrypto-1_1-x64.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libssl-1_1-x64.so \ + + } else { + + install_it.files += \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/libcrypto-1_1-x64.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/libssl-1_1-x64.so \ + } } install_it.files += index.html \ diff --git a/ScreenPlayWallpaper/main.cpp b/ScreenPlayWallpaper/main.cpp index f70b60f9..a6443435 100644 --- a/ScreenPlayWallpaper/main.cpp +++ b/ScreenPlayWallpaper/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #if defined(Q_OS_WIN) #include "src/winwindow.h" @@ -44,10 +45,10 @@ int main(int argc, char* argv[]) //WinWindow window(list, "D:/672870/827874818", "appid", "1", "fill"); #endif #if defined(Q_OS_LINUX) - LinuxWindow window(list, "test", "appid", "1"); + LinuxWindow window(QVector{ 0 }, "test", "appid", "1", "fill"); #endif #if defined(Q_OS_OSX) - MacWindow window(list, "test", "appid", "1"); + MacWindow window({ 0 }, "test", "appid", "1", "fill"); #endif return app.exec(); @@ -103,7 +104,7 @@ int main(int argc, char* argv[]) #endif #if defined(Q_OS_LINUX) - LinuxWindow window(list, argumentList.at(2), argumentList.at(3), argumentList.at(5)); + LinuxWindow window(list, argumentList.at(2), argumentList.at(3), argumentList.at(4), argumentList.at(5)); QObject::connect(&sdk, &ScreenPlaySDK::sdkDisconnected, &window, &LinuxWindow::destroyThis); QObject::connect(&sdk, &ScreenPlaySDK::incommingMessage, &window, &LinuxWindow::messageReceived); #endif diff --git a/ScreenPlayWallpaper/src/linuxwindow.cpp b/ScreenPlayWallpaper/src/linuxwindow.cpp index dfb083c3..3fbd23d5 100644 --- a/ScreenPlayWallpaper/src/linuxwindow.cpp +++ b/ScreenPlayWallpaper/src/linuxwindow.cpp @@ -1,6 +1,6 @@ #include "linuxwindow.h" -LinuxWindow::LinuxWindow(QVector& activeScreensList, QString projectPath, QString id, QString volume, QObject* parent) +LinuxWindow::LinuxWindow(QVector activeScreensList, QString projectPath, QString id, QString volume, const QString fillmode, QObject* parent) : BaseWindow(projectPath) { setAppID(id); @@ -33,6 +33,3 @@ void LinuxWindow::destroyThis() QCoreApplication::quit(); } -void LinuxWindow::messageReceived(QString key, QString value) -{ -} diff --git a/ScreenPlayWallpaper/src/linuxwindow.h b/ScreenPlayWallpaper/src/linuxwindow.h index 592735de..95ad2a11 100644 --- a/ScreenPlayWallpaper/src/linuxwindow.h +++ b/ScreenPlayWallpaper/src/linuxwindow.h @@ -17,14 +17,13 @@ class LinuxWindow : public BaseWindow { Q_OBJECT public: - explicit LinuxWindow(QVector& activeScreensList, QString projectPath, QString id, QString volume,QObject *parent = nullptr); + explicit LinuxWindow(QVector activeScreensList, QString projectPath, QString id, QString volume, const QString fillmode,QObject *parent = nullptr); signals: public slots: void setVisible(bool show) override; void destroyThis() override; - void messageReceived(QString key, QString value) override; private: QQuickView m_window; }; diff --git a/ScreenPlayWidget/ScreenPlayWidget.pro b/ScreenPlayWidget/ScreenPlayWidget.pro index fd332506..63264751 100644 --- a/ScreenPlayWidget/ScreenPlayWidget.pro +++ b/ScreenPlayWidget/ScreenPlayWidget.pro @@ -40,14 +40,21 @@ macx: { } !macx: { + + + install_it.path = $${OUT_PWD}/ + CONFIG(debug, debug|release) { - LIBS += -lScreenPlaySDKd - QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/debug - } else { - LIBS += -lScreenPlaySDK - QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/release - } - QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK + install_it.files += \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libcrypto-1_1-x64.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libssl-1_1-x64.so \ + + } else { + + install_it.files += \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/libcrypto-1_1-x64.so \ + $$PWD/../Common/vcpkg/installed/x64-linux/bin/libssl-1_1-x64.so \ + } } INSTALLS += install_it diff --git a/install-dependencies.bat b/install-dependencies.bat index 8c2a00e0..d4780a0d 100644 --- a/install-dependencies.bat +++ b/install-dependencies.bat @@ -1,4 +1,4 @@ - +git submodule update --init git submodule update --recursive cd Common git clone https://github.com/microsoft/vcpkg.git diff --git a/install-dependencies.sh b/install-dependencies.sh index f76802d5..0303ddf4 100755 --- a/install-dependencies.sh +++ b/install-dependencies.sh @@ -1,4 +1,4 @@ - +git submodule update --init git submodule update --recursive cd Common git clone https://github.com/microsoft/vcpkg.git @@ -8,4 +8,4 @@ git checkout origin/master chmod +x bootstrap-vcpkg.sh ./bootstrap-vcpkg.sh chmod +x vcpkg -./vcpkg install libzippp:x64-linux nlohmann-json:x64-linux openssl:x64-linux +./vcpkg install libzippp:x64-linux nlohmann-json:x64-linux openssl-unix:x64-linux libzip:x64-linux