diff options
author | Christian Kamm <mail@ckamm.de> | 2019-05-02 16:26:02 +0300 |
---|---|---|
committer | Christian Kamm <mail@ckamm.de> | 2019-06-07 10:26:33 +0300 |
commit | 2c0a379f3acfcc5dad70683c81d22d2a13f148e0 (patch) | |
tree | ffdaf10382bfdd76c1ba45b83e568ba1222544bd /cmake | |
parent | a6f93919abde390c997df79af98fec14ff9a9813 (diff) |
Minimal libcloudproviders support #7209
- Add it as an optional dependency for linux builds,
controlled by WITH_LIBCLOUDPROVIDERS, which is enabled automatically
if the dependencies are available. Note that >=0.3.0 is required.
- Add code to export sync folders through the library and to add a
minimal "Settings..." menu action.
- Set up cloud provider registration by installing a file into a
path like /usr/share/cloud-providers/.
- DBus name and path are derived from APPLICATION_REV_DOMAIN by default
and may be overridden with APPLICATION_CLOUDPROVIDERS_DBUS_NAME and
APPLICATION_CLOUDPROVIDERS_DBUS_PATH if necessary.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindLibcloudproviders.cmake | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/cmake/modules/FindLibcloudproviders.cmake b/cmake/modules/FindLibcloudproviders.cmake new file mode 100644 index 000000000..39edb200c --- /dev/null +++ b/cmake/modules/FindLibcloudproviders.cmake @@ -0,0 +1,42 @@ +# (c) 2019 Copyright ownCloud GmbH +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING* file. + +find_path(LIBCLOUDPROVIDERS_INCLUDE_DIR + NAMES + cloudprovidersaccountexporter.h + cloudprovidersproviderexporter.h + PATH_SUFFIXES + cloudproviders + ) + +find_library(LIBCLOUDPROVIDERS_LIBRARY + NAMES + cloudproviders + PATHS + /usr/lib + /usr/lib/${CMAKE_ARCH_TRIPLET} + /usr/local/lib + ${CMAKE_LIBRARY_PATH} + ${CMAKE_INSTALL_PREFIX}/lib + ) + +# Using version <0.3.0 would lead to crashes during runtime when accounts are unexported. +get_filename_component(LIBCLOUDPROVIDERS_LIBRARY_REALPATH ${LIBCLOUDPROVIDERS_LIBRARY} REALPATH) +if(${LIBCLOUDPROVIDERS_LIBRARY_REALPATH} MATCHES "\.([0-9]*)\.([0-9]*)\.([0-9]*)$") + if ((${CMAKE_MATCH_1} EQUAL 0) AND (${CMAKE_MATCH_2} LESS 3)) + message("libcloudproviders version is older than 0.3.0, not enabling it") + set(LIBCLOUDPROVIDERS_LIBRARY "") + endif() +else() + message("Can't determine libcloudproviders version, not enabling it") + set(LIBCLOUDPROVIDERS_LIBRARY "") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + LIBCLOUDPROVIDERS + DEFAULT_MSG + LIBCLOUDPROVIDERS_LIBRARY LIBCLOUDPROVIDERS_INCLUDE_DIR) + +mark_as_advanced(LIBCLOUDPROVIDERS_INCLUDE_DIR LIBCLOUDPROVIDERS_LIBRARY) |