Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-07-23 21:58:00 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2017-12-14 13:19:25 +0300
commit1cedb1919f29a59f723736106dd6870a298b89de (patch)
treedddabdb7a1558cd1d442fc5f267c4dd560f33924 /cmake
parent09fa5966da2d88dd87d90e2e04a38d2d4cad1c5d (diff)
Integrate libcloudproviders support
This commit integrates support for libcloudproviders desktop integration API. If build with the library it will check on startup if the DBus interface is available and then use it instead of the legacy status icon. Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/DBusMacros.cmake0
-rw-r--r--cmake/modules/FindGLib2.cmake35
-rw-r--r--cmake/modules/FindGio.cmake61
-rw-r--r--cmake/modules/FindLibcloudproviders.cmake22
4 files changed, 118 insertions, 0 deletions
diff --git a/cmake/modules/DBusMacros.cmake b/cmake/modules/DBusMacros.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/cmake/modules/DBusMacros.cmake
diff --git a/cmake/modules/FindGLib2.cmake b/cmake/modules/FindGLib2.cmake
new file mode 100644
index 000000000..3010655ea
--- /dev/null
+++ b/cmake/modules/FindGLib2.cmake
@@ -0,0 +1,35 @@
+# FindGLib2.cmake
+
+# GLib2_FOUND - System has GLib2
+# GLib2_INCLUDES - The GLib2 include directories
+# GLib2_LIBRARIES - The libraries needed to use GLib2
+# GLib2_DEFINITIONS - Compiler switches required for using GLib2
+
+find_package(PkgConfig)
+pkg_check_modules(GLib2 QUIET glib-2.0)
+set(GLib2_DEFINITIONS ${GLib2_CFLAGS_OTHER})
+
+find_path(GLib2_INCLUDE_DIR
+ NAMES glib.h glib-object.h
+ HINTS ${GLib2_INCLUDEDIR} ${GLib2_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0)
+find_path(GLIBCONFIG_INCLUDE_DIR
+ NAMES glibconfig.h
+ HINTS ${LIBDIR} ${LIBRARY_DIRS} ${_GLib2_LIBRARY_DIR}
+ ${GLib2_INCLUDEDIR} ${GLib2_INCLUDE_DIRS}
+ ${CMAKE_EXTRA_INCLUDES} ${CMAKE_EXTRA_LIBRARIES}
+ PATH_SUFFIXES glib-2.0 glib-2.0/include)
+list(APPEND GLib2_INCLUDE_DIR ${GLIBCONFIG_INCLUDE_DIR})
+
+find_library(GLib2_LIBRARY
+ NAMES glib-2.0 libglib-2.0
+ HINTS ${GLib2_LIBDIR} ${GLib2_LIBRARY_DIRS})
+
+set(GLib2_LIBRARIES ${GLib2_LIBRARY})
+set(GLib2_INCLUDE_DIRS ${GLib2_INCLUDE_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GLib2 DEFAULT_MSG
+ GLib2_LIBRARY GLib2_INCLUDE_DIR)
+
+mark_as_advanced(GLib2_INCLUDE_DIR GLib2_LIBRARY)
diff --git a/cmake/modules/FindGio.cmake b/cmake/modules/FindGio.cmake
new file mode 100644
index 000000000..f01bbb736
--- /dev/null
+++ b/cmake/modules/FindGio.cmake
@@ -0,0 +1,61 @@
+# - Try to find Gio
+# Once done this will define
+#
+# GIO_FOUND - system has Gio
+# GIO_INCLUDE_DIR - the Gio include directory
+# GIO_LIBRARIES - the libraries needed to use Gio
+# GIO_DEFINITIONS - Compiler switches required for using Gio
+
+
+IF (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
+ # in cache already
+ SET(Gio_FIND_QUIETLY TRUE)
+ELSE (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
+ SET(Gio_FIND_QUIETLY FALSE)
+ENDIF (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ FIND_PACKAGE(PkgConfig)
+ PKG_CHECK_MODULES(GIO gio-2.0)
+ #MESSAGE(STATUS "DEBUG: Gio include directory = ${GIO_INCLUDE_DIRS}")
+ #MESSAGE(STATUS "DEBUG: Gio link directory = ${GIO_LIBRARY_DIRS}")
+ #MESSAGE(STATUS "DEBUG: Gio CFlags = ${GIO_CFLAGS}")
+ SET(GIO_DEFINITIONS ${GIO_CFLAGS_OTHER})
+ENDIF (NOT WIN32)
+
+FIND_PATH(GIO_INCLUDE_DIR gio.h
+ PATHS
+ ${GIO_INCLUDEDIR}
+ ${GIO_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0/gio/
+ )
+
+FIND_LIBRARY(_GioLibs NAMES gio-2.0 libgio-2.0
+ PATHS
+ ${GIO_LIBDIR}
+ ${GIO_LIBRARY_DIRS}
+ )
+
+SET( GIO_LIBRARIES ${_GioLibs} )
+SET( GIO_INCLUDE_DIRS ${GIO_INCLUDE_DIR} )
+
+IF (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
+ SET(GIO_FOUND TRUE)
+ELSE (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
+ SET(GIO_FOUND FALSE)
+ENDIF (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
+
+IF (GIO_FOUND)
+ IF (NOT Gio_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Gio libraries: ${GIO_LIBRARIES}")
+ MESSAGE(STATUS "Found Gio includes : ${GIO_INCLUDE_DIR}")
+ ENDIF (NOT Gio_FIND_QUIETLY)
+ELSE (GIO_FOUND)
+ IF (Gio_FIND_REQUIRED)
+ MESSAGE(STATUS "Could NOT find Gio")
+ ENDIF(Gio_FIND_REQUIRED)
+ENDIF (GIO_FOUND)
+
+MARK_AS_ADVANCED(GIO_INCLUDE_DIR _GioLibs)
diff --git a/cmake/modules/FindLibcloudproviders.cmake b/cmake/modules/FindLibcloudproviders.cmake
new file mode 100644
index 000000000..6392166e3
--- /dev/null
+++ b/cmake/modules/FindLibcloudproviders.cmake
@@ -0,0 +1,22 @@
+# FindLibcloudproviders.cmake
+
+find_path(LIBCLOUDPROVIDERS_INCLUDE_DIR
+ NAMES cloudprovidersproviderexporter.h cloudprovidersaccountexporter.h
+ PATH_SUFFIXES cloudproviders
+)
+find_library(LIBCLOUDPROVIDERS_LIBRARY
+ NAMES
+ libcloudproviders
+ cloudproviders
+ HINTS
+ /usr/lib
+ /usr/lib/${CMAKE_ARCH_TRIPLET}
+ /usr/local/lib
+ /opt/local/lib
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+)
+
+message("================> ${LIBCLOUDPROVIDERS_LIBRARY}")
+
+find_package_handle_standard_args(LIBCLOUDPROVIDERS DEFAULT_MSG LIBCLOUDPROVIDERS_INCLUDE_DIR LIBCLOUDPROVIDERS_LIBRARY)