# - Try to find gconf2
# Find gconf2 headers, libraries and the answer to all questions.
#
# GCONF2_FOUND True if gconf2 got found
# GCONF2_INCLUDEDIR Location of gconf2 headers
# GCONF2_LIBRARIES List of libaries to use gconf2
# GCONF2_DEFINITIONS Definitions to compile gconf2
#
# Copyright (c) 2007 Juha Tuomala <tuju@iki.fi>
# Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
# Copyright (c) 2007 Alban Browaeys <prahal@yahoo.com>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
INCLUDE( FindPkgConfig )
# Take care about gconf-2.0.pc settings
#pkg_search_module( GCONF2 gconf-2.0 )
# Look for gconf2 include dir and libraries w/o pkgconfig
IF ( NOT GCONF2_FOUND )
FIND_PATH( _gconf2_include_DIR gconf/gconf.h PATH_SUFFIXES gconf/2 )
FIND_LIBRARY( _gconf2_link_DIR gconf-2)
MESSAGE( STATUS "include ${_gconf2_include_DIR}" )
MESSAGE( STATUS "link ${_gconf2_link_DIR}" )
IF ( _gconf2_include_DIR AND _gconf2_link_DIR )
SET ( _gconf2_FOUND TRUE )
ENDIF ( _gconf2_include_DIR AND _gconf2_link_DIR )
FIND_PATH( _orbit2_include_DIR orbit/orbit.h PATH_SUFFIXES orbit-2.0 )
FIND_LIBRARY( _orbit2_link_DIR ORBit-2)
FIND_PACKAGE( GLIB2 REQUIRED)
IF ( _gconf2_FOUND )
SET ( GCONF2_INCLUDE_DIRS ${_gconf2_include_DIR} ${_orbit2_include_DIR} )
SET ( GCONF2_LIBRARIES ${_gconf2_link_DIR} ${_orbit2_link_DIR} )
ENDIF ( _gconf2_FOUND )
IF ( GTHREAD2_FOUND )
SET ( GCONF2_INCLUDE_DIRS ${GCONF2_INCLUDE_DIRS} ${GTHREAD2_INCLUDE_DIR} )
SET ( GCONF2_LIBRARIES ${GCONF2_LIBRARIES} ${GTHREAD2_LIBRARY} )
ENDIF ( GTHREAD2_FOUND )
IF ( GLIB2_FOUND )
SET ( GCONF2_INCLUDE_DIRS ${GCONF2_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR} )
SET ( GCONF2_LIBRARIES ${GCONF2_LIBRARIES} ${GLIB2_LIBRARY} )
ENDIF ( GLIB2_FOUND )
# Report results
IF ( GCONF2_LIBRARIES AND GCONF2_INCLUDE_DIRS )
SET( GCONF2_FOUND 1 )
IF ( NOT GConf2_FIND_QUIETLY )
MESSAGE( STATUS "Found gconf2: ${GCONF2_LIBRARIES} include ${GCONF2_INCLUDE_DIRS}" )
ENDIF ( NOT GConf2_FIND_QUIETLY )
ELSE ( GCONF2_LIBRARIES AND GCONF2_INCLUDE_DIRS )
IF ( GConf2_FIND_REQUIRED )
MESSAGE( SEND_ERROR "Could NOT find gconf2" )
ELSE ( GConf2_FIND_REQUIRED )
IF ( NOT GConf2_FIND_QUIETLY )
MESSAGE( STATUS "Could NOT find gconf2" )
ENDIF ( NOT GConf2_FIND_QUIETLY )
ENDIF ( GConf2_FIND_REQUIRED )
ENDIF ( GCONF2_LIBRARIES AND GCONF2_INCLUDE_DIRS )
ENDIF ( NOT GCONF2_FOUND )
# Hide advanced variables from CMake GUIs
MARK_AS_ADVANCED( GCONF2_LIBRARIES GCONF2_INCLUDEDIR )