diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindWaylandpp.cmake | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindWaylandpp.cmake')
-rw-r--r-- | cmake/modules/FindWaylandpp.cmake | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/cmake/modules/FindWaylandpp.cmake b/cmake/modules/FindWaylandpp.cmake new file mode 100644 index 0000000..ba229d7 --- /dev/null +++ b/cmake/modules/FindWaylandpp.cmake @@ -0,0 +1,68 @@ +# FindWaylandpp +# ------------- +# Finds the waylandpp library +# +# This will define the following variables:: +# +# WAYLANDPP_FOUND - the system has waylandpp +# WAYLANDPP_INCLUDE_DIRS - the waylandpp include directory +# WAYLANDPP_LIBRARIES - the waylandpp libraries +# WAYLANDPP_DEFINITIONS - the waylandpp definitions +# WAYLANDPP_SCANNER - path to wayland-scanner++ + +pkg_check_modules(PC_WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++ QUIET) + +if(PC_WAYLANDPP_FOUND) + pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) +else() + message(SEND_ERROR "wayland-client++ not found via pkg-config") +endif() + +pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET) + +if(PC_WAYLANDPP_SCANNER_FOUND) + pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) +else() + message(SEND_ERROR "wayland-scanner++ not found via pkg-config") +endif() + +find_path(WAYLANDPP_INCLUDE_DIR wayland-client.hpp PATHS ${PC_WAYLANDPP_INCLUDEDIR}) + +find_library(WAYLANDPP_CLIENT_LIBRARY NAMES wayland-client++ + PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) + +find_library(WAYLANDPP_CURSOR_LIBRARY NAMES wayland-cursor++ + PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) + +find_library(WAYLANDPP_EGL NAMES wayland-egl++ + PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) + + +# Promote to cache variables so all code can access it +set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNAL "") + +# wayland-scanner++ is from native/host system in case of cross-compilation, so +# it's ok if we don't find it with pkgconfig +find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER}) + +include (FindPackageHandleStandardArgs) +find_package_handle_standard_args(Waylandpp + REQUIRED_VARS WAYLANDPP_INCLUDE_DIR + WAYLANDPP_CLIENT_LIBRARY + WAYLANDPP_CURSOR_LIBRARY + WAYLANDPP_EGL + WAYLANDPP_SCANNER + VERSION_VAR WAYLANDPP_wayland-client++_VERSION) + +if(WAYLANDPP_FOUND) + set(WAYLANDPP_INCLUDE_DIRS ${WAYLANDPP_INCLUDE_DIR}) + set(WAYLANDPP_LIBRARIES ${WAYLANDPP_CLIENT_LIBRARY} + ${WAYLANDPP_CURSOR_LIBRARY} + ${WAYLANDPP_EGL}) + set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) +endif() + +mark_as_advanced(WAYLANDPP_INCLUDE_DIR + WAYLANDPP_CLIENT_LIBRARY + WAYLANDPP_CURSOR_LIBRARY + WAYLANDPP_EGL WAYLANDPP_SCANNER) |