From 53fcc451e13a7c71dc38e2122f58aa5d81038133 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 3 Jan 2024 10:19:02 -0500 Subject: [PATCH] Fix Qt5-Qt6 co-install This prevents collisions between Qt5 and Qt6 versions because the headers were installed to the same location. Qt5 keeps the "KDSoapClient"/"KDSoapServer" header location, but Qt6 is now installed inside a KDSoapX-Qt6 subdirectory. This allows existing client code to keep working. Fixes #262 --- CMakeLists.txt | 6 +++++- src/KDSoapClient/CMakeLists.txt | 9 +++++++-- src/KDSoapServer/CMakeLists.txt | 9 +++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d17be656..67945d69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,7 +207,11 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) COMPATIBILITY AnyNewerVersion ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kdsoap_version.h" DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient) + if(${PROJECT_NAME}_QT6) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kdsoap_version.h" DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient-Qt6/KDSoapClient) + else() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kdsoap_version.h" DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient) + endif() configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/KDSoapConfig-buildtree.cmake.in" diff --git a/src/KDSoapClient/CMakeLists.txt b/src/KDSoapClient/CMakeLists.txt index b9040aa9..d17044f7 100644 --- a/src/KDSoapClient/CMakeLists.txt +++ b/src/KDSoapClient/CMakeLists.txt @@ -46,9 +46,14 @@ endif() target_link_libraries( kdsoap ${QT_LIBRARIES} ) +if(${PROJECT_NAME}_QT6) + set(client_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}/KDSoapClient-Qt6) +else() + set(client_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}) +endif() target_include_directories( kdsoap - INTERFACE "$" + INTERFACE "$" ) set_target_properties(kdsoap PROPERTIES SOVERSION ${${PROJECT_NAME}_SOVERSION} VERSION ${${PROJECT_NAME}_VERSION}) @@ -111,7 +116,7 @@ if(KDSoap_IS_ROOT_PROJECT) KDSoapEndpointReference.h KDQName.h KDSoapUdpClient.h - DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient + DESTINATION ${client_INCLUDE_DIR}/KDSoapClient ) install( diff --git a/src/KDSoapServer/CMakeLists.txt b/src/KDSoapServer/CMakeLists.txt index a4a0e812..364ec042 100644 --- a/src/KDSoapServer/CMakeLists.txt +++ b/src/KDSoapServer/CMakeLists.txt @@ -37,9 +37,14 @@ endif() target_link_libraries( kdsoap-server kdsoap ${QT_LIBRARIES} ) +if(${PROJECT_NAME}_QT6) + set(server_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}/KDSoapServer-Qt6) +else() + set(server_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}) +endif() target_include_directories( kdsoap-server - INTERFACE "$" + INTERFACE "$" ) set_target_properties( kdsoap-server PROPERTIES SOVERSION ${${PROJECT_NAME}_SOVERSION} VERSION ${${PROJECT_NAME}_VERSION} @@ -88,7 +93,7 @@ if(KDSoap_IS_ROOT_PROJECT) KDSoapServerObjectInterface.h KDSoapServerGlobal.h KDSoapThreadPool.h - DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapServer + DESTINATION ${server_INCLUDE_DIR}/KDSoapServer ) install(