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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
From 13f203672155cd52278655f03da7ff8dcff75c29 Mon Sep 17 00:00:00 2001
From: Andrey Gankov <gankov@opensuse.org>
Date: Sat, 10 Mar 2012 02:55:32 +0400
Subject: [PATCH] Fix Issue #9: linker error
---
cmake/FindGLIB2.cmake | 120 ++++++++++++++++++++++++++++++++++++++++++++++++
cmake/FindGTK2.cmake | 21 ++-------
cmake/FindGTK3.cmake | 24 +++-------
remmina/CMakeLists.txt | 9 ++++
4 files changed, 140 insertions(+), 34 deletions(-)
create mode 100644 cmake/FindGLIB2.cmake
diff --git a/cmake/FindGLIB2.cmake b/cmake/FindGLIB2.cmake
new file mode 100644
index 0000000..8208ded
--- /dev/null
+++ b/cmake/FindGLIB2.cmake
@@ -0,0 +1,120 @@
+# Remmina - The GTK+ Remote Desktop Client
+#
+# Copyright (C) 2012 Andrey Gankov
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330,
+# Boston, MA 02111-1307, USA.
+
+set(_GLIB_found_all true)
+
+# Glib
+
+pkg_check_modules(PC_GLIB2 glib-2.0)
+
+if(NOT PC_GLIB2_FOUND)
+ set(_GLIB_found_all false)
+endif()
+
+find_path(GLIB2_INCLUDE_DIR_PART1 NAMES glib.h
+ HINTS ${PC_GLIB2_INCLUDEDIR} ${PC_GLIB2_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0)
+
+find_path(GLIB2_INCLUDE_DIR_PART2 NAMES glibconfig.h
+ HINTS ${PC_GLIB2_INCLUDEDIR} ${PC_GLIB2_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0/include)
+
+set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR_PART1} ${GLIB2_INCLUDE_DIR_PART2})
+
+find_library(GLIB2_LIBRARY NAMES glib-2.0)
+
+# GIO
+
+pkg_check_modules(PC_GIO gio-2.0)
+
+if(NOT PC_GIO_FOUND)
+ set(_GLIB_found_all false)
+endif()
+
+find_path(GIO_INCLUDE_DIR gio/gio.h
+ HINTS ${PC_GIO_INCLUDEDIR} ${PC_GIO_INCLUDE_DIRS}
+ PATH_SUFFIXES gio-2.0)
+
+find_library(GIO_LIBRARY NAMES gio-2.0
+ HINTS ${PC_GIO_LIBDIR} ${PC_GIO_LIBRARY_DIRS})
+
+# gobject
+
+pkg_check_modules(PC_GOBJECT gobject-2.0)
+
+if(NOT PC_GOBJECT_FOUND)
+ set(_GLIB_found_all false)
+endif()
+
+find_path(GOBJECT_INCLUDE_DIR gobject/gobject.h
+ HINTS ${PC_GOBJECT_INCLUDEDIR} ${PC_GOBJECT_INCLUDE_DIRS}
+ PATH_SUFFIXES gobject-2.0)
+
+find_library(GOBJECT_LIBRARY NAMES gobject-2.0
+ HINTS ${PC_GOBJECT_LIBDIR} ${PC_GOBJECT_LIBRARY_DIRS})
+
+# gmodule
+
+pkg_check_modules(PC_GMODULE gmodule-2.0)
+
+if(NOT PC_GMODULE_FOUND)
+ set(_GLIB_found_all false)
+endif()
+
+find_path(GMODULE_INCLUDE_DIR gmodule.h
+ HINTS ${PC_GMODULE_INCLUDEDIR} ${PC_GMODULE_INCLUDE_DIRS}
+ PATH_SUFFIXES gmodule-2.0)
+
+find_library(GMODULE_LIBRARY NAMES gmodule-2.0
+ HINTS ${PC_GMODULE_LIBDIR} ${PC_GMODULE_LIBRARY_DIRS})
+
+# gthread
+
+pkg_check_modules(PC_GTHREAD gthread-2.0)
+
+if(NOT PC_GTHREAD_FOUND)
+ set(_GLIB_found_all false)
+endif()
+
+find_path(GTHREAD_INCLUDE_DIR glib/gthread.h
+ HINTS ${PC_GTHREAD_INCLUDEDIR} ${PC_GTHREAD_INCLUDE_DIRS}
+ PATH_SUFFIXES gthread-2.0)
+
+find_library(GTHREAD_LIBRARY NAMES gthread-2.0
+ HINTS ${PC_GTHREAD_LIBDIR} ${PC_GTHREAD_LIBRARY_DIRS})
+
+# Finalize
+
+if(_GLIB_found_all)
+ include(FindPackageHandleStandardArgs)
+
+ find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARY GLIB2_INCLUDE_DIR)
+
+ set(GLIB2_LIBRARIES ${GLIB2_LIBRARY} ${GIO_LIBRARY} ${GOBJECT_LIBRARY} ${GMODULE_LIBRARY} ${GTHREAD_LIBRARY})
+ set(GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${GIO_INCLUDE_DIR} ${GOBJECT_INCLUDE_DIR} ${GMODULE_INCLUDE_DIR} ${GTHREAD_INCLUDE_DIR})
+
+ mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARY)
+
+ set(GLIB_FOUND true)
+else()
+ unset(GLIB2_LIBRARY)
+ unset(GLIB2_INCLUDE_DIR)
+
+ set(GLIB_FOUND false)
+endif()
diff --git a/cmake/FindGTK2.cmake b/cmake/FindGTK2.cmake
index b33966e..caf0295 100644
--- a/cmake/FindGTK2.cmake
+++ b/cmake/FindGTK2.cmake
@@ -63,24 +63,11 @@ find_library(GDKPIXBUF_LIBRARY NAMES gdk_pixbuf-2.0
# Glib
-pkg_check_modules(PC_GLIB2 glib-2.0)
-
-if(NOT PC_GLIB2_FOUND)
+find_required_package(GLIB2)
+if(NOT GLIB2_FOUND)
set(_GTK2_found_all false)
endif()
-find_path(GLIB2_INCLUDE_DIR_PART1 NAMES glib.h
- HINTS ${PC_GLIB2_INCLUDEDIR} ${PC_GLIB2_INCLUDE_DIRS}
- PATH_SUFFIXES glib-2.0)
-
-find_path(GLIB2_INCLUDE_DIR_PART2 NAMES glibconfig.h
- HINTS ${PC_GLIB2_INCLUDEDIR} ${PC_GLIB2_INCLUDE_DIRS}
- PATH_SUFFIXES glib-2.0/include)
-
-set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR_PART1} ${GLIB2_INCLUDE_DIR_PART2})
-
-find_library(GLIB2_LIBRARY NAMES glib-2.0)
-
# Pango
pkg_check_modules(PC_PANGO pango)
@@ -129,8 +116,8 @@ if(_GTK2_found_all)
find_package_handle_standard_args(GTK2 DEFAULT_MSG GTK2_LIBRARY GTK2_INCLUDE_DIR)
- set(GTK2_LIBRARIES ${GTK2_LIBRARY} ${GDK2_LIBRARY} ${GLIB2_LIBRARY} ${PANGO_LIBRARY} ${CAIRO_LIBRARY} ${GDKPIXBUF_LIBRARY} ${ATK_LIBRARY})
- set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIR} ${GDK2_INCLUDE_DIR} ${GLIB2_INCLUDE_DIR} ${PANGO_INCLUDE_DIR} ${CAIRO_INCLUDE_DIR} ${GDKPIXBUF_INCLUDE_DIR} ${ATK_INCLUDE_DIR})
+ set(GTK2_LIBRARIES ${GTK2_LIBRARY} ${GDK2_LIBRARY} ${GLIB2_LIBRARIES} ${PANGO_LIBRARY} ${CAIRO_LIBRARY} ${GDKPIXBUF_LIBRARY} ${ATK_LIBRARY})
+ set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIR} ${GDK2_INCLUDE_DIR} ${GLIB2_INCLUDE_DIRS} ${PANGO_INCLUDE_DIR} ${CAIRO_INCLUDE_DIR} ${GDKPIXBUF_INCLUDE_DIR} ${ATK_INCLUDE_DIR})
mark_as_advanced(GTK2_INCLUDE_DIR GTK2_LIBRARY)
diff --git a/cmake/FindGTK3.cmake b/cmake/FindGTK3.cmake
index f73b64d..decb00a 100644
--- a/cmake/FindGTK3.cmake
+++ b/cmake/FindGTK3.cmake
@@ -53,24 +53,11 @@ find_library(GDKPIXBUF_LIBRARY NAMES gdk_pixbuf-2.0
# Glib
-pkg_check_modules(PC_GLIB2 glib-2.0)
-
-if(NOT PC_GLIB2_FOUND)
+find_required_package(GLIB2)
+if(NOT GLIB2_FOUND)
set(_GTK3_found_all false)
endif()
-find_path(GLIB2_INCLUDE_DIR_PART1 NAMES glib.h
- HINTS ${PC_GLIB2_INCLUDEDIR} ${PC_GLIB2_INCLUDE_DIRS}
- PATH_SUFFIXES glib-2.0)
-
-find_path(GLIB2_INCLUDE_DIR_PART2 NAMES glibconfig.h
- HINTS ${PC_GLIB2_INCLUDEDIR} ${PC_GLIB2_INCLUDE_DIRS}
- PATH_SUFFIXES glib-2.0/include)
-
-set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR_PART1} ${GLIB2_INCLUDE_DIR_PART2})
-
-find_library(GLIB2_LIBRARY NAMES glib-2.0)
-
# Pango
pkg_check_modules(PC_PANGO pango)
@@ -119,14 +106,17 @@ if(_GTK3_found_all)
find_package_handle_standard_args(GTK3 DEFAULT_MSG GTK3_LIBRARY GTK3_INCLUDE_DIR)
- set(GTK3_LIBRARIES ${GTK3_LIBRARY} ${GDK3_LIBRARY} ${GLIB2_LIBRARY} ${PANGO_LIBRARY} ${CAIRO_LIBRARY} ${GDKPIXBUF_LIBRARY} ${ATK_LIBRARY})
- set(GTK3_INCLUDE_DIRS ${GTK3_INCLUDE_DIR} ${GLIB2_INCLUDE_DIR} ${PANGO_INCLUDE_DIR} ${CAIRO_INCLUDE_DIR} ${GDKPIXBUF_INCLUDE_DIR} ${ATK_INCLUDE_DIR})
+ set(GTK3_LIBRARIES ${GTK3_LIBRARY} ${GDK3_LIBRARY} ${GLIB2_LIBRARIES} ${PANGO_LIBRARY} ${CAIRO_LIBRARY} ${GDKPIXBUF_LIBRARY} ${ATK_LIBRARY})
+ set(GTK3_INCLUDE_DIRS ${GTK3_INCLUDE_DIR} ${GLIB2_INCLUDE_DIRS} ${PANGO_INCLUDE_DIR} ${CAIRO_INCLUDE_DIR} ${GDKPIXBUF_INCLUDE_DIR} ${ATK_INCLUDE_DIR})
mark_as_advanced(GTK3_INCLUDE_DIR GTK3_LIBRARY)
set(GTK3_FOUND true)
else()
unset(GTK3_LIBRARY)
+ unset(GTK3_INCLUDE_DIR)
+
+ unset(GDK3_LIBRARY)
unset(GDK3_INCLUDE_DIR)
set(GTK3_FOUND false)
diff --git a/remmina/CMakeLists.txt b/remmina/CMakeLists.txt
index 0fe7bbf..9e7c982 100644
--- a/remmina/CMakeLists.txt
+++ b/remmina/CMakeLists.txt
@@ -93,6 +93,10 @@ add_executable(remmina ${REMMINA_SRCS})
include_directories(${GTK_INCLUDE_DIRS})
target_link_libraries(remmina ${GTK_LIBRARIES})
+find_package(X11)
+include_directories(${X11_INCLUDE_DIR})
+target_link_libraries(remmina ${X11_LIBRARIES})
+
find_suggested_package(LIBSSH)
if(LIBSSH_FOUND)
add_definitions(-DHAVE_LIBSSH)
@@ -100,6 +104,11 @@ if(LIBSSH_FOUND)
target_link_libraries(remmina ${LIBSSH_LIBRARIES})
endif()
+if(PTHREAD_FOUND)
+ include_directories(${PTHREAD_INCLUDE_DIRS})
+ target_link_libraries(remmina ${PTHREAD_LIBRARIES})
+endif()
+
if(GCRYPT_FOUND)
include_directories(${GCRYPT_INCLUDE_DIRS})
target_link_libraries(remmina ${GCRYPT_LIBRARIES})
--
1.7.5.4
|