Skip to content

Commit

Permalink
fixup! refactor: Port to Qt 6
Browse files Browse the repository at this point in the history
  • Loading branch information
ltoenning committed Nov 6, 2024
1 parent 8852eb2 commit 81987b8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 40 deletions.
28 changes: 8 additions & 20 deletions cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ if(UNIX AND NOT APPLE)
endmacro()


if(EXISTS ${QT_INSTALL_LIBS}/libicui18n.so.56 AND EXISTS ${QT_INSTALL_LIBS}/libicuuc.so.56 AND EXISTS ${QT_INSTALL_LIBS}/libicudata.so.56)
if(EXISTS ${QT_INSTALL_LIBS}/libicui18n.so.73 AND EXISTS ${QT_INSTALL_LIBS}/libicuuc.so.73 AND EXISTS ${QT_INSTALL_LIBS}/libicudata.so.73)
# Use specific requested version that is found in the Qt library dir (at least in the Github Actions environment)
message(STATUS "Install specific libicu version from Qt dir")
installLib(${QT_INSTALL_LIBS} libicui18n.so.56)
installLib(${QT_INSTALL_LIBS} libicuuc.so.56)
installLib(${QT_INSTALL_LIBS} libicudata.so.56)
installLib(${QT_INSTALL_LIBS} libicui18n.so.73)
installLib(${QT_INSTALL_LIBS} libicuuc.so.73)
installLib(${QT_INSTALL_LIBS} libicudata.so.73)
else()
message(STATUS "Using systems libicu library")
# This might not work for creating the installer as the version can differ
Expand All @@ -91,21 +91,9 @@ if(UNIX AND NOT APPLE)
install(FILES ${ICU_I18N_ABS} ${ICU_UC_ABS} ${ICU_DATA_ABS} TYPE LIB)
endif()

file(GLOB audioPlugins ${QT_INSTALL_PLUGINS}/audio/*.so)
install(FILES ${audioPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/audio)

file(GLOB bearerPlugins ${QT_INSTALL_PLUGINS}/bearer/*.so)
install(FILES ${bearerPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/bearer)

file(GLOB iconEnginePlugins ${QT_INSTALL_PLUGINS}/iconengines/*.so)
install(FILES ${iconEnginePlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/iconengines)

file(GLOB imageformatsPlugins ${QT_INSTALL_PLUGINS}/imageformats/*.so)
install(FILES ${imageformatsPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/imageformats)

file(GLOB mediaservicePlugins ${QT_INSTALL_PLUGINS}/mediaservice/*.so)
install(FILES ${mediaservicePlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/mediaservice)

install(FILES ${QT_INSTALL_PLUGINS}/platforms/libqxcb.so DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/platforms)

file(GLOB platforminputcontextsPlugins ${QT_INSTALL_PLUGINS}/platforminputcontexts/*.so)
Expand All @@ -114,6 +102,9 @@ if(UNIX AND NOT APPLE)
file(GLOB platformthemesPlugins ${QT_INSTALL_PLUGINS}/platformthemes/*.so)
install(FILES ${platformthemesPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/platformthemes)

file(GLOB tlsPlugins ${QT_INSTALL_PLUGINS}/tls/*.so)
install(FILES ${tlsPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/tls)

file(GLOB xcbglintegrationsPlugins ${QT_INSTALL_PLUGINS}/xcbglintegrations/*.so)
install(FILES ${xcbglintegrationsPlugins} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/xcbglintegrations)

Expand All @@ -123,14 +114,11 @@ elseif(APPLE)
install(SCRIPT ${PROJECT_SOURCE_DIR}/cmake/qt_deploy_mac.cmake)

# Install plugins
execute_process(COMMAND qmake -query QT_INSTALL_PLUGINS OUTPUT_VARIABLE QT_INSTALL_PLUGINS)
execute_process(COMMAND qmake6 -query QT_INSTALL_PLUGINS OUTPUT_VARIABLE QT_INSTALL_PLUGINS)
string(STRIP ${QT_INSTALL_PLUGINS} QT_INSTALL_PLUGINS)

install(DIRECTORY ${QT_INSTALL_PLUGINS}/audio DESTINATION bin FILES_MATCHING PATTERN "*.dylib")
install(DIRECTORY ${QT_INSTALL_PLUGINS}/bearer DESTINATION bin FILES_MATCHING PATTERN "*.dylib")
install(DIRECTORY ${QT_INSTALL_PLUGINS}/iconengines DESTINATION bin FILES_MATCHING PATTERN "*.dylib")
install(DIRECTORY ${QT_INSTALL_PLUGINS}/imageformats DESTINATION bin FILES_MATCHING PATTERN "*.dylib")
install(DIRECTORY ${QT_INSTALL_PLUGINS}/mediaservice DESTINATION bin FILES_MATCHING PATTERN "*.dylib")
install(FILES ${QT_INSTALL_PLUGINS}/platforms/libqcocoa.dylib DESTINATION bin/platforms)
install(DIRECTORY ${QT_INSTALL_PLUGINS}/platforminputcontexts DESTINATION bin FILES_MATCHING PATTERN "*.dylib")
install(DIRECTORY ${QT_INSTALL_PLUGINS}/platformthemes DESTINATION bin FILES_MATCHING PATTERN "*.dylib")
Expand Down
2 changes: 1 addition & 1 deletion cmake/qt_deploy_mac.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors
# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1

execute_process(COMMAND qmake -query QT_INSTALL_LIBS OUTPUT_VARIABLE QT_INSTALL_LIBS)
execute_process(COMMAND qmake6 -query QT_INSTALL_LIBS OUTPUT_VARIABLE QT_INSTALL_LIBS)

string(STRIP ${QT_INSTALL_LIBS} QT_INSTALL_LIBS)

Expand Down
6 changes: 5 additions & 1 deletion cmake/qt_deploy_win.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1

message(STATUS "Running windeployqt")
execute_process(COMMAND windeployqt.exe
execute_process(COMMAND qmake6 -query QT_INSTALL_BINS OUTPUT_VARIABLE QT_INSTALL_BINS)

string(STRIP ${QT_INSTALL_BINS} QT_INSTALL_BINS)

execute_process(COMMAND ${QT_INSTALL_BINS}/windeployqt.exe
${CMAKE_INSTALL_PREFIX}/bin/core.dll
${CMAKE_INSTALL_PREFIX}/bin/gui.dll
${CMAKE_INSTALL_PREFIX}/bin/input.dll
Expand Down
50 changes: 32 additions & 18 deletions installer/installbuilder/qt6-binaries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,52 +64,52 @@
<platforms>linux linux-x64</platforms>
<distributionFileList>
<distributionFile>
<origin>../../dist/lib/libicudata.so.56</origin>
<origin>../../dist/lib/libicudata.so.73</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libicui18n.so.56</origin>
<origin>../../dist/lib/libicui18n.so.73</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libicuuc.so.56</origin>
<origin>../../dist/lib/libicuuc.so.73</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5Core.so.5</origin>
<origin>../../dist/lib/libQt6Core.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5DBus.so.5</origin>
<origin>../../dist/lib/libQt6DBus.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5Gui.so.5</origin>
<origin>../../dist/lib/libQt6Gui.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5Multimedia.so.5</origin>
<origin>../../dist/lib/libQt6Multimedia.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5MultimediaGstTools.so.5</origin>
<origin>../../dist/lib/libQt6MultimediaGstTools.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5MultimediaWidgets.so.5</origin>
<origin>../../dist/lib/libQt6MultimediaWidgets.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5Network.so.5</origin>
<origin>../../dist/lib/libQt6Network.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5OpenGL.so.5</origin>
<origin>../../dist/lib/libQt6OpenGL.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5Qml.so.5</origin>
<origin>../../dist/lib/libQt6Qml.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5Svg.so.5</origin>
<origin>../../dist/lib/libQt6Svg.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5Widgets.so.5</origin>
<origin>../../dist/lib/libQt6Widgets.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5XcbQpa.so.5</origin>
<origin>../../dist/lib/libQt6XcbQpa.so.6</origin>
</distributionFile>
<distributionFile>
<origin>../../dist/lib/libQt5Xml.so.5</origin>
<origin>../../dist/lib/libQt6Xml.so.6</origin>
</distributionFile>
</distributionFileList>
</folder>
Expand Down Expand Up @@ -181,7 +181,8 @@
<platforms>all</platforms>
<distributionFileList>
<distributionDirectory>
<origin>../../dist/bin/iconengines</origin>
<allowWildcards>1</allowWildcards>
<origin>../../dist/bin/iconengines*</origin>
</distributionDirectory>
<distributionDirectory>
<origin>../../dist/bin/imageformats</origin>
Expand All @@ -190,11 +191,24 @@
<origin>../../dist/bin/platforms</origin>
</distributionDirectory>
<distributionDirectory>
<origin>../../dist/bin/styles</origin>
<allowWildcards>1</allowWildcards>
<origin>../../dist/bin/platforminputcontexts*</origin>
</distributionDirectory>
<distributionDirectory>
<allowWildcards>1</allowWildcards>
<origin>../../dist/bin/platformthemes*</origin>
</distributionDirectory>
<distributionDirectory>
<allowWildcards>1</allowWildcards>
<origin>../../dist/bin/styles*</origin>
</distributionDirectory>
<distributionDirectory>
<origin>../../dist/bin/tls</origin>
</distributionDirectory>
<distributionDirectory>
<allowWildcards>1</allowWildcards>
<origin>../../dist/bin/xcbglintegrations*</origin>
</distributionDirectory>
</distributionFileList>
</folder>
</folderList>
Expand Down

0 comments on commit 81987b8

Please sign in to comment.