summaryrefslogtreecommitdiff
path: root/cmake/modules/FindGIOUnix.cmake
blob: 7f5513b3f9b7162f578c4ffb54d2ca1612635a7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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()

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 glib-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)