FindGio.cmake 935 B

123456789101112131415161718192021222324252627
  1. # - Try to find Gio
  2. # Once done this will define
  3. #
  4. # GIO_FOUND - system has Gio
  5. # GIO_INCLUDE_DIRS - the Gio include directory
  6. # GIO_LIBRARIES - the libraries needed to use Gio
  7. # GIO_DEFINITIONS - Compiler switches required for using Gio
  8. # Use pkg-config to get the directories and then use these values
  9. # in the find_path() and find_library() calls
  10. find_package(PkgConfig)
  11. pkg_check_modules(PC_GIO gio-2.0 gio-unix-2.0)
  12. set(GIO_DEFINITIONS ${PC_GIO_CFLAGS})
  13. find_path(GIO_INCLUDE_DIRS gio.h PATHS ${PC_GIO_INCLUDEDIR} ${PC_GIO_INCLUDE_DIRS} PATH_SUFFIXES glib-2.0/gio/)
  14. find_library(GIO_LIBRARIES NAMES gio-2.0 libgio-2.0 gio-unix-2.0 PATHS ${PC_GIO_LIBDIR} ${PC_GIO_LIBRARY_DIRS})
  15. mark_as_advanced(GIO_INCLUDE_DIRS GIO_LIBRARIES)
  16. include(FindPackageHandleStandardArgs)
  17. find_package_handle_standard_args(Gio REQUIRED_VARS GIO_LIBRARIES GIO_INCLUDE_DIRS)
  18. if(GIO_FOUND)
  19. set(HAVE_DBUS "1")
  20. else()
  21. set(HAVE_DBUS "0")
  22. endif()