Loading the XSLT styles to transform osyncformat to gdata. Creating the
[gdataplugin.git] / cmake / modules / FindEDataBook1.2.cmake
blob12f49af3688cfdf065ffd342a09be5a4e1a1363e
1 # - Try to find libedatabook1.2 components
2 # Find libedatabook 1.2 headers, libraries and the answer to all questions.
4 #  LIBEDATABOOK1.2_FOUND               True if libedatabook1.2 got found
5 #  LIBEDATABOOK1.2_INCLUDE_DIRS         Location of libedatabook1.2 headers 
6 #  LIBEDATABOOK1.2_LIBRARIES           List of libaries to use libedatabook1.2
7 #  LIBEDATABOOK1.2_DEFINITIONS         Definitions to compile libedatabook1.2 
9 # Copyright (c) 2007 Juha Tuomala <tuju@iki.fi>
10 # Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
11 # Copyright (c) 2007 Alban Browaeys <prahal@yahoo.com>
13 #  Redistribution and use is allowed according to the terms of the New
14 #  BSD license.
15 #  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
18 INCLUDE( FindPkgConfig )
19 # Take care about libedata-book-1.2.pc settings
20 IF ( EDataBook1.2_FIND_REQUIRED )
21   SET( _pkgconfig_REQUIRED "REQUIRED" )
22 ELSE ( EDataBook1.2_FIND_REQUIRED )
23   SET( _pkgconfig_REQUIRED "" )
24 ENDIF ( EDataBook1.2_FIND_REQUIRED )
26 pkg_search_module( LIBEDATABOOK1.2 ${_pkgconfig_REQUIRED} libedata-book-1.2 )
29 # Look for libedatabook1.2 include dir and libraries w/o pkg-config.
30 IF ( NOT LIBEDATABOOK1.2_FOUND AND NOT PKG_CONFIG_FOUND )
31         FIND_PATH( _libedatabook1.2_include_DIR libedata-book/e-data-book.h 
32                         PATH_SUFFIXES evolution-data-server-1.12 evolution-data-server-1.10 evolution-data-server-1.8 evolution-data-server-1.6 evolution-data-server-1.4 evolution-data-server-1.2
33                         PATHS
34                         /opt/local/include/
35                         /sw/include/
36                         /usr/local/include/
37                         /usr/include/ 
38         )
39         FIND_LIBRARY( _libedatabook1.2_link_DIR edata-book-1.2
40                         PATHS
41                         /opt/local/lib
42                         /sw/lib
43                         /usr/lib
44                         /usr/local/lib
45                         /usr/lib64
46                         /usr/local/lib64
47                         /opt/lib64 
48         )
50         IF ( _libedatabook1.2_include_DIR AND _libedatabook1.2_link_DIR )
51                 SET ( _libedatabook1.2_FOUND TRUE )
52         ENDIF ( _libedatabook1.2_include_DIR AND _libedatabook1.2_link_DIR )
55         IF ( _libedatabook1.2_FOUND )
56                 SET ( LIBEDATABOOK1.2_INCLUDE_DIRS ${_libedatabook1.2_include_DIR} )
57                 SET ( LIBEDATABOOK1.2_LIBRARIES ${_libedatabook1.2_link_DIR} )
58         ENDIF ( _libedatabook1.2_FOUND )
60         # Handle dependencies
61         IF ( NOT LIBEBOOK1.2_FOUND )
62                 FIND_PACKAGE ( EBook1.2 REQUIRED )
63                 IF ( LIBEBOOK1.2_FOUND )
64                         SET ( LIBEDATABOOK1.2_INCLUDE_DIRS ${LIBEDATABOOK1.2_INCLUDE_DIRS} ${LIBEBOOK1.2_INCLUDE_DIRS} )
65                         SET ( LIBEDATABOOK1.2_LIBRARIES ${LIBEDATABOOK1.2_LIBRARIES} ${LIBEBOOK1.2_LIBRARIES} )
66                 ENDIF ( LIBEBOOK1.2_FOUND )             
67         ENDIF ( NOT LIBEBOOK1.2_FOUND )
68         IF ( NOT LIBEDATASERVER1.2_FOUND )
69                 FIND_PACKAGE ( EDataServer1.2 REQUIRED )
70                 IF ( LIBEDATASERVER1.2_FOUND )
71                         SET ( LIBEDATABOOK1.2_INCLUDE_DIRS ${LIBEDATABOOK1.2_INCLUDE_DIRS} ${LIBEDATASERVER1.2_INCLUDE_DIRS} )
72                         SET ( LIBEDATABOOK1.2_LIBRARIES ${LIBEDATABOOK1.2_LIBRARIES} ${LIBEDATASERVER1.2_LIBRARIES} )
73                 ENDIF ( LIBEDATASERVER1.2_FOUND )               
74         ENDIF ( NOT LIBEDATASERVER1.2_FOUND )
75         IF ( NOT LIBGNOME2_FOUND )
76                 FIND_PACKAGE ( LibGnome2 REQUIRED )
77                 IF ( LIBGNOME2_FOUND )
78                         SET ( LIBEDATABOOK1.2_INCLUDE_DIRS ${LIBEDATABOOK1.2_INCLUDE_DIRS} ${LIBGNOME2_INCLUDE_DIRS} )
79                         SET ( LIBEDATABOOK1.2_LIBRARIES ${LIBEDATABOOK1.2_LIBRARIES} ${LIBGNOME2_LIBRARIES} )
80                 ENDIF ( LIBGNOME2_FOUND )               
81         ENDIF ( NOT LIBGNOME2_FOUND )
82         IF ( NOT BONOBO2_FOUND )
83                 SET ( BONOBO2_MIN_VERSION "2.4.2" )
84                 FIND_PACKAGE ( BONOBO2 REQUIRED )
85                 IF ( BONOBO2_FOUND )
86                         SET ( LIBEDATABOOK1.2_INCLUDE_DIRS ${LIBEDATABOOK1.2_INCLUDE_DIRS} ${BONOBO2_INCLUDE_DIRS} )
87                         SET ( LIBEDATABOOK1.2_LIBRARIES ${LIBEDATABOOK1.2_LIBRARIES} ${BONOBO2_LIBRARIES} )
88                 ENDIF ( BONOBO2_FOUND )         
89         ENDIF ( NOT BONOBO2_FOUND )
91         # Report results
92         IF ( LIBEDATABOOK1.2_LIBRARIES AND LIBEDATABOOK1.2_INCLUDE_DIRS AND _libedatabook1.2_FOUND )
93                 SET( LIBEDATABOOK1.2_FOUND 1 )
94                 IF ( NOT EDataBook1.2_FIND_QUIETLY )
95                         MESSAGE( STATUS "Found libedatabook-1.2: ${LIBEDATABOOK1.2_LIBRARIES}" )
96                 ENDIF ( NOT EDataBook1.2_FIND_QUIETLY )
97         ELSE ( LIBEDATABOOK1.2_LIBRARIES AND LIBEDATABOOK1.2_INCLUDE_DIRS AND _libedatabook1.2_FOUND )  
98                 IF ( EDataBook1.2_FIND_REQUIRED )
99                         MESSAGE( SEND_ERROR "Could NOT find libedatabook-1.2" )
100                 ELSE ( EDataBook1.2_FIND_REQUIRED )
101                         IF ( NOT EDataBook1.2_FIND_QUIETLY )
102                                 MESSAGE( STATUS "Could NOT find libedatabook-1.2" )     
103                         ENDIF ( NOT EDataBook1.2_FIND_QUIETLY )
104                 ENDIF ( EDataBook1.2_FIND_REQUIRED )
105         ENDIF ( LIBEDATABOOK1.2_LIBRARIES AND LIBEDATABOOK1.2_INCLUDE_DIRS AND _libedatabook1.2_FOUND ) 
107 ENDIF ( NOT LIBEDATABOOK1.2_FOUND AND NOT PKG_CONFIG_FOUND )
108 # Hide advanced variables from CMake GUIs
109 MARK_AS_ADVANCED( LIBEDATABOOK1.2_LIBRARIES LIBEDATABOOK1.2_INCLUDE_DIRS )