aboutsummaryrefslogtreecommitdiff
path: root/CMake/FindCairo.cmake
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-11-12 08:17:52 -0500
committerDrew DeVault <sir@cmpwn.com>2015-11-12 08:17:52 -0500
commitaadcba4b7cfa9ce3096fd166a046b151fd5ba8fa (patch)
tree62968b4f9a22d275965605cba155afbb69892ee0 /CMake/FindCairo.cmake
parent250097d32b7503b5a3fbb14b4582534ae3957035 (diff)
Add new dependencies for wayland clients
Cairo for rendering shit, Pango for text rendering, and wayland client stuff. Thanks @Cloudef, blatantly ripping off his cmake files for this
Diffstat (limited to 'CMake/FindCairo.cmake')
-rw-r--r--CMake/FindCairo.cmake47
1 files changed, 47 insertions, 0 deletions
diff --git a/CMake/FindCairo.cmake b/CMake/FindCairo.cmake
new file mode 100644
index 00000000..36c28095
--- /dev/null
+++ b/CMake/FindCairo.cmake
@@ -0,0 +1,47 @@
+# - Try to find the cairo library
+# Once done this will define
+#
+# CAIRO_FOUND - system has cairo
+# CAIRO_INCLUDE_DIRS - the cairo include directory
+# CAIRO_LIBRARIES - Link these to use cairo
+#
+# Define CAIRO_MIN_VERSION for which version desired.
+#
+
+INCLUDE(FindPkgConfig)
+
+IF(Cairo_FIND_REQUIRED)
+ SET(_pkgconfig_REQUIRED "REQUIRED")
+ELSE(Cairo_FIND_REQUIRED)
+ SET(_pkgconfig_REQUIRED "")
+ENDIF(Cairo_FIND_REQUIRED)
+
+IF(CAIRO_MIN_VERSION)
+ PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION})
+ELSE(CAIRO_MIN_VERSION)
+ PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo)
+ENDIF(CAIRO_MIN_VERSION)
+
+IF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
+ FIND_PATH(CAIRO_INCLUDE_DIRS cairo.h)
+ FIND_LIBRARY(CAIRO_LIBRARIES cairo)
+
+ # Report results
+ IF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
+ SET(CAIRO_FOUND 1)
+ IF(NOT Cairo_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Cairo: ${CAIRO_LIBRARIES}")
+ ENDIF(NOT Cairo_FIND_QUIETLY)
+ ELSE(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
+ IF(Cairo_FIND_REQUIRED)
+ MESSAGE(SEND_ERROR "Could not find Cairo")
+ ELSE(Cairo_FIND_REQUIRED)
+ IF(NOT Cairo_FIND_QUIETLY)
+ MESSAGE(STATUS "Could not find Cairo")
+ ENDIF(NOT Cairo_FIND_QUIETLY)
+ ENDIF(Cairo_FIND_REQUIRED)
+ ENDIF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
+ENDIF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
+
+# Hide advanced variables from CMake GUIs
+MARK_AS_ADVANCED(CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS)