Files
Nebula-OS/shells/desktop/shell/CMakeLists.txt
T
andrew 2f59d3c115 Add Nebula.Windows with Sway IPC backend
Introduces a new `core/windows` module (`Nebula.Windows`) with `WindowService`, window/workspace models, and a Sway IPC backend for live window tracking and control (focus, close, move/resize, snap, maximize/restore, minimize, workspace switch). The desktop shell now links this module, uses compositor focus for top-bar active app text, and adds an Open Windows section in the launcher with focus/close actions.

Also updates application metadata handling to parse `StartupWMClass` and map window `app_id`/class to friendly names and icons, and revises Sway config/docs for the new floating-first Desktop 0.2 behavior with temporary compositor-provided decorations.
2026-08-26 18:20:56 +12:00

142 lines
3.9 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(nebula-shell LANGUAGES CXX)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(FATAL_ERROR
"nebula-shell is a Linux Wayland shell using LayerShellQt.\n"
"Build and run it on the Ubuntu NebulaOS VM. Windows is not a supported target, "
"and LayerShellQt is not stubbed with other platform APIs.")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Qt6 6.4 REQUIRED COMPONENTS Core Gui Qml Quick Network)
find_package(LayerShellQt REQUIRED)
qt_standard_project_setup(REQUIRES 6.4)
set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml")
add_subdirectory(
"${CMAKE_CURRENT_SOURCE_DIR}/../../../packages/nebula-ui"
"${CMAKE_CURRENT_BINARY_DIR}/nebula-ui"
)
add_subdirectory(
"${CMAKE_CURRENT_SOURCE_DIR}/../../../core/applications"
"${CMAKE_CURRENT_BINARY_DIR}/nebula-applications"
)
add_subdirectory(
"${CMAKE_CURRENT_SOURCE_DIR}/../../../core/windows"
"${CMAKE_CURRENT_BINARY_DIR}/nebula-windows"
)
qt_add_executable(nebula-shell
src/main.cpp
src/DesktopIconProvider.cpp
src/DesktopIconProvider.hpp
)
set(NEBULA_SHELL_QML_FILES
qml/Main.qml
qml/ShellState.qml
qml/surfaces/DesktopSurface.qml
qml/surfaces/TopBarSurface.qml
qml/surfaces/LauncherSurface.qml
qml/components/TopBar.qml
qml/components/NebulaButton.qml
qml/components/Clock.qml
qml/components/SystemArea.qml
qml/components/Launcher.qml
qml/components/AppItem.qml
qml/components/OpenWindowItem.qml
qml/mock/MockApps.qml
)
foreach(qml_file IN LISTS NEBULA_SHELL_QML_FILES)
get_filename_component(qml_name "${qml_file}" NAME)
set_source_files_properties("${qml_file}" PROPERTIES
QT_RESOURCE_ALIAS "${qml_name}"
)
endforeach()
set_source_files_properties(qml/ShellState.qml PROPERTIES
QT_QML_SINGLETON_TYPE TRUE
QT_RESOURCE_ALIAS ShellState.qml
)
set_source_files_properties(qml/mock/MockApps.qml PROPERTIES
QT_QML_SINGLETON_TYPE TRUE
QT_RESOURCE_ALIAS MockApps.qml
)
qt_add_qml_module(nebula-shell
URI Nebula.Shell
VERSION 1.0
RESOURCE_PREFIX /qt/qml
QML_FILES ${NEBULA_SHELL_QML_FILES}
SOURCES
src/OutputTracker.hpp
src/OutputTracker.cpp
DEPENDENCIES
QtQuick
Nebula.UI
Nebula.Applications
Nebula.Windows
)
target_link_libraries(nebula-shell
PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Qml
Qt6::Quick
LayerShellQt::Interface
NebulaUI
NebulaApplications
NebulaWindows
)
if(TARGET NebulaUIplugin)
target_link_libraries(nebula-shell PRIVATE NebulaUIplugin)
endif()
if(TARGET NebulaApplicationsplugin)
target_link_libraries(nebula-shell PRIVATE NebulaApplicationsplugin)
endif()
if(TARGET NebulaWindowsplugin)
target_link_libraries(nebula-shell PRIVATE NebulaWindowsplugin)
endif()
# Generated nebula-shell_qmltyperegistrations.cpp includes "OutputTracker.hpp"
# via __has_include. Keep src/ on the include path so that succeeds.
target_include_directories(nebula-shell PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/src"
)
set_source_files_properties(
"${CMAKE_CURRENT_BINARY_DIR}/nebula-shell_qmltyperegistrations.cpp"
PROPERTIES
COMPILE_OPTIONS "-include;${CMAKE_CURRENT_SOURCE_DIR}/src/OutputTracker.hpp"
)
set_target_properties(nebula-shell PROPERTIES
OUTPUT_NAME nebula-shell
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
# Shared Qt discovers QML plugins at runtime. Skip qmlimportscanner / static
# plugin importing so Qt 6.8+ does not warn about missing Qt6::*plugin targets.
if(QT6_IS_SHARED_LIBS_BUILD)
set_target_properties(nebula-shell PROPERTIES
QT_QML_MODULE_NO_IMPORT_SCAN TRUE
)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(nebula-shell PRIVATE -Wall -Wextra)
endif()