diff options
Diffstat (limited to 'cmake/modules/FindWaylandpp.cmake')
| -rw-r--r-- | cmake/modules/FindWaylandpp.cmake | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/cmake/modules/FindWaylandpp.cmake b/cmake/modules/FindWaylandpp.cmake index 336e613..3cfc282 100644 --- a/cmake/modules/FindWaylandpp.cmake +++ b/cmake/modules/FindWaylandpp.cmake | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # ------------- | 2 | # ------------- |
| 3 | # Finds the waylandpp library | 3 | # Finds the waylandpp library |
| 4 | # | 4 | # |
| 5 | # This will will define the following variables:: | 5 | # This will define the following variables:: |
| 6 | # | 6 | # |
| 7 | # WAYLANDPP_FOUND - the system has waylandpp | 7 | # WAYLANDPP_FOUND - the system has waylandpp |
| 8 | # WAYLANDPP_INCLUDE_DIRS - the waylandpp include directory | 8 | # WAYLANDPP_INCLUDE_DIRS - the waylandpp include directory |
| @@ -10,15 +10,27 @@ | |||
| 10 | # WAYLANDPP_DEFINITIONS - the waylandpp definitions | 10 | # WAYLANDPP_DEFINITIONS - the waylandpp definitions |
| 11 | # WAYLANDPP_SCANNER - path to wayland-scanner++ | 11 | # WAYLANDPP_SCANNER - path to wayland-scanner++ |
| 12 | 12 | ||
| 13 | pkg_check_modules(WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++) | 13 | pkg_check_modules(PC_WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++ QUIET) |
| 14 | pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++) | 14 | pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET) |
| 15 | if(WAYLANDPP_FOUND) | 15 | if(PC_WAYLANDPP_FOUND) |
| 16 | pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) | 16 | pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) |
| 17 | endif() | 17 | endif() |
| 18 | if(PC_WAYLANDPP_SCANNER_FOUND) | 18 | if(PC_WAYLANDPP_SCANNER_FOUND) |
| 19 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) | 19 | pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) |
| 20 | endif() | 20 | endif() |
| 21 | 21 | ||
| 22 | find_path(WAYLANDPP_INCLUDE_DIR wayland-client.hpp PATHS ${PC_WAYLANDPP_INCLUDEDIR}) | ||
| 23 | |||
| 24 | find_library(WAYLANDPP_CLIENT_LIBRARY NAMES wayland-client++ | ||
| 25 | PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 26 | |||
| 27 | find_library(WAYLANDPP_CURSOR_LIBRARY NAMES wayland-cursor++ | ||
| 28 | PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 29 | |||
| 30 | find_library(WAYLANDPP_EGL NAMES wayland-egl++ | ||
| 31 | PATHS ${PC_WAYLANDPP_LIBRARY_DIRS}) | ||
| 32 | |||
| 33 | |||
| 22 | # Promote to cache variables so all code can access it | 34 | # Promote to cache variables so all code can access it |
| 23 | set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNAL "") | 35 | set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNAL "") |
| 24 | 36 | ||
| @@ -27,13 +39,23 @@ set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNA | |||
| 27 | find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER}) | 39 | find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER}) |
| 28 | 40 | ||
| 29 | include (FindPackageHandleStandardArgs) | 41 | include (FindPackageHandleStandardArgs) |
| 30 | find_package_handle_standard_args (Waylandpp | 42 | find_package_handle_standard_args(Waylandpp |
| 31 | REQUIRED_VARS | 43 | REQUIRED_VARS WAYLANDPP_INCLUDE_DIR |
| 32 | WAYLANDPP_FOUND | 44 | WAYLANDPP_CLIENT_LIBRARY |
| 33 | WAYLANDPP_SCANNER | 45 | WAYLANDPP_CURSOR_LIBRARY |
| 34 | VERSION_VAR | 46 | WAYLANDPP_EGL |
| 35 | WAYLANDPP_wayland-client++_VERSION) | 47 | WAYLANDPP_SCANNER |
| 36 | 48 | VERSION_VAR WAYLANDPP_wayland-client++_VERSION) | |
| 37 | set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) | 49 | |
| 38 | # Also pass on library directories | 50 | if(WAYLANDPP_FOUND) |
| 39 | set(WAYLANDPP_LIBRARIES ${WAYLANDPP_LDFLAGS}) | 51 | set(WAYLANDPP_INCLUDE_DIRS ${WAYLANDPP_INCLUDE_DIR}) |
| 52 | set(WAYLANDPP_LIBRARIES ${WAYLANDPP_CLIENT_LIBRARY} | ||
| 53 | ${WAYLANDPP_CURSOR_LIBRARY} | ||
| 54 | ${WAYLANDPP_EGL}) | ||
| 55 | set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) | ||
| 56 | endif() | ||
| 57 | |||
| 58 | mark_as_advanced(WAYLANDPP_INCLUDE_DIR | ||
| 59 | WAYLANDPP_CLIENT_LIBRARY | ||
| 60 | WAYLANDPP_CURSOR_LIBRARY | ||
| 61 | WAYLANDPP_EGL WAYLANDPP_SCANNER) | ||
