From 29c2e9141a0c0dd850c89b5196fba9fa8eb66d89 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 1 Nov 2021 13:01:59 +0100 Subject: [PATCH] cmake: In client configuration file get DBus1_xxx variables from cmake target The DBus1_xxx variables defined in DBusConfig.cmake for Windows builds are currently hard-coded values and independent of those of the underlying cmake target. To avoid this, these values are retrieved from the corresponding cmake target. In addition, the cmake allows the construction of the resulting relocatable runtime paths. --- cmake/DBus1Config.cmake.in | 5 +++-- dbus/CMakeLists.txt | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/DBus1Config.cmake.in b/cmake/DBus1Config.cmake.in index 1775b939..e8d9bc34 100644 --- a/cmake/DBus1Config.cmake.in +++ b/cmake/DBus1Config.cmake.in @@ -26,9 +26,10 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/DBus1Targets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/DBus1Targets.cmake") endif() - set(DBus1_DEFINITIONS) + # for compatibility, get settings from cmake target + get_target_property(DBus1_DEFINITIONS dbus-1 INTERFACE_COMPILE_DEFINITIONS) get_target_property(DBus1_INCLUDE_DIRS dbus-1 INTERFACE_INCLUDE_DIRECTORIES) - set(DBus1_LIBRARY dbus-1) + get_target_property(DBus1_LIBRARY dbus-1 IMPORTED_IMPLIB) else() message(FATAL_ERROR "Incomplete cmake support in DBus1 find_package configuration") endif() diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt index 1f545ba6..aaa5a52d 100644 --- a/dbus/CMakeLists.txt +++ b/dbus/CMakeLists.txt @@ -299,7 +299,9 @@ else(WIN32) endif() endif() +# target definitions passed to the clients target_include_directories(dbus-1 INTERFACE $;$) +target_compile_definitions(dbus-1 INTERFACE "") # Assume that Linux has -Wl,--version-script and other platforms do not if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")