File: FindGOBJECT2.cmake

package info (click to toggle)
wbxml2 0.11.8%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,672 kB
  • sloc: ansic: 12,690; xml: 6,399; perl: 294; sh: 159; makefile: 7; cpp: 7
file content (51 lines) | stat: -rw-r--r-- 1,856 bytes parent folder | download | duplicates (4)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# - Try to find GObject2 
# Find GObject2 headers, libraries and the answer to all questions.
#
#  GOBJECT2_FOUND               True if GOBJECT2 got found
#  GOBJECT2_INCLUDE_DIRS        Location of GOBJECT2 headers 
#  GOBJECT2_LIBRARIES           List of libraries to use GOBJECT2 
#
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.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 )

IF ( GOBJECT2_FIND_REQUIRED )
	SET( _pkgconfig_REQUIRED "REQUIRED" )
ELSE( GOBJECT2_FIND_REQUIRED )
	SET( _pkgconfig_REQUIRED "" )	
ENDIF ( GOBJECT2_FIND_REQUIRED )

IF ( GOBJECT2_MIN_VERSION )
	PKG_SEARCH_MODULE( GOBJECT2 ${_pkgconfig_REQUIRED} gobject-2.0>=${GOBJECT2_MIN_VERSION} )
ELSE ( GOBJECT2_MIN_VERSION )
	PKG_SEARCH_MODULE( GOBJECT2 ${_pkgconfig_REQUIRED} gobject-2.0 )
ENDIF ( GOBJECT2_MIN_VERSION )


IF( NOT GOBJECT2_FOUND AND NOT PKG_CONFIG_FOUND )
	FIND_PATH( GOBJECT2_INCLUDE_DIRS gobject/gobject.h PATH_SUFFIXES glib-2.0)
	FIND_LIBRARY( GOBJECT2_LIBRARIES gobject-2.0 )

	# Report results
	IF ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )	
		SET( GOBJECT2_FOUND 1 )
		IF ( NOT GOBJECT2_FIND_QUIETLY )
			MESSAGE( STATUS "Found GOBJECT2: ${GOBJECT2_LIBRARIES}" )
		ENDIF ( NOT GOBJECT2_FIND_QUIETLY )
	ELSE ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )	
		IF ( GOBJECT2_FIND_REQUIRED )
			MESSAGE( SEND_ERROR "Could NOT find GOBJECT2" )
		ELSE ( GOBJECT2_FIND_REQUIRED )
			IF ( NOT GOBJECT2_FIND_QUIETLY )
				MESSAGE( STATUS "Could NOT find GOBJECT2" )	
			ENDIF ( NOT GOBJECT2_FIND_QUIETLY )
		ENDIF ( GOBJECT2_FIND_REQUIRED )
	ENDIF ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
ENDIF( NOT GOBJECT2_FOUND AND NOT PKG_CONFIG_FOUND )

MARK_AS_ADVANCED( GOBJECT2_LIBRARIES GOBJECT2_INCLUDE_DIRS )