summaryrefslogtreecommitdiff
blob: e4f0f11a3e649f6418e54a0cd992f04f2b0fcb19 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
diff -urN telepathy-qt4-0.5.12.old/CMakeLists.txt telepathy-qt4-0.5.12/CMakeLists.txt
--- telepathy-qt4-0.5.12.old/CMakeLists.txt	2011-03-23 08:51:03.000000000 +0100
+++ telepathy-qt4-0.5.12/CMakeLists.txt	2011-03-23 09:02:55.000000000 +0100
@@ -85,6 +85,11 @@
 include(Doxygen)
 include(MacroLogFeature)
 
+# options
+option(WITH_Glib "Enable building with glib features" ON)
+option(WITH_Farsight "Enable building with farsight features" ON)
+option(ENABLE_DEBUG_OUTPUT "Compile support for printing debug output to stderr" ON)
+
 # external dependencies
 
 # Required dependencies
@@ -98,10 +103,9 @@
 
 add_definitions(-DQT_NO_CAST_FROM_ASCII)
 
-set(ENABLE_DEBUG_OUTPUT ON CACHE BOOL "If activated, compiles support for printing debug output to stderr")
-if (ENABLE_DEBUG_OUTPUT)
+if(ENABLE_DEBUG_OUTPUT)
     add_definitions(-DENABLE_DEBUG)
-endif (ENABLE_DEBUG_OUTPUT)
+endif(ENABLE_DEBUG_OUTPUT)
 
 # Check for Qt4 Glib support
 include(CheckCXXSourceCompiles)
@@ -109,21 +113,6 @@
 set(CMAKE_REQUIRED_DEFINITIONS "")
 set(CMAKE_REQUIRED_FLAGS "")
 
-CHECK_CXX_SOURCE_COMPILES("
-#include <QtCore/QtGlobal>
-int main()
-{
-#if defined(QT_NO_GLIB)
-#error \"Qt was compiled with Glib disabled\"
-#endif
-return 0;
-}"
-QT4_GLIB_SUPPORT)
-macro_log_feature(QT4_GLIB_SUPPORT "Qt4 Glib Support"
-                  "QtCore library using Glib's main event loop"
-                  "http://qt.nokia.com/" FALSE ""
-                  "Needed, together with Telepathy-Glib, to build most of the unit tests")
-
 # Check for operator== in QDBusVariant
 SET(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY})
 CHECK_CXX_SOURCE_COMPILES("
@@ -172,50 +161,76 @@
 
 # Find GLib2, GObject, DBus and LibXml2
 # Those are needed for the insane include dir dependency hell
-find_package(GLIB2)
-find_package(GObject)
-find_package(DBus)
-find_package(DBusGLib)
-find_package(LibXml2)
-
-# Find tp-farsight
-set(TELEPATHY_FARSIGHT_MIN_VERSION "0.0.4")
-find_package(TelepathyFarsight)
-macro_log_feature(TELEPATHYFARSIGHT_FOUND "Telepathy-Farsight"
-                  "A Framework for dealing with audio/video conferencing protocols"
-                  "http://farsight.freedesktop.org/wiki/" FALSE "0.0.4"
-                  "Needed, together with GStreamer, to build telepathy-qt4-farsight and some additional examples")
-
-# Find GStreamer
-find_package(GStreamer)
-macro_log_feature(GSTREAMER_FOUND "GStreamer"
-                  "An open source multimedia framework"
-                  "Needed, together with Tp-Farsight, to build telepathy-qt4-farsight and some additional examples"
-                  "http://www.gstreamer.net/" FALSE)
-
-# Build TelepathyQt4-Farsight only if GStreamer, TelepathyFarsight and all of their dependencies were found
-if (TELEPATHYFARSIGHT_FOUND AND GSTREAMER_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND DBUS_FOUND AND LIBXML2_FOUND)
-    set (FARSIGHT_COMPONENTS_FOUND 1)
-else (TELEPATHYFARSIGHT_FOUND AND GSTREAMER_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND DBUS_FOUND AND LIBXML2_FOUND)
-    set (FARSIGHT_COMPONENTS_FOUND 0)
-endif (TELEPATHYFARSIGHT_FOUND AND GSTREAMER_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND DBUS_FOUND AND LIBXML2_FOUND)
+if(WITH_Farsight)
+	find_package(GLIB2 REQUIRED)
+	find_package(GObject REQUIRED)
+	find_package(DBus REQUIRED)
+	find_package(DBusGLib REQUIRED)
+	find_package(LibXml2 REQUIRED)
+
+	# Find tp-farsight
+	set(TELEPATHY_FARSIGHT_MIN_VERSION "0.0.4")
+	find_package(TelepathyFarsight REQUIRED)
+	macro_log_feature(TELEPATHYFARSIGHT_FOUND "Telepathy-Farsight"
+					  "A Framework for dealing with audio/video conferencing protocols"
+					  "http://farsight.freedesktop.org/wiki/" FALSE "0.0.4"
+					  "Needed, together with GStreamer, to build telepathy-qt4-farsight and some additional examples")
+
+	# Find GStreamer
+	find_package(GStreamer REQUIRED)
+	macro_log_feature(GSTREAMER_FOUND "GStreamer"
+					  "An open source multimedia framework"
+					  "Needed, together with Tp-Farsight, to build telepathy-qt4-farsight and some additional examples"
+					  "http://www.gstreamer.net/" FALSE)
+
+	# Build TelepathyQt4-Farsight only if GStreamer, TelepathyFarsight and all of their dependencies were found
+	if (TELEPATHYFARSIGHT_FOUND AND GSTREAMER_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND DBUS_FOUND AND LIBXML2_FOUND)
+		set (FARSIGHT_COMPONENTS_FOUND 1)
+	else (TELEPATHYFARSIGHT_FOUND AND GSTREAMER_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND DBUS_FOUND AND LIBXML2_FOUND)
+		set (FARSIGHT_COMPONENTS_FOUND 0)
+	endif (TELEPATHYFARSIGHT_FOUND AND GSTREAMER_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND AND DBUS_FOUND AND LIBXML2_FOUND)
+else(WITH_Farsight)
+	set(FARSIGHT_COMPONENTS_FOUND 0)
+endif(WITH_Farsight)
 
 # Find telepathy-glib
-set(TELEPATHY_GLIB_MIN_VERSION 0.13.10)
-find_package(TelepathyGlib)
-macro_log_feature(TELEPATHYGLIB_FOUND "Telepathy-glib"
-                  "Glib bindings for Telepathy"
-                  "http://telepathy.freedesktop.org/" FALSE "0.13.0"
-                  "Needed, together with Qt Glib integration, to build most of the unit tests")
-
-find_program(GLIB_GENMARSHAL glib-genmarshal)
-
-# Enable glib-based tests only if Qt4 has GLib support and Telepathy-glib was found
-if(QT4_GLIB_SUPPORT AND TELEPATHYGLIB_FOUND AND GLIB2_FOUND AND DBUS_FOUND)
-    set(ENABLE_TP_GLIB_TESTS 1)
-else(QT4_GLIB_SUPPORT AND TELEPATHYGLIB_FOUND AND GLIB2_FOUND AND DBUS_FOUND)
-    set(ENABLE_TP_GLIB_TESTS 0)
-endif(QT4_GLIB_SUPPORT AND TELEPATHYGLIB_FOUND AND GLIB2_FOUND AND DBUS_FOUND)
+if(WITH_Glib)
+	CHECK_CXX_SOURCE_COMPILES("
+	#include <QtCore/QtGlobal>
+	int main()
+	{
+	#if defined(QT_NO_GLIB)
+	#error \"Qt was compiled with Glib disabled\"
+	#endif
+	return 0;
+	}"
+	QT4_GLIB_SUPPORT)
+	macro_log_feature(QT4_GLIB_SUPPORT "Qt4 Glib Support"
+					  "QtCore library using Glib's main event loop"
+					  "http://qt.nokia.com/" FALSE ""
+					  "Needed, together with Telepathy-Glib, to build most of the unit tests")
+
+	find_package(GLIB2 REQUIRED)
+	find_package(DBus REQUIRED)
+
+	set(TELEPATHY_GLIB_MIN_VERSION 0.13.10)
+	find_package(TelepathyGlib REQUIRED)
+	macro_log_feature(TELEPATHYGLIB_FOUND "Telepathy-glib"
+					  "Glib bindings for Telepathy"
+					  "http://telepathy.freedesktop.org/" FALSE "0.13.0"
+					  "Needed, together with Qt Glib integration, to build most of the unit tests")
+
+	find_program(GLIB_GENMARSHAL glib-genmarshal)
+	# Enable glib-based tests only if Qt4 has GLib support and Telepathy-glib was found
+	if(QT4_GLIB_SUPPORT AND TELEPATHYGLIB_FOUND AND GLIB2_FOUND AND DBUS_FOUND)
+		set(ENABLE_TP_GLIB_TESTS 1)
+	else(QT4_GLIB_SUPPORT AND TELEPATHYGLIB_FOUND AND GLIB2_FOUND AND DBUS_FOUND)
+		set(ENABLE_TP_GLIB_TESTS 0)
+	endif(QT4_GLIB_SUPPORT AND TELEPATHYGLIB_FOUND AND GLIB2_FOUND AND DBUS_FOUND)
+else(WITH_Glib)
+	set(ENABLE_TP_GLIB_TESTS 0)
+endif(WITH_Glib)
+
 
 # Add the source subdirectories
 add_subdirectory(TelepathyQt4)