Loading the XSLT styles to transform osyncformat to gdata. Creating the
[gdataplugin.git] / cmake / modules / FindEDataServer1.0.cmake
blob642a0669afa9503a37ce57fb8e7406fea1221876
1 # - Try to find libedataserver1.0 components
2 # Find libedataserver 1.0 headers, libraries and the answer to all questions.
4 #  LIBEDATASERVER1.0_FOUND               True if libedataserver1.0 got found
5 #  LIBEDATASERVER1.0_INCLUDE_DIRS         Location of libedataserver1.0 headers 
6 #  LIBEDATASERVER1.0_LIBRARIES           List of libaries to use libedataserver1.0
7 #  LIBEDATASERVER1.0_DEFINITIONS         Definitions to compile libedataserver1.0 
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 libedataserver-1.0.pc settings
20 IF ( EDataServer1.0_FIND_REQUIRED )
21   SET( _pkgconfig_REQUIRED "REQUIRED" )
22 ELSE ( EDataServer1.0_FIND_REQUIRED )
23   SET( _pkgconfig_REQUIRED "" )
24 ENDIF ( EDataServer1.0_FIND_REQUIRED )
26 pkg_search_module( LIBEDATASERVER1.0 ${_pkgconfig_REQUIRED} libedataserver-1.0 )
29 # Look for libedataserver1.0 include dir and libraries w/o pkg-config.
30 IF ( NOT LIBEDATASERVER1.0_FOUND AND NOT PKG_CONFIG_FOUND )
31         FIND_PATH( _libedataserver1.0_include_DIR libedataserver/e-account.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.0
33                         PATHS
34                         /opt/local/include/
35                         /sw/include/
36                         /usr/local/include/
37                         /usr/include/ 
38         )
39         FIND_LIBRARY( _libedataserver1.0_link_DIR edataserver-1.0
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 ( _libedataserver1.0_include_DIR AND _libedataserver1.0_link_DIR )
51                 SET ( _libedataserver1.0_FOUND TRUE )
52         ENDIF ( _libedataserver1.0_include_DIR AND _libedataserver1.0_link_DIR )
55         IF ( _libedataserver1.0_FOUND )
56                 SET ( LIBEDATASERVER1.0_INCLUDE_DIRS ${_libedataserver1.0_include_DIR} )
57                 SET ( LIBEDATASERVER1.0_LIBRARIES ${_libedataserver1.0_link_DIR} )
58         ENDIF ( _libedataserver1.0_FOUND )
61         # Handle dependencies
62         IF ( NOT GCONF2_FOUND )
63                 FIND_PACKAGE ( GConf2 REQUIRED )
64                 IF ( GCONF2_FOUND )
65                         SET ( LIBEDATASERVER1.0_INCLUDE_DIRS ${LIBEDATASERVER1.0_INCLUDE_DIRS} ${GCONF2_INCLUDE_DIRS} )
66                         SET ( LIBEDATASERVER1.0_LIBRARIES ${LIBEDATASERVER1.0_LIBRARIES} ${GCONF2_LIBRARIES} )
67                 ENDIF ( GCONF2_FOUND )          
68         ENDIF ( NOT GCONF2_FOUND )
69         IF ( NOT BONOBO2_FOUND )
70                 SET ( BONOBO2_MIN_VERSION "2.4.2" )
71                 FIND_PACKAGE ( BONOBO2 REQUIRED )
72                 IF ( BONOBO2_FOUND )
73                         SET ( LIBEDATASERVER1.0_INCLUDE_DIRS ${LIBEDATASERVER1.0_INCLUDE_DIRS} ${BONOBO2_INCLUDE_DIRS} )
74                         SET ( LIBEDATASERVER1.0_LIBRARIES ${LIBEDATASERVER1.0_LIBRARIES} ${BONOBO2_LIBRARIES} )
75                 ENDIF ( BONOBO2_FOUND )         
76         ENDIF ( NOT BONOBO2_FOUND )
77         IF ( NOT ORBIT2_FOUND )
78                 SET ( ORBIT2_MIN_VERSION "2.9.8" )
79                 FIND_PACKAGE ( ORBit2 REQUIRED )
80                 IF ( ORBIT2_FOUND )
81                         SET ( LIBEDATASERVER1.0_INCLUDE_DIRS ${LIBEDATASERVER1.0_INCLUDE_DIRS} ${ORBIT2_INCLUDE_DIRS} )
82                         SET ( LIBEDATASERVER1.0_LIBRARIES ${LIBEDATASERVER1.0_LIBRARIES} ${ORBIT2_LIBRARIES} )
83                 ENDIF ( ORBIT2_FOUND )          
84         ENDIF ( NOT ORBIT2_FOUND )
85         IF ( NOT LIBXML2_FOUND )
86                 FIND_PACKAGE ( LibXml2 REQUIRED )
87                 IF ( LIBXML2_FOUND )
88                         SET ( LIBEDATASERVER1.0_INCLUDE_DIRS ${LIBEDATASERVER1.0_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR} )
89                         SET ( LIBEDATASERVER1.0_LIBRARIES ${LIBEDATASERVER1.0_LIBRARIES} ${LIBXML2_LIBRARY} )
90                 ENDIF ( LIBXML2_FOUND )         
91         ENDIF ( NOT LIBXML2_FOUND )
92         IF ( NOT GLIB2_FOUND )
93                 FIND_PACKAGE ( GLIB2 REQUIRED )
94                 IF ( GLIB2_FOUND )
95                         SET ( LIBEDATASERVER1.0_INCLUDE_DIRS ${LIBEDATASERVER1.0_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR} )
96                         SET ( LIBEDATASERVER1.0_LIBRARIES ${LIBEDATASERVER1.0_LIBRARIES} ${GLIB2_LIBRARY} )
97                 ENDIF ( GLIB2_FOUND )           
98         ENDIF ( NOT GLIB2_FOUND )
100         # Report results
101         IF ( LIBEDATASERVER1.0_LIBRARIES AND LIBEDATASERVER1.0_INCLUDE_DIRS AND _libedataserver1.0_FOUND )
102                 SET( LIBEDATASERVER1.0_FOUND 1 )
103                 IF ( NOT LibEDataServer1.0_FIND_QUIETLY )
104                         MESSAGE( STATUS "Found libedataserver-1.0: ${LIBEDATASERVER1.0_LIBRARIES}" )
105                 ENDIF ( NOT LibEDataServer1.0_FIND_QUIETLY )
106         ELSE ( LIBEDATASERVER1.0_LIBRARIES AND LIBEDATASERVER1.0_INCLUDE_DIRS AND _libedataserver1.0_FOUND )    
107                 IF ( LibEDataServer1.0_FIND_REQUIRED )
108                         MESSAGE( SEND_ERROR "Could NOT find libedataserver-1.0" )
109                 ELSE ( LibEDataServer1.0_FIND_REQUIRED )
110                         IF ( NOT LibEDataServer1.0_FIND_QUIETLY )
111                                 MESSAGE( STATUS "Could NOT find libedataserver-1.0" )   
112                         ENDIF ( NOT LibEDataServer1.0_FIND_QUIETLY )
113                 ENDIF ( LibEDataServer1.0_FIND_REQUIRED )
114         ENDIF ( LIBEDATASERVER1.0_LIBRARIES AND LIBEDATASERVER1.0_INCLUDE_DIRS AND _libedataserver1.0_FOUND )   
116 ENDIF ( NOT LIBEDATASERVER1.0_FOUND AND NOT PKG_CONFIG_FOUND )
117 # Hide advanced variables from CMake GUIs
118 MARK_AS_ADVANCED( LIBEDATASERVER1.0_LIBRARIES LIBEDATASERVER1.0_INCLUDE_DIRS )