diff options
| author | manuel <manuel@mausz.at> | 2017-09-02 15:02:54 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2017-09-02 15:02:54 +0200 |
| commit | 0afb1d4d51973cf52973617c92236d851a039d31 (patch) | |
| tree | 300741b800f0e013ba1e709cc46460de6383f2bb /cmake/modules/FindWaylandpp.cmake | |
| parent | 86b22151f0758311fd146ff508e7254337414bc1 (diff) | |
| download | kodi-pvr-build-0afb1d4d51973cf52973617c92236d851a039d31.tar.gz kodi-pvr-build-0afb1d4d51973cf52973617c92236d851a039d31.tar.bz2 kodi-pvr-build-0afb1d4d51973cf52973617c92236d851a039d31.zip | |
sync with upstream
Diffstat (limited to 'cmake/modules/FindWaylandpp.cmake')
| -rw-r--r-- | cmake/modules/FindWaylandpp.cmake | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/cmake/modules/FindWaylandpp.cmake b/cmake/modules/FindWaylandpp.cmake new file mode 100644 index 0000000..8a1cd74 --- /dev/null +++ b/cmake/modules/FindWaylandpp.cmake | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | # FindWaylandpp | ||
| 2 | # ----------- | ||
| 3 | # Finds the waylandpp library | ||
| 4 | # | ||
| 5 | # This will will define the following variables:: | ||
| 6 | # | ||
| 7 | # WAYLANDPP_FOUND - the system has Wayland | ||
| 8 | # WAYLANDPP_INCLUDE_DIRS - the Wayland include directory | ||
| 9 | # WAYLANDPP_LIBRARIES - the Wayland libraries | ||
| 10 | # WAYLANDPP_DEFINITIONS - the Wayland definitions | ||
| 11 | |||
| 12 | |||
| 13 | if(PKG_CONFIG_FOUND) | ||
| 14 | pkg_check_modules(PC_WAYLANDPP wayland-client++>=0.1 wayland-egl++ wayland-cursor++ wayland-scanner++ QUIET) | ||
| 15 | pkg_check_modules(PC_WAYLAND_PROTOCOLS wayland-protocols>=1.7 QUIET) | ||
| 16 | # TODO: Remove check when CMake minimum version is bumped globally | ||
| 17 | if(CMAKE_VERSION VERSION_EQUAL 3.4.0 OR CMAKE_VERSION VERSION_GREATER 3.4.0) | ||
| 18 | if(PC_WAYLANDPP_FOUND) | ||
| 19 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) | ||
| 20 | endif() | ||
| 21 | if(PC_WAYLAND_PROTOCOLS_FOUND) | ||
| 22 | pkg_get_variable(PC_WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) | ||
| 23 | endif() | ||
| 24 | endif() | ||
| 25 | endif() | ||
| 26 | |||
| 27 | find_path(WAYLANDPP_INCLUDE_DIR NAMES wayland-client.hpp | ||
| 28 | PATHS ${PC_WAYLANDPP_INCLUDE_DIRS}) | ||
| 29 | |||
| 30 | find_library(WAYLANDPP_CLIENT_LIBRARY NAMES wayland-client++ | ||
| 31 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 32 | |||
| 33 | find_library(WAYLANDPP_CURSOR_LIBRARY NAMES wayland-cursor++ | ||
| 34 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 35 | |||
| 36 | find_library(WAYLANDPP_EGL_LIBRARY NAMES wayland-egl++ | ||
| 37 | PATHS ${PC_WAYLANDPP_LIBRARIES} ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 38 | |||
| 39 | find_program(WAYLANDPP_SCANNER NAMES wayland-scanner++ | ||
| 40 | PATHS ${PC_WAYLANDPP_SCANNER}) | ||
| 41 | |||
| 42 | find_path(WAYLAND_PROTOCOLS_DIR NAMES unstable/xdg-shell/xdg-shell-unstable-v6.xml | ||
| 43 | PATHS ${PC_WAYLAND_PROTOCOLS_DIR} | ||
| 44 | DOC "Directory containing additional Wayland protocols") | ||
| 45 | |||
| 46 | include (FindPackageHandleStandardArgs) | ||
| 47 | find_package_handle_standard_args (Waylandpp | ||
| 48 | REQUIRED_VARS | ||
| 49 | WAYLANDPP_INCLUDE_DIR | ||
| 50 | WAYLANDPP_CLIENT_LIBRARY | ||
| 51 | WAYLANDPP_CURSOR_LIBRARY | ||
| 52 | WAYLANDPP_EGL_LIBRARY | ||
| 53 | WAYLANDPP_SCANNER | ||
| 54 | WAYLAND_PROTOCOLS_DIR | ||
| 55 | VERSION_VAR | ||
| 56 | PC_WAYLANDPP_wayland-client++_VERSION) | ||
| 57 | |||
| 58 | if (WAYLANDPP_FOUND) | ||
| 59 | set(WAYLANDPP_LIBRARIES ${WAYLANDPP_CLIENT_LIBRARY} ${WAYLANDPP_CURSOR_LIBRARY} ${WAYLANDPP_EGL_LIBRARY}) | ||
| 60 | set(WAYLANDPP_INCLUDE_DIRS ${PC_WAYLANDPP_INCLUDE_DIRS}) | ||
| 61 | set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) | ||
| 62 | endif() | ||
| 63 | |||
| 64 | mark_as_advanced (WAYLANDPP_CLIENT_LIBRARY WAYLANDPP_CURSOR_LIBRARY WAYLANDPP_EGL_LIBRARY WAYLANDPP_INCLUDE_DIR) | ||
