2024-01-09 02:42:04 +03:00
|
|
|
cmake_minimum_required(VERSION 3.7)
|
2023-12-28 21:31:57 +03:00
|
|
|
cmake_policy(SET CMP0015 NEW)
|
|
|
|
cmake_policy(SET CMP0022 NEW)
|
|
|
|
|
|
|
|
project(miracle-wm)
|
2023-02-18 20:06:27 +03:00
|
|
|
|
2024-05-02 17:14:16 +03:00
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
2023-02-18 20:06:27 +03:00
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
2024-08-09 16:54:39 +03:00
|
|
|
set(MIR_LIBRARIES_PKGCONFIG_DIRECTORY "" CACHE STRING "Search for Mir libraries pc files in this directory")
|
2024-04-23 13:43:28 +03:00
|
|
|
option(SNAP_BUILD "Building as a snap?" OFF)
|
2024-09-07 16:07:58 +03:00
|
|
|
option(SYSTEMD_INTEGRATION "Specifies that the systemd integration script will run at startup" OFF)
|
2024-04-23 13:43:28 +03:00
|
|
|
|
2024-08-09 16:54:39 +03:00
|
|
|
set(ENV{PKG_CONFIG_PATH} "${MIR_LIBRARIES_PKGCONFIG_DIRECTORY}:/usr/local/lib/pkgconfig/")
|
|
|
|
|
2023-02-18 21:10:42 +03:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(MIRAL miral REQUIRED)
|
2024-05-04 00:19:02 +03:00
|
|
|
pkg_check_modules(MIROIL miroil REQUIRED)
|
|
|
|
pkg_check_modules(MIRRENDERER mirrenderer REQUIRED)
|
|
|
|
pkg_check_modules(MIRPLATFORM mirplatform REQUIRED)
|
2024-05-02 17:14:16 +03:00
|
|
|
pkg_check_modules(MIRCOMMON mircommon REQUIRED)
|
|
|
|
pkg_check_modules(MIRCOMMON_INTERNAL mircommon-internal REQUIRED)
|
|
|
|
pkg_check_modules(MIRSERVER mirserver REQUIRED)
|
|
|
|
pkg_check_modules(MIRSERVER_INTERNAL mirserver-internal REQUIRED)
|
2024-08-09 16:54:39 +03:00
|
|
|
pkg_check_modules(MIRWAYLAND mirwayland REQUIRED)
|
2024-01-28 19:18:36 +03:00
|
|
|
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
|
|
|
pkg_check_modules(YAML REQUIRED IMPORTED_TARGET yaml-cpp)
|
2024-01-30 02:10:02 +03:00
|
|
|
pkg_check_modules(LIBEVDEV REQUIRED IMPORTED_TARGET libevdev)
|
2024-02-22 02:54:59 +03:00
|
|
|
find_package(nlohmann_json 3.2.0 REQUIRED)
|
2024-02-26 21:48:59 +03:00
|
|
|
pkg_check_modules(LIBNOTIFY REQUIRED IMPORTED_TARGET libnotify)
|
2024-05-04 00:19:02 +03:00
|
|
|
pkg_check_modules(EGL REQUIRED IMPORTED_TARGET egl)
|
|
|
|
pkg_check_modules(GLESv2 REQUIRED IMPORTED_TARGET glesv2)
|
2023-02-18 21:10:42 +03:00
|
|
|
|
2024-02-25 18:27:29 +03:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2024-03-10 23:40:26 +03:00
|
|
|
add_library(miracle-wm-implementation
|
2024-04-02 22:09:21 +03:00
|
|
|
STATIC
|
2024-03-02 15:47:11 +03:00
|
|
|
src/policy.cpp
|
2024-04-02 21:19:57 +03:00
|
|
|
src/tiling_window_tree.cpp
|
2024-07-03 23:49:17 +03:00
|
|
|
src/container.cpp
|
2024-01-07 16:19:28 +03:00
|
|
|
src/window_helpers.h
|
|
|
|
src/window_helpers.cpp
|
2024-08-25 23:46:43 +03:00
|
|
|
src/config.cpp
|
|
|
|
src/config.h
|
2024-07-14 23:42:20 +03:00
|
|
|
src/output.cpp
|
2024-02-07 16:05:09 +03:00
|
|
|
src/workspace_manager.cpp
|
2024-02-22 02:54:59 +03:00
|
|
|
src/ipc.cpp
|
2024-02-15 22:09:27 +03:00
|
|
|
src/auto_restarting_launcher.cpp
|
2024-02-22 02:54:59 +03:00
|
|
|
src/workspace_observer.cpp
|
2024-07-14 23:42:20 +03:00
|
|
|
src/workspace.cpp
|
2024-07-03 23:49:17 +03:00
|
|
|
src/leaf_container.cpp
|
|
|
|
src/parent_container.cpp
|
2024-07-14 23:42:20 +03:00
|
|
|
src/window_manager_tools_window_controller.cpp
|
2024-05-04 00:19:02 +03:00
|
|
|
src/renderer.cpp
|
|
|
|
src/tessellation_helpers.cpp
|
|
|
|
src/miracle_gl_config.cpp
|
2024-05-02 17:14:16 +03:00
|
|
|
src/i3_command.cpp
|
|
|
|
src/i3_command_executor.cpp
|
2024-05-04 00:19:02 +03:00
|
|
|
src/surface_tracker.cpp
|
|
|
|
src/window_tools_accessor.cpp
|
2024-05-08 14:55:39 +03:00
|
|
|
src/animator.cpp
|
2024-05-10 22:20:02 +03:00
|
|
|
src/animation_definition.cpp
|
2024-05-28 01:58:54 +03:00
|
|
|
src/program_factory.cpp
|
2024-06-14 14:44:15 +03:00
|
|
|
src/mode_observer.cpp
|
2024-06-22 21:01:55 +03:00
|
|
|
src/debug_helper.h
|
2024-08-25 23:46:43 +03:00
|
|
|
src/floating_window_container.cpp
|
2024-08-02 16:50:03 +03:00
|
|
|
src/shell_component_container.cpp
|
2024-08-25 23:46:43 +03:00
|
|
|
src/container_group_container.cpp
|
|
|
|
src/container_group_container.h
|
|
|
|
src/floating_tree_container.cpp
|
|
|
|
src/floating_tree_container.h
|
2024-10-07 20:54:13 +03:00
|
|
|
src/layout_scheme.cpp
|
2024-10-11 02:46:00 +03:00
|
|
|
src/utility_general.h
|
2024-10-26 10:48:12 +03:00
|
|
|
src/minimal_window_manager.cpp src/minimal_window_manager.h
|
2023-10-27 23:26:34 +03:00
|
|
|
)
|
2023-02-18 21:25:18 +03:00
|
|
|
|
2024-03-10 23:40:26 +03:00
|
|
|
add_executable(miracle-wm
|
|
|
|
src/main.cpp
|
|
|
|
)
|
|
|
|
|
2024-05-02 17:14:16 +03:00
|
|
|
target_include_directories(miracle-wm-implementation PUBLIC SYSTEM
|
|
|
|
${MIRAL_INCLUDE_DIRS}
|
2024-05-04 00:19:02 +03:00
|
|
|
${MIROIL_INCLUDE_DIRS}
|
2024-05-02 17:14:16 +03:00
|
|
|
${MIRCOMMON_INCLUDE_DIRS}
|
2024-05-04 00:19:02 +03:00
|
|
|
${MIRRENDERER_INCLUDE_DIRS}
|
|
|
|
${MIRPLATFORM_INCLUDE_DIRS}
|
2024-05-02 17:14:16 +03:00
|
|
|
${MIRCOMMON_INTERNAL_INCLUDE_DIRS}
|
|
|
|
${MIRSERVER_INTERNAL_INCLUDE_DIRS}
|
|
|
|
${MIRSERVER_INCLUDE_DIRS}
|
|
|
|
${PROJECT_SOURCE_DIR}/include)
|
2024-05-04 00:19:02 +03:00
|
|
|
|
2024-05-02 17:14:16 +03:00
|
|
|
target_link_libraries(miracle-wm-implementation
|
|
|
|
${MIRAL_LDFLAGS}
|
2024-05-04 00:19:02 +03:00
|
|
|
${MIROIL_LDFLAGS}
|
|
|
|
${MIRRENDERER_LDFLAGS}
|
|
|
|
${MIRPLATFORM_LDFLAGS}
|
2024-05-02 17:14:16 +03:00
|
|
|
${MIRSERVER_LDFLAGS}
|
2024-05-04 00:19:02 +03:00
|
|
|
${MIRSERVER_INTERNAL_LDFLAGS}
|
2024-08-09 16:54:39 +03:00
|
|
|
${MIRWAYLAND_LDFLAGS}
|
2024-05-02 17:14:16 +03:00
|
|
|
PkgConfig::YAML
|
|
|
|
PkgConfig::GLIB
|
|
|
|
PkgConfig::LIBEVDEV
|
|
|
|
PkgConfig::LIBNOTIFY
|
|
|
|
nlohmann_json::nlohmann_json
|
2024-05-04 00:19:02 +03:00
|
|
|
PkgConfig::EGL
|
|
|
|
PkgConfig::GLESv2
|
2024-05-02 17:14:16 +03:00
|
|
|
-lpcre2-8 -lpcre2-16 -lpcre2-32)
|
2023-12-28 21:31:57 +03:00
|
|
|
|
2024-09-07 16:07:58 +03:00
|
|
|
if(SYSTEMD_INTEGRATION)
|
|
|
|
# Install systemd files
|
|
|
|
install(FILES session/usr/lib/systemd/user/miracle-wm-session.target
|
|
|
|
session/usr/lib/systemd/user/miracle-wm-session-shutdown.target
|
|
|
|
DESTINATION /usr/lib/systemd/user/)
|
|
|
|
|
|
|
|
# Install the setup script
|
|
|
|
install(PROGRAMS session/usr/bin/libexec/miracle-wm-session-setup
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
|
|
|
|
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/miracle-wm-session.systemd.in miracle-wm-session @ONLY)
|
|
|
|
else()
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/miracle-wm-session.none.in miracle-wm-session @ONLY)
|
|
|
|
endif()
|
|
|
|
|
2024-03-10 23:40:26 +03:00
|
|
|
target_include_directories(miracle-wm PUBLIC SYSTEM ${MIRAL_INCLUDE_DIRS})
|
2024-04-02 22:09:21 +03:00
|
|
|
target_link_libraries(miracle-wm PUBLIC ${MIRAL_LDFLAGS} PRIVATE miracle-wm-implementation)
|
2024-03-10 23:40:26 +03:00
|
|
|
|
2023-12-28 21:31:57 +03:00
|
|
|
install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/miracle-wm
|
2024-02-25 18:27:29 +03:00
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
2023-12-28 21:48:11 +03:00
|
|
|
)
|
2024-01-09 02:42:04 +03:00
|
|
|
|
2024-04-02 22:09:21 +03:00
|
|
|
configure_file(session/usr/local/share/wayland-sessions/miracle-wm.desktop.in miracle-wm.desktop @ONLY)
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/miracle-wm.desktop
|
2024-02-25 18:27:29 +03:00
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/wayland-sessions)
|
2024-01-17 00:36:37 +03:00
|
|
|
|
2024-02-26 21:48:59 +03:00
|
|
|
add_custom_target(miracle-wm-sensible-terminal ALL
|
|
|
|
cp ${CMAKE_CURRENT_SOURCE_DIR}/src/miracle-wm-sensible-terminal ${CMAKE_BINARY_DIR}/bin
|
|
|
|
)
|
|
|
|
|
|
|
|
install(PROGRAMS
|
|
|
|
src/miracle-wm-sensible-terminal
|
2024-09-07 16:07:58 +03:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/miracle-wm-session
|
2024-02-26 21:48:59 +03:00
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
)
|
|
|
|
|
2024-04-23 13:43:28 +03:00
|
|
|
if(SNAP_BUILD)
|
|
|
|
add_custom_target(miracle-wm-unsnap ALL
|
|
|
|
cp ${CMAKE_CURRENT_SOURCE_DIR}/src/miracle-wm-unsnap ${CMAKE_BINARY_DIR}/bin
|
|
|
|
)
|
|
|
|
install(PROGRAMS
|
|
|
|
src/miracle-wm-unsnap
|
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2024-01-15 18:56:41 +03:00
|
|
|
add_subdirectory(tests/)
|
2024-09-03 22:35:39 +03:00
|
|
|
add_subdirectory(miraclemsg/)
|