From c6dde9ca9d43e3b09b303a1b74858a41998f73c4 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Mon, 19 Feb 2024 00:52:03 -0800 Subject: [PATCH] refactor(wayland): seperate cmake files for modularity --- CMakeLists.txt | 34 +-------------------------- src/core/CMakeLists.txt | 31 ++++++++++++++++++++++++ src/{cpp => core}/layershell.cpp | 0 src/{cpp => core}/layershell.hpp | 0 src/{cpp => core}/main.cpp | 0 src/{cpp => core}/module.md | 0 src/{cpp => core}/persistentprops.cpp | 0 src/{cpp => core}/persistentprops.hpp | 0 src/{cpp => core}/proxywindow.cpp | 0 src/{cpp => core}/proxywindow.hpp | 0 src/{cpp => core}/qmlglobal.cpp | 0 src/{cpp => core}/qmlglobal.hpp | 0 src/{cpp => core}/qmlscreen.cpp | 0 src/{cpp => core}/qmlscreen.hpp | 0 src/{cpp => core}/region.cpp | 0 src/{cpp => core}/region.hpp | 0 src/{cpp => core}/reload.cpp | 0 src/{cpp => core}/reload.hpp | 0 src/{cpp => core}/rootwrapper.cpp | 0 src/{cpp => core}/rootwrapper.hpp | 0 src/{cpp => core}/shell.cpp | 0 src/{cpp => core}/shell.hpp | 0 src/{cpp => core}/shellwindow.cpp | 0 src/{cpp => core}/shellwindow.hpp | 0 src/{cpp => core}/variants.cpp | 0 src/{cpp => core}/variants.hpp | 0 src/{cpp => core}/watcher.cpp | 0 src/{cpp => core}/watcher.hpp | 0 28 files changed, 32 insertions(+), 33 deletions(-) create mode 100644 src/core/CMakeLists.txt rename src/{cpp => core}/layershell.cpp (100%) rename src/{cpp => core}/layershell.hpp (100%) rename src/{cpp => core}/main.cpp (100%) rename src/{cpp => core}/module.md (100%) rename src/{cpp => core}/persistentprops.cpp (100%) rename src/{cpp => core}/persistentprops.hpp (100%) rename src/{cpp => core}/proxywindow.cpp (100%) rename src/{cpp => core}/proxywindow.hpp (100%) rename src/{cpp => core}/qmlglobal.cpp (100%) rename src/{cpp => core}/qmlglobal.hpp (100%) rename src/{cpp => core}/qmlscreen.cpp (100%) rename src/{cpp => core}/qmlscreen.hpp (100%) rename src/{cpp => core}/region.cpp (100%) rename src/{cpp => core}/region.hpp (100%) rename src/{cpp => core}/reload.cpp (100%) rename src/{cpp => core}/reload.hpp (100%) rename src/{cpp => core}/rootwrapper.cpp (100%) rename src/{cpp => core}/rootwrapper.hpp (100%) rename src/{cpp => core}/shell.cpp (100%) rename src/{cpp => core}/shell.hpp (100%) rename src/{cpp => core}/shellwindow.cpp (100%) rename src/{cpp => core}/shellwindow.hpp (100%) rename src/{cpp => core}/variants.cpp (100%) rename src/{cpp => core}/variants.hpp (100%) rename src/{cpp => core}/watcher.cpp (100%) rename src/{cpp => core}/watcher.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ee0b797..12894163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,38 +21,6 @@ endif() find_package(Qt6 REQUIRED COMPONENTS Gui Qml Quick QuickControls2) -if (LAYERSHELL) - find_package(LayerShellQt REQUIRED) -endif() - qt_standard_project_setup(REQUIRES 6.6) -qt_add_executable(quickshell - src/cpp/main.cpp - src/cpp/shell.cpp - src/cpp/variants.cpp - src/cpp/rootwrapper.cpp - src/cpp/proxywindow.cpp - src/cpp/reload.cpp - src/cpp/rootwrapper.cpp - src/cpp/qmlglobal.cpp - src/cpp/qmlscreen.cpp - src/cpp/watcher.cpp - src/cpp/region.cpp - src/cpp/persistentprops.cpp - src/cpp/shellwindow.cpp -) - -qt_add_qml_module(quickshell URI QuickShell) - -# qml type registration requires this -target_include_directories(quickshell PRIVATE src/cpp) - -target_link_libraries(quickshell PRIVATE Qt6::Gui Qt6::Qml Qt6::Quick Qt6::QuickControls2) - -if (LAYERSHELL) - target_link_libraries(quickshell PRIVATE LayerShellQtInterface) - target_compile_definitions(quickshell PRIVATE CONF_LAYERSHELL) - - target_sources(quickshell PRIVATE src/cpp/layershell.cpp) -endif() +add_subdirectory(src/core) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 00000000..d5cd27de --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,31 @@ +qt_add_executable(quickshell + main.cpp + shell.cpp + variants.cpp + rootwrapper.cpp + proxywindow.cpp + reload.cpp + rootwrapper.cpp + qmlglobal.cpp + qmlscreen.cpp + watcher.cpp + region.cpp + persistentprops.cpp + shellwindow.cpp +) + +qt_add_qml_module(quickshell URI QuickShell) + +# qml type registration requires this +target_include_directories(quickshell PRIVATE src/core) + +target_link_libraries(quickshell PRIVATE Qt6::Gui Qt6::Qml Qt6::Quick Qt6::QuickControls2) + +if (LAYERSHELL) + find_package(LayerShellQt REQUIRED) + + target_link_libraries(quickshell PRIVATE LayerShellQtInterface) + target_compile_definitions(quickshell PRIVATE CONF_LAYERSHELL) + + target_sources(quickshell PRIVATE layershell.cpp) +endif() diff --git a/src/cpp/layershell.cpp b/src/core/layershell.cpp similarity index 100% rename from src/cpp/layershell.cpp rename to src/core/layershell.cpp diff --git a/src/cpp/layershell.hpp b/src/core/layershell.hpp similarity index 100% rename from src/cpp/layershell.hpp rename to src/core/layershell.hpp diff --git a/src/cpp/main.cpp b/src/core/main.cpp similarity index 100% rename from src/cpp/main.cpp rename to src/core/main.cpp diff --git a/src/cpp/module.md b/src/core/module.md similarity index 100% rename from src/cpp/module.md rename to src/core/module.md diff --git a/src/cpp/persistentprops.cpp b/src/core/persistentprops.cpp similarity index 100% rename from src/cpp/persistentprops.cpp rename to src/core/persistentprops.cpp diff --git a/src/cpp/persistentprops.hpp b/src/core/persistentprops.hpp similarity index 100% rename from src/cpp/persistentprops.hpp rename to src/core/persistentprops.hpp diff --git a/src/cpp/proxywindow.cpp b/src/core/proxywindow.cpp similarity index 100% rename from src/cpp/proxywindow.cpp rename to src/core/proxywindow.cpp diff --git a/src/cpp/proxywindow.hpp b/src/core/proxywindow.hpp similarity index 100% rename from src/cpp/proxywindow.hpp rename to src/core/proxywindow.hpp diff --git a/src/cpp/qmlglobal.cpp b/src/core/qmlglobal.cpp similarity index 100% rename from src/cpp/qmlglobal.cpp rename to src/core/qmlglobal.cpp diff --git a/src/cpp/qmlglobal.hpp b/src/core/qmlglobal.hpp similarity index 100% rename from src/cpp/qmlglobal.hpp rename to src/core/qmlglobal.hpp diff --git a/src/cpp/qmlscreen.cpp b/src/core/qmlscreen.cpp similarity index 100% rename from src/cpp/qmlscreen.cpp rename to src/core/qmlscreen.cpp diff --git a/src/cpp/qmlscreen.hpp b/src/core/qmlscreen.hpp similarity index 100% rename from src/cpp/qmlscreen.hpp rename to src/core/qmlscreen.hpp diff --git a/src/cpp/region.cpp b/src/core/region.cpp similarity index 100% rename from src/cpp/region.cpp rename to src/core/region.cpp diff --git a/src/cpp/region.hpp b/src/core/region.hpp similarity index 100% rename from src/cpp/region.hpp rename to src/core/region.hpp diff --git a/src/cpp/reload.cpp b/src/core/reload.cpp similarity index 100% rename from src/cpp/reload.cpp rename to src/core/reload.cpp diff --git a/src/cpp/reload.hpp b/src/core/reload.hpp similarity index 100% rename from src/cpp/reload.hpp rename to src/core/reload.hpp diff --git a/src/cpp/rootwrapper.cpp b/src/core/rootwrapper.cpp similarity index 100% rename from src/cpp/rootwrapper.cpp rename to src/core/rootwrapper.cpp diff --git a/src/cpp/rootwrapper.hpp b/src/core/rootwrapper.hpp similarity index 100% rename from src/cpp/rootwrapper.hpp rename to src/core/rootwrapper.hpp diff --git a/src/cpp/shell.cpp b/src/core/shell.cpp similarity index 100% rename from src/cpp/shell.cpp rename to src/core/shell.cpp diff --git a/src/cpp/shell.hpp b/src/core/shell.hpp similarity index 100% rename from src/cpp/shell.hpp rename to src/core/shell.hpp diff --git a/src/cpp/shellwindow.cpp b/src/core/shellwindow.cpp similarity index 100% rename from src/cpp/shellwindow.cpp rename to src/core/shellwindow.cpp diff --git a/src/cpp/shellwindow.hpp b/src/core/shellwindow.hpp similarity index 100% rename from src/cpp/shellwindow.hpp rename to src/core/shellwindow.hpp diff --git a/src/cpp/variants.cpp b/src/core/variants.cpp similarity index 100% rename from src/cpp/variants.cpp rename to src/core/variants.cpp diff --git a/src/cpp/variants.hpp b/src/core/variants.hpp similarity index 100% rename from src/cpp/variants.hpp rename to src/core/variants.hpp diff --git a/src/cpp/watcher.cpp b/src/core/watcher.cpp similarity index 100% rename from src/cpp/watcher.cpp rename to src/core/watcher.cpp diff --git a/src/cpp/watcher.hpp b/src/core/watcher.hpp similarity index 100% rename from src/cpp/watcher.hpp rename to src/core/watcher.hpp