From 9b02b948058182d9e2cd14e80b924cf1bdfa635a Mon Sep 17 00:00:00 2001 From: Artur Mukhamadiev Date: Thu, 3 Jul 2025 21:23:59 +0300 Subject: [PATCH] meson setup --- CMakeLists.txt | 12 ------------ CMakePresets.json | 17 ----------------- cmake/FindWayland.cmake | 33 --------------------------------- meson.build | 8 ++++++++ subprojects/wayland.wrap | 13 +++++++++++++ 5 files changed, 21 insertions(+), 62 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 CMakePresets.json delete mode 100644 cmake/FindWayland.cmake create mode 100644 meson.build create mode 100644 subprojects/wayland.wrap diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index c85af83..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ - -cmake_minimum_required(VERSION 3.20) -project(wayland-cli) - -add_executable(${PROJECT_NAME}) - -target_sources(${PROJECT_NAME} PRIVATE main.cc) - -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -find_package(Wayland REQUIRED) - -target_link_libraries(${PROJECT_NAME} Wayland::Wayland) diff --git a/CMakePresets.json b/CMakePresets.json deleted file mode 100644 index bc83fa6..0000000 --- a/CMakePresets.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": 8, - "configurePresets": [ - { - "name": "base-gcc", - "displayName": "Basic gcc preset", - "description": "Using compilers: C = /usr/bin/gcc, CXX = /usr/bin/g++", - "binaryDir": "${sourceDir}/build/${presetName}", - "cacheVariables": { - "CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}", - "CMAKE_C_COMPILER": "/usr/bin/gcc", - "CMAKE_CXX_COMPILER": "/usr/bin/g++", - "CMAKE_BUILD_TYPE": "Debug" - } - } - ] -} \ No newline at end of file diff --git a/cmake/FindWayland.cmake b/cmake/FindWayland.cmake deleted file mode 100644 index 567c3a9..0000000 --- a/cmake/FindWayland.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# Find the Wayland package -find_path(WAYLAND_INCLUDE_DIR - NAMES wayland-client.h - PATH_SUFFIXES wayland -) - -find_library(WAYLAND_LIBRARY - NAMES wayland-client -) - -find_library(WAYLAND_EGL_LIBRARY - NAMES wayland-egl -) - -# Handle the QUIETLY and REQUIRED arguments and set WAYLAND_FOUND to TRUE if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Wayland - DEFAULT_MSG - WAYLAND_LIBRARY - WAYLAND_EGL_LIBRARY - WAYLAND_INCLUDE_DIR) - -if(WAYLAND_FOUND) - add_library(Wayland::Wayland INTERFACE IMPORTED) - - set(WAYLAND_LIBRARIES ${WAYLAND_LIBRARY} ${WAYLAND_EGL_LIBRARY}) - set_target_properties(Wayland::Wayland PROPERTIES - INTERFACE_LINK_LIBRARIES "${WAYLAND_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${WAYLAND_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced(WAYLAND_INCLUDE_DIR WAYLAND_LIBRARY) \ No newline at end of file diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..8c73366 --- /dev/null +++ b/meson.build @@ -0,0 +1,8 @@ +project('wl-cli', 'cpp') + +client = dependency('wayland-client') +egl = dependency('wayland-egl') + +src = ['main.cc'] + +executable('wl-cli', sources : src, dependencies : [client, egl]) \ No newline at end of file diff --git a/subprojects/wayland.wrap b/subprojects/wayland.wrap new file mode 100644 index 0000000..6ced203 --- /dev/null +++ b/subprojects/wayland.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = wayland-1.23.1 +source_url = https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.23.1/downloads/wayland-1.23.1.tar.xz +source_filename = wayland-1.23.1.tar.xz +source_hash = 864fb2a8399e2d0ec39d56e9d9b753c093775beadc6022ce81f441929a81e5ed +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/wayland_1.23.1-1/wayland-1.23.1.tar.xz +wrapdb_version = 1.23.1-1 + +[provide] +wayland-cursor = wayland_cursor_dep +wayland-egl = wayland_egl_dep +wayland-server = wayland_server_dep +wayland-client = wayland_client_dep