commit a77a5ec4c95e7bf3168e3c860afb55ab43bc3c5f Author: Artur Mukhamadiev Date: Fri Feb 14 15:37:44 2025 +0300 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7194ea7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.cache +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a467b14 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ + +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) + +include_directories(${WAYLAND_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} ${WAYLAND_LIBRARIES}) diff --git a/cmake/FindWayland.cmake b/cmake/FindWayland.cmake new file mode 100644 index 0000000..7201d92 --- /dev/null +++ b/cmake/FindWayland.cmake @@ -0,0 +1,24 @@ +# 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_INCLUDE_DIR) + +if(WAYLAND_FOUND) + set(WAYLAND_LIBRARIES ${WAYLAND_LIBRARY} ${WAYLAND_EGL_LIBRARY}) + set(WAYLAND_INCLUDE_DIRS ${WAYLAND_INCLUDE_DIR}) +endif() + +mark_as_advanced(WAYLAND_INCLUDE_DIR WAYLAND_LIBRARY) \ No newline at end of file diff --git a/main.cc b/main.cc new file mode 100644 index 0000000..100b720 --- /dev/null +++ b/main.cc @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + wl_display* display = wl_display_connect(nullptr); + + if (display) { + std::cout << "found\n"; + } else { + std::cout << "not found\n"; + } + + return 0; +} \ No newline at end of file