From: Ralf Habacker Date: Mon, 1 Nov 2021 12:01:59 +0000 (+0100) Subject: cmake: In generated cmake support files get value for DBus1_INCLUDE_DIRS variable... X-Git-Tag: dbus-1.13.20~30^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2ccc6773b73520486faa663a1d4da4ba4189b33;p=thirdparty%2Fdbus.git cmake: In generated cmake support files get value for DBus1_INCLUDE_DIRS variable from related cmake target This allows cmake to construct the resulting (relocatable) runtime paths. Fixes dbus/dbus#346 --- diff --git a/cmake/DBus1Config.cmake.in b/cmake/DBus1Config.cmake.in index c389d5eaa..1775b939a 100644 --- a/cmake/DBus1Config.cmake.in +++ b/cmake/DBus1Config.cmake.in @@ -26,12 +26,9 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/DBus1Targets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/DBus1Targets.cmake") endif() - set(DBus1_INCLUDE_DIRS "${DBus1_INSTALL_DIR}/@CMAKE_INSTALL_INCLUDEDIR@/dbus-1.0" "${DBus1_INSTALL_DIR}/@CMAKE_INSTALL_LIBDIR@/dbus-1.0/include") set(DBus1_DEFINITIONS) - set(DBus1_LIBRARIES dbus-1) - - set_property(TARGET dbus-1 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${DBus1_INCLUDE_DIRS}) - set_property(TARGET dbus-1 PROPERTY INTERFACE_COMPILE_DEFINITIONS ${DBus1_DEFINITIONS}) + get_target_property(DBus1_INCLUDE_DIRS dbus-1 INTERFACE_INCLUDE_DIRECTORIES) + set(DBus1_LIBRARY dbus-1) else() message(FATAL_ERROR "Incomplete cmake support in DBus1 find_package configuration") endif() diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt index a603a1aa1..e9203ca67 100644 --- a/dbus/CMakeLists.txt +++ b/dbus/CMakeLists.txt @@ -294,6 +294,8 @@ else(WIN32) endif() endif() +target_include_directories(dbus-1 INTERFACE $;$) + # Assume that Linux has -Wl,--version-script and other platforms do not if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(SOVERSION ${DBUS_LIBRARY_MAJOR})