From 8d6956312e6409212f5d3a8330b3cf138fe9354c Mon Sep 17 00:00:00 2001 From: Rurigk Date: Fri, 8 Sep 2023 01:20:26 -0600 Subject: [PATCH 1/6] Add layer-shell-qt as a third party lib --- .gitignore | 1 + ThirdParty/CMakeLists.txt | 30 ++++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 281ac916..429aa9c1 100644 --- a/.gitignore +++ b/.gitignore @@ -261,3 +261,4 @@ cython_debug/ /ThirdParty/qml-archive/** /ThirdParty/qml-plausible/ /ThirdParty/ffmpeg/** +/ThirdParty/qt-layer-shell/** diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt index 64c1f619..01ad0a83 100644 --- a/ThirdParty/CMakeLists.txt +++ b/ThirdParty/CMakeLists.txt @@ -8,13 +8,27 @@ FetchContent_Populate( # https://bugreports.qt.io/browse/QTCREATORBUG-27083 SOURCE_DIR ${THIRD_PARTY_PATH}/QArchive) - FetchContent_Populate( - qml-plausible - GIT_REPOSITORY https://gitlab.com/kelteseth/qml-plausible.git - GIT_TAG 5069ba3bf25663ea06be8b94c398d6c61058d4d5 - # Workaround because: 1. QtCreator cannot handle QML_ELEMENT stuff when it is in bin folder - # https://bugreports.qt.io/browse/QTCREATORBUG-27083 - SOURCE_DIR ${THIRD_PARTY_PATH}/qml-plausible) +FetchContent_Populate( + qml-plausible + GIT_REPOSITORY https://gitlab.com/kelteseth/qml-plausible.git + GIT_TAG 5069ba3bf25663ea06be8b94c398d6c61058d4d5 + # Workaround because: 1. QtCreator cannot handle QML_ELEMENT stuff when it is in bin folder + # https://bugreports.qt.io/browse/QTCREATORBUG-27083 + SOURCE_DIR ${THIRD_PARTY_PATH}/qml-plausible) + + add_subdirectory(qml-plausible) -add_subdirectory(QArchive) \ No newline at end of file +add_subdirectory(QArchive) + +if(UNIX AND NOT APPLE) +FetchContent_Populate( + qt-layer-shell + GIT_REPOSITORY https://github.com/KDE/layer-shell-qt.git + GIT_TAG 721c0ae334554eb2396a2d4d3358f896b8c77412 + # Workaround because: 1. QtCreator cannot handle QML_ELEMENT stuff when it is in bin folder + # https://bugreports.qt.io/browse/QTCREATORBUG-27083 + SOURCE_DIR ${THIRD_PARTY_PATH}/qt-layer-shell) + add_subdirectory(qt-layer-shell) + +endif() \ No newline at end of file From 20ed50a26de47ff45429e98718a5ec7a9f147e62 Mon Sep 17 00:00:00 2001 From: Rurigk Date: Fri, 8 Sep 2023 01:21:57 -0600 Subject: [PATCH 2/6] Import LayerShellQt from ThirdParty --- ScreenPlayWallpaper/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ScreenPlayWallpaper/CMakeLists.txt b/ScreenPlayWallpaper/CMakeLists.txt index 829bd2a9..620afbae 100644 --- a/ScreenPlayWallpaper/CMakeLists.txt +++ b/ScreenPlayWallpaper/CMakeLists.txt @@ -87,11 +87,11 @@ endif() if(UNIX AND NOT APPLE) find_package(ECM CONFIG REQUIRED NO_MODULE) - set(LayerShellQt "/usr/local/lib/x86_64-linux-gnu/cmake/LayerShellQt/") + set(LayerShellQt "${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/layer-shell-qt/") find_package(LayerShellQt REQUIRED) target_link_libraries( ${PROJECT_NAME} - PRIVATE /usr/local/lib/x86_64-linux-gnu/libLayerShellQtInterface.so) + PRIVATE LayerShellQtInterface) include(CopyRecursive) copy_recursive(${CMAKE_CURRENT_SOURCE_DIR}/kde/ScreenPlay ${CMAKE_BINARY_DIR}/bin/kde/ScreenPlay "*") From 5b00e895577db64f35c7bf71b83b88f5ed4203b1 Mon Sep 17 00:00:00 2001 From: Rurigk Date: Fri, 8 Sep 2023 01:26:21 -0600 Subject: [PATCH 3/6] Add a linux generic target that uses system QT Keep the aqt target with a different name --- CMakePresets.json | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 31230776..9c69b60e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -74,7 +74,7 @@ } }, { - "name": "linux-debug", + "name": "linux-generic-debug", "displayName": "ScreenPlay 64bit Debug Linux", "description": "Linux only!", "generator": "Ninja", @@ -84,6 +84,40 @@ "lhs": "${hostSystemName}", "rhs": "Linux" }, + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_CXX_COMPILER": "g++", + "CMAKE_C_COMPILER": "gcc", + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/../vcpkg/scripts/buildsystems/vcpkg.cmake", + "VCPKG_TARGET_TRIPLET": "x64-linux", + "SCREENPLAY_STEAM": "OFF", + "SCREENPLAY_TESTS": "OFF" + } + }, + { + "name": "linux-relwithdebinfo", + "displayName": "ScreenPlay 64bit RelWithDebInfo Linux", + "inherits": "linux-generic-debug", + "binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_GCC_RelWithDebInfo", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "linux-aqt-debug", + "displayName": "ScreenPlay 64bit Debug Linux using aqt", + "description": "Linux only!", + "generator": "Ninja", + "binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_GCC_Debug", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, "environment": { "qt_path": "${sourceDir}/../aqt" }, @@ -101,9 +135,9 @@ } }, { - "name": "linux-relwithdebinfo", - "displayName": "ScreenPlay 64bit RelWithDebInfo Linux", - "inherits": "linux-debug", + "name": "linux-aqt-relwithdebinfo", + "displayName": "ScreenPlay 64bit RelWithDebInfo Linux using aqt", + "inherits": "linux-ubuntu-debug", "binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_GCC_RelWithDebInfo", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" From af2ae7150d825a33b1be85b36b6a1deefb718eb4 Mon Sep 17 00:00:00 2001 From: Rurigk Date: Fri, 8 Sep 2023 01:26:41 -0600 Subject: [PATCH 4/6] Remove ld.gold linker --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afcad827..d7c5b7a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,8 +111,8 @@ add_compile_definitions(GIT_COMMIT_HASH="${GIT_COMMIT_HASH}") if(UNIX AND NOT APPLE) # Fixes QWebEngine linker errors on Ubuntu 20.04 - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() add_subdirectory(ThirdParty) From 9ba9efeba7e8dd30d207d0246b3ff7aaeb04d673 Mon Sep 17 00:00:00 2001 From: Rurigk Date: Fri, 8 Sep 2023 01:27:05 -0600 Subject: [PATCH 5/6] Fix MultimediaView not loading on linux --- ScreenPlayWallpaper/qml/Wallpaper.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScreenPlayWallpaper/qml/Wallpaper.qml b/ScreenPlayWallpaper/qml/Wallpaper.qml index 62b727f7..25063a36 100644 --- a/ScreenPlayWallpaper/qml/Wallpaper.qml +++ b/ScreenPlayWallpaper/qml/Wallpaper.qml @@ -27,7 +27,7 @@ Rectangle { loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml"; } } - if (Qt.platform.os === "windows") { + if (Qt.platform.os === "windows" || Qt.platform.os === "linux") { loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml"; } break; From 1bc9701979ec872620776debafeffa1922572938 Mon Sep 17 00:00:00 2001 From: Rurigk Date: Fri, 8 Sep 2023 16:36:07 -0600 Subject: [PATCH 6/6] Remove unnecessary linker flags --- CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7c5b7a9..ff38f87c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,12 +109,6 @@ add_compile_definitions(BUILD_DATE="${BUILD_DATE}") add_compile_definitions(GIT_BRANCH_NAME="${GIT_BRANCH_NAME}") add_compile_definitions(GIT_COMMIT_HASH="${GIT_COMMIT_HASH}") -if(UNIX AND NOT APPLE) - # Fixes QWebEngine linker errors on Ubuntu 20.04 - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -endif() - add_subdirectory(ThirdParty) set(ECM_DIR "${THIRD_PARTY_PATH}/ecm") add_subdirectory(CMake)