Merge branch 'cmake-fix-include-path' into 'master'

cmake: In generated cmake support files get value for DBus1_INCLUDE_DIRS from related cmake target

Closes #346

See merge request dbus/dbus!214
This commit is contained in:
Ralf Habacker 2021-11-18 15:12:13 +00:00
commit 9b798640a4
2 changed files with 4 additions and 5 deletions

View file

@ -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()

View file

@ -294,6 +294,8 @@ else(WIN32)
endif()
endif()
target_include_directories(dbus-1 INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/dbus-1.0>;$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}/dbus-1.0/include>)
# Assume that Linux has -Wl,--version-script and other platforms do not
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(SOVERSION ${DBUS_LIBRARY_MAJOR})