From bbc7caaae7199fa1feed7232b232c4625efe6932 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 21 Apr 2023 09:51:08 +0300 Subject: [PATCH] scripts: Encapsulate cmake code --- src/scripts/CMakeLists.txt | 14 +++++++------- src/scripts/desktopchangeosd/CMakeLists.txt | 1 + .../{ => package}/contents/ui/main.qml | 0 .../{ => package}/contents/ui/osd.qml | 0 .../desktopchangeosd/{ => package}/metadata.json | 0 src/scripts/minimizeall/CMakeLists.txt | 1 + .../{ => package}/contents/code/main.js | 0 .../minimizeall/{ => package}/metadata.json | 0 src/scripts/synchronizeskipswitcher/CMakeLists.txt | 1 + .../{ => package}/contents/code/main.js | 0 .../{ => package}/metadata.json | 0 src/scripts/videowall/CMakeLists.txt | 1 + .../videowall/{ => package}/contents/code/main.js | 0 .../{ => package}/contents/config/main.xml | 0 .../videowall/{ => package}/contents/ui/config.ui | 0 src/scripts/videowall/{ => package}/metadata.json | 0 16 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 src/scripts/desktopchangeosd/CMakeLists.txt rename src/scripts/desktopchangeosd/{ => package}/contents/ui/main.qml (100%) rename src/scripts/desktopchangeosd/{ => package}/contents/ui/osd.qml (100%) rename src/scripts/desktopchangeosd/{ => package}/metadata.json (100%) create mode 100644 src/scripts/minimizeall/CMakeLists.txt rename src/scripts/minimizeall/{ => package}/contents/code/main.js (100%) rename src/scripts/minimizeall/{ => package}/metadata.json (100%) create mode 100644 src/scripts/synchronizeskipswitcher/CMakeLists.txt rename src/scripts/synchronizeskipswitcher/{ => package}/contents/code/main.js (100%) rename src/scripts/synchronizeskipswitcher/{ => package}/metadata.json (100%) create mode 100644 src/scripts/videowall/CMakeLists.txt rename src/scripts/videowall/{ => package}/contents/code/main.js (100%) rename src/scripts/videowall/{ => package}/contents/config/main.xml (100%) rename src/scripts/videowall/{ => package}/contents/ui/config.ui (100%) rename src/scripts/videowall/{ => package}/metadata.json (100%) diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 66b6c3ccd2..68250cad6d 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -1,12 +1,12 @@ -function(add_kwin_script name) - kpackage_install_package(${name} ${name} scripts kwin) +function(kwin_add_script name source) + kpackage_install_package(${source} ${name} scripts kwin) # Copy the script to the build directory so one can run tests without prior # make install. FIXME: use add_custom_command. - file(COPY ${name} DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/scripts/) + file(COPY ${source}/contents ${source}/metadata.json DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/scripts/${name}) endfunction() -add_kwin_script(videowall) -add_kwin_script(synchronizeskipswitcher) -add_kwin_script(desktopchangeosd) -add_kwin_script(minimizeall) +add_subdirectory(desktopchangeosd) +add_subdirectory(minimizeall) +add_subdirectory(synchronizeskipswitcher) +add_subdirectory(videowall) diff --git a/src/scripts/desktopchangeosd/CMakeLists.txt b/src/scripts/desktopchangeosd/CMakeLists.txt new file mode 100644 index 0000000000..32a6233649 --- /dev/null +++ b/src/scripts/desktopchangeosd/CMakeLists.txt @@ -0,0 +1 @@ +kwin_add_script(desktopchangeosd package) diff --git a/src/scripts/desktopchangeosd/contents/ui/main.qml b/src/scripts/desktopchangeosd/package/contents/ui/main.qml similarity index 100% rename from src/scripts/desktopchangeosd/contents/ui/main.qml rename to src/scripts/desktopchangeosd/package/contents/ui/main.qml diff --git a/src/scripts/desktopchangeosd/contents/ui/osd.qml b/src/scripts/desktopchangeosd/package/contents/ui/osd.qml similarity index 100% rename from src/scripts/desktopchangeosd/contents/ui/osd.qml rename to src/scripts/desktopchangeosd/package/contents/ui/osd.qml diff --git a/src/scripts/desktopchangeosd/metadata.json b/src/scripts/desktopchangeosd/package/metadata.json similarity index 100% rename from src/scripts/desktopchangeosd/metadata.json rename to src/scripts/desktopchangeosd/package/metadata.json diff --git a/src/scripts/minimizeall/CMakeLists.txt b/src/scripts/minimizeall/CMakeLists.txt new file mode 100644 index 0000000000..8d7f9a2de3 --- /dev/null +++ b/src/scripts/minimizeall/CMakeLists.txt @@ -0,0 +1 @@ +kwin_add_script(minimizeall package) diff --git a/src/scripts/minimizeall/contents/code/main.js b/src/scripts/minimizeall/package/contents/code/main.js similarity index 100% rename from src/scripts/minimizeall/contents/code/main.js rename to src/scripts/minimizeall/package/contents/code/main.js diff --git a/src/scripts/minimizeall/metadata.json b/src/scripts/minimizeall/package/metadata.json similarity index 100% rename from src/scripts/minimizeall/metadata.json rename to src/scripts/minimizeall/package/metadata.json diff --git a/src/scripts/synchronizeskipswitcher/CMakeLists.txt b/src/scripts/synchronizeskipswitcher/CMakeLists.txt new file mode 100644 index 0000000000..a5d280a6d8 --- /dev/null +++ b/src/scripts/synchronizeskipswitcher/CMakeLists.txt @@ -0,0 +1 @@ +kwin_add_script(synchronizeskipswitcher package) diff --git a/src/scripts/synchronizeskipswitcher/contents/code/main.js b/src/scripts/synchronizeskipswitcher/package/contents/code/main.js similarity index 100% rename from src/scripts/synchronizeskipswitcher/contents/code/main.js rename to src/scripts/synchronizeskipswitcher/package/contents/code/main.js diff --git a/src/scripts/synchronizeskipswitcher/metadata.json b/src/scripts/synchronizeskipswitcher/package/metadata.json similarity index 100% rename from src/scripts/synchronizeskipswitcher/metadata.json rename to src/scripts/synchronizeskipswitcher/package/metadata.json diff --git a/src/scripts/videowall/CMakeLists.txt b/src/scripts/videowall/CMakeLists.txt new file mode 100644 index 0000000000..83c9855008 --- /dev/null +++ b/src/scripts/videowall/CMakeLists.txt @@ -0,0 +1 @@ +kwin_add_script(videowall package) diff --git a/src/scripts/videowall/contents/code/main.js b/src/scripts/videowall/package/contents/code/main.js similarity index 100% rename from src/scripts/videowall/contents/code/main.js rename to src/scripts/videowall/package/contents/code/main.js diff --git a/src/scripts/videowall/contents/config/main.xml b/src/scripts/videowall/package/contents/config/main.xml similarity index 100% rename from src/scripts/videowall/contents/config/main.xml rename to src/scripts/videowall/package/contents/config/main.xml diff --git a/src/scripts/videowall/contents/ui/config.ui b/src/scripts/videowall/package/contents/ui/config.ui similarity index 100% rename from src/scripts/videowall/contents/ui/config.ui rename to src/scripts/videowall/package/contents/ui/config.ui diff --git a/src/scripts/videowall/metadata.json b/src/scripts/videowall/package/metadata.json similarity index 100% rename from src/scripts/videowall/metadata.json rename to src/scripts/videowall/package/metadata.json