mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 14:05:58 +03:00
7f72678d32
Commit b34a901838
("Use FindPkgConfig to find libcloudproviders and
related libs") introduced the usage of cmake's FindPkgConfig module
which provides `pkg_get_variable` since version 3.4 that can be used
instead of the custom `PKGCONFIG_GETVAR` macro
Signed-off-by: Marvin Schmidt <marv@exherbo.org>
38 lines
1.8 KiB
CMake
38 lines
1.8 KiB
CMake
macro(dbus_add_activation_service _sources)
|
|
pkg_get_variable(_install_dir dbus-1 session_bus_services_dir)
|
|
foreach (_i ${_sources})
|
|
get_filename_component(_service_file ${_i} ABSOLUTE)
|
|
string(REGEX REPLACE "\\.service.*$" ".service" _output_file ${_i})
|
|
set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_output_file})
|
|
configure_file(${_service_file} ${_target})
|
|
install(FILES ${_target} DESTINATION ${_install_dir} RENAME "${LIBCLOUDPROVIDERS_DBUS_BUS_NAME}.service")
|
|
endforeach (_i ${ARGN})
|
|
endmacro(dbus_add_activation_service _sources)
|
|
|
|
macro(libcloudproviders_add_config _sources)
|
|
set(_install_dir "${CMAKE_INSTALL_PREFIX}/share/cloud-providers")
|
|
foreach (_i ${_sources})
|
|
get_filename_component(_service_file ${_i} ABSOLUTE)
|
|
string(REGEX REPLACE "\\.ini.*$" ".ini" _output_file ${_i})
|
|
set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_output_file})
|
|
configure_file(${_service_file} ${_target})
|
|
install(FILES ${_target} DESTINATION ${_install_dir} RENAME "${LIBCLOUDPROVIDERS_DBUS_BUS_NAME}.ini")
|
|
endforeach (_i ${ARGN})
|
|
endmacro(libcloudproviders_add_config _sources)
|
|
|
|
|
|
find_package(Qt5 5.15 COMPONENTS DBus)
|
|
IF (Qt5DBus_FOUND)
|
|
STRING(TOLOWER "${APPLICATION_VENDOR}" DBUS_VENDOR)
|
|
STRING(REGEX REPLACE "[^A-z0-9]" "" DBUS_VENDOR "${DBUS_VENDOR}")
|
|
STRING(REGEX REPLACE "[^A-z0-9]" "" DBUS_APPLICATION_NAME "${APPLICATION_SHORTNAME}")
|
|
if (NOT DBUS_PREFIX)
|
|
set(DBUS_PREFIX "com")
|
|
endif ()
|
|
|
|
set(LIBCLOUDPROVIDERS_DBUS_BUS_NAME "${DBUS_PREFIX}.${DBUS_VENDOR}.${DBUS_APPLICATION_NAME}")
|
|
set(LIBCLOUDPROVIDERS_DBUS_OBJECT_PATH "/${DBUS_PREFIX}/${DBUS_VENDOR}/${DBUS_APPLICATION_NAME}")
|
|
|
|
dbus_add_activation_service(org.freedesktop.CloudProviders.service.in)
|
|
libcloudproviders_add_config(org.freedesktop.CloudProviders.ini.in)
|
|
ENDIF ()
|