summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/modules/FindGIO.cmake37
-rw-r--r--cmake/modules/FindGIOUnix.cmake31
2 files changed, 68 insertions, 0 deletions
diff --git a/cmake/modules/FindGIO.cmake b/cmake/modules/FindGIO.cmake
new file mode 100644
index 00000000..3f5e6d32
--- /dev/null
+++ b/cmake/modules/FindGIO.cmake
@@ -0,0 +1,37 @@
+# - Try to find the GIO libraries
+# Once done this will define
+#
+# GIO_FOUND - system has GIO
+# GIO_INCLUDE_DIR - the GIO include directory
+# GIO_LIBRARIES - GIO library
+#
+# Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+# Copyright (C) 2011 Nokia Corporation
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(GIO_INCLUDE_DIR AND GIO_LIBRARIES)
+ # Already in cache, be silent
+ set(GIO_FIND_QUIETLY TRUE)
+endif(GIO_INCLUDE_DIR AND GIO_LIBRARIES)
+
+include(UsePkgConfig)
+pkg_check_modules(PC_LibGIO gio-2.0)
+
+find_path(GIO_MAIN_INCLUDE_DIR
+ NAMES gio/gio.h
+ HINTS ${PC_LibGIO_INCLUDEDIR}
+ PATH_SUFFIXES glib-2.0)
+
+find_library(GIO_LIBRARY
+ NAMES gio-2.0
+ HINTS ${PC_LibGIO_LIBDIR})
+
+set(GIO_INCLUDE_DIR "${GIO_MAIN_INCLUDE_DIR}")
+set(GIO_LIBRARIES "${GIO_LIBRARY}")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GIO DEFAULT_MSG GIO_LIBRARIES GIO_MAIN_INCLUDE_DIR)
+
+mark_as_advanced(GIO_INCLUDE_DIR GIO_LIBRARIES)
diff --git a/cmake/modules/FindGIOUnix.cmake b/cmake/modules/FindGIOUnix.cmake
new file mode 100644
index 00000000..228a86ad
--- /dev/null
+++ b/cmake/modules/FindGIOUnix.cmake
@@ -0,0 +1,31 @@
+# - Try to find the GIO unix libraries
+# Once done this will define
+#
+# GIOUNIX_FOUND - system has GIO unix
+# GIOUNIX_INCLUDE_DIR - the GIO unix include directory
+#
+# Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+# Copyright (C) 2011 Nokia Corporation
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(GIOUNIX_INCLUDE_DIR)
+ # Already in cache, be silent
+ set(GIOUNIX_FIND_QUIETLY TRUE)
+endif(GIOUNIX_INCLUDE_DIR)
+
+include(UsePkgConfig)
+pkg_check_modules(PC_LibGIOUnix gio-unix-2.0)
+
+find_path(GIOUNIX_MAIN_INCLUDE_DIR
+ NAMES gio/gunixconnection.h
+ HINTS ${PC_LibGIOUnix_INCLUDEDIR}
+ PATH_SUFFIXES gio-unix-2.0)
+
+set(GIOUNIX_INCLUDE_DIR "${GIOUNIX_MAIN_INCLUDE_DIR}")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GIOUNIX DEFAULT_MSG GIOUNIX_MAIN_INCLUDE_DIR)
+
+mark_as_advanced(GIOUNIX_INCLUDE_DIR)