libcloudproviders: Use DEFINE_VARIABLES to install in the correct directory

Conditionnaly require CMake 3.28 to install in the right directory.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
This commit is contained in:
Corentin Noël 2023-10-12 16:26:39 +02:00 committed by Matthieu Gallien
parent baa19e485c
commit 6e1e8a8bdc

View file

@ -1,5 +1,9 @@
macro(dbus_add_activation_service _sources)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.28.0")
pkg_get_variable(_install_dir dbus-1 session_bus_services_dir DEFINE_VARIABLES datadir=${CMAKE_INSTALL_DATADIR})
else()
pkg_get_variable(_install_dir dbus-1 session_bus_services_dir)
endif()
foreach (_i ${_sources})
get_filename_component(_service_file ${_i} ABSOLUTE)
string(REGEX REPLACE "\\.service.*$" ".service" _output_file ${_i})