summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindWaylandpp.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/FindWaylandpp.cmake')
-rw-r--r--cmake/modules/FindWaylandpp.cmake50
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
13pkg_check_modules(WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++) 13pkg_check_modules(PC_WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++ QUIET)
14pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++) 14pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET)
15if(WAYLANDPP_FOUND) 15if(PC_WAYLANDPP_FOUND)
16 pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir) 16 pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir)
17endif() 17endif()
18if(PC_WAYLANDPP_SCANNER_FOUND) 18if(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)
20endif() 20endif()
21 21
22find_path(WAYLANDPP_INCLUDE_DIR wayland-client.hpp PATHS ${PC_WAYLANDPP_INCLUDEDIR})
23
24find_library(WAYLANDPP_CLIENT_LIBRARY NAMES wayland-client++
25 PATHS ${PC_WAYLANDPP_LIBRARY_DIRS})
26
27find_library(WAYLANDPP_CURSOR_LIBRARY NAMES wayland-cursor++
28 PATHS ${PC_WAYLANDPP_LIBRARY_DIRS})
29
30find_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
23set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNAL "") 35set(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
27find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER}) 39find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER})
28 40
29include (FindPackageHandleStandardArgs) 41include (FindPackageHandleStandardArgs)
30find_package_handle_standard_args (Waylandpp 42find_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)
37set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1) 49
38# Also pass on library directories 50if(WAYLANDPP_FOUND)
39set(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)
56endif()
57
58mark_as_advanced(WAYLANDPP_INCLUDE_DIR
59 WAYLANDPP_CLIENT_LIBRARY
60 WAYLANDPP_CURSOR_LIBRARY
61 WAYLANDPP_EGL WAYLANDPP_SCANNER)