cmake: stop using deprecated LOCATION property (policy CMP0026)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Ralf Habacker 2015-03-05 23:44:44 +01:00
parent 5d8f82d638
commit 924bff39e6
2 changed files with 4 additions and 2 deletions

View file

@ -12,6 +12,9 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
if(CMAKE_MAJOR_VERSION GREATER 2)
cmake_policy(SET CMP0026 NEW)
endif()
# detect version
include(MacrosAutotools)

View file

@ -265,10 +265,9 @@ endif()
if(WIN32)
if(DEFINED DBUS_LIBRARY_REVISION)
get_target_property(LEGACY_FILE_NAME dbus-1 LOCATION)
set_target_properties(dbus-1 PROPERTIES SUFFIX "-${DBUS_LIBRARY_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_custom_command(TARGET dbus-1 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:dbus-1>" "${LEGACY_FILE_NAME}"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:dbus-1>" "$<TARGET_FILE_DIR:dbus-1>/${CMAKE_SHARED_LIBRARY_PREFIX}dbus-1${CMAKE_SHARED_LIBRARY_SUFFIX}"
COMMENT "Create non versioned dbus-1 library for legacy applications"
)
install(FILES ${LEGACY_FILE_NAME} DESTINATION bin)