Skip to content

Commit

Permalink
Fix Qt5-Qt6 co-install
Browse files Browse the repository at this point in the history
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
  • Loading branch information
redstrate committed Jan 3, 2024
1 parent 76deb8e commit 53fcc45
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 7 additions & 2 deletions src/KDSoapClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>"
INTERFACE "$<INSTALL_INTERFACE:${client_INCLUDE_DIR}>"
)
set_target_properties(kdsoap PROPERTIES SOVERSION ${${PROJECT_NAME}_SOVERSION} VERSION ${${PROJECT_NAME}_VERSION})

Expand Down Expand Up @@ -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(
Expand Down
9 changes: 7 additions & 2 deletions src/KDSoapServer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>"
INTERFACE "$<INSTALL_INTERFACE:${server_INCLUDE_DIR}>"
)
set_target_properties(
kdsoap-server PROPERTIES SOVERSION ${${PROJECT_NAME}_SOVERSION} VERSION ${${PROJECT_NAME}_VERSION}
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 53fcc45

Please sign in to comment.