aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorWolfgang Schupp <w.schupp@a1.net>2018-05-07 14:00:55 +0200
committerGitHub <noreply@github.com>2018-05-07 14:00:55 +0200
commit331e5fd844888ef528897f93062e4bfc52fc2bb1 (patch)
tree40141ae856c8a601453724ed67c2922f3f24ec11 /cmake
parent2f3e809e2350e13f95e023ca35666cf62a035e34 (diff)
parent550266177d153ed8dc87f5c458977c76aed95131 (diff)
Merge pull request #13810 from wsnipex/waylandpp-fix
[cmake] fix FindWaylandpp
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindWaylandpp.cmake54
1 files changed, 41 insertions, 13 deletions
diff --git a/cmake/modules/FindWaylandpp.cmake b/cmake/modules/FindWaylandpp.cmake
index 20d9d38c64..fa63ec1b0a 100644
--- a/cmake/modules/FindWaylandpp.cmake
+++ b/cmake/modules/FindWaylandpp.cmake
@@ -10,15 +10,30 @@
# WAYLANDPP_DEFINITIONS - the waylandpp definitions
# WAYLANDPP_SCANNER - path to wayland-scanner++
-pkg_check_modules(WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++)
-pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++)
-if(WAYLANDPP_FOUND)
+pkg_check_modules(PC_WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++ QUIET)
+pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET)
+if(PC_WAYLANDPP_FOUND)
pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir)
endif()
if(PC_WAYLANDPP_SCANNER_FOUND)
pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp)
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_CLIENT_EXTRA_LIBRARY NAMES wayland-client-extra++
+ 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 "")
@@ -27,13 +42,26 @@ set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNA
find_program(WAYLANDPP_SCANNER wayland-scanner++ PATHS ${PC_WAYLANDPP_SCANNER})
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Waylandpp
- REQUIRED_VARS
- WAYLANDPP_FOUND
- WAYLANDPP_SCANNER
- VERSION_VAR
- WAYLANDPP_wayland-client++_VERSION)
-
-set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1)
-# Also pass on library directories
-set(WAYLANDPP_LIBRARIES ${WAYLANDPP_LDFLAGS})
+find_package_handle_standard_args(Waylandpp
+ REQUIRED_VARS WAYLANDPP_INCLUDE_DIR
+ WAYLANDPP_CLIENT_LIBRARY
+ WAYLANDPP_CLIENT_EXTRA_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_CLIENT_EXTRA_LIBRARY}
+ ${WAYLANDPP_CURSOR_LIBRARY}
+ ${WAYLANDPP_EGL})
+ set(WAYLANDPP_DEFINITIONS -DHAVE_WAYLAND=1)
+endif()
+
+mark_as_advanced(WAYLANDPP_INCLUDE_DIR
+ WAYLANDPP_CLIENT_LIBRARY
+ WAYLANDPP_CLIENT_EXTRA_LIBRARY
+ WAYLANDPP_CURSOR_LIBRARY
+ WAYLANDPP_EGL WAYLANDPP_SCANNER)