diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-01-18 02:32:35 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-01-18 07:36:40 -0800 |
| commit | d9d3744484b1dbe166d2036764f5d78b486e7290 (patch) | |
| tree | 497ab16619dd5b35b9fc3ef253aa686ad040fea0 | |
| parent | 7b0cfc6f6c5464e4f008b5ccbd99c9ac01e95bee (diff) | |
| download | vcpkg-d9d3744484b1dbe166d2036764f5d78b486e7290.tar.gz vcpkg-d9d3744484b1dbe166d2036764f5d78b486e7290.zip | |
[qt5-base] Restore qtdeploy.ps1
| -rw-r--r-- | ports/qt5-base/portfile.cmake | 2 | ||||
| -rw-r--r-- | ports/qt5-base/qtdeploy.ps1 | 68 |
2 files changed, 70 insertions, 0 deletions
diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 0badd0477..9284f09b5 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -111,4 +111,6 @@ file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PA file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/plugins) + file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/qt5-base/qtdeploy.ps1 b/ports/qt5-base/qtdeploy.ps1 new file mode 100644 index 000000000..9d514e411 --- /dev/null +++ b/ports/qt5-base/qtdeploy.ps1 @@ -0,0 +1,68 @@ +# This script is based on the implementation of windeployqt for qt5.7.1 +# +# Qt's plugin deployment strategy is that each main Qt Module has a hardcoded +# set of plugin subdirectories. Each of these subdirectories is deployed in +# full if that Module is referenced. +# +# This hardcoded list is found inside qttools\src\windeployqt\main.cpp. For +# updating, inspect the symbols qtModuleEntries and qtModuleForPlugin. + +# Note: this function signature and behavior is depended upon by applocal.ps1 +function deployPluginsIfQt([string]$targetBinaryDir, [string]$QtPluginsDir, [string]$targetBinaryName) { + + function deployPlugins([string]$pluginSubdirName) { + if (Test-Path "$QtPluginsDir\$pluginSubdirName") { + Write-Verbose " Deploying plugins directory '$pluginSubdirName'" + New-Item "$targetBinaryDir\$pluginSubdirName" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null + Get-ChildItem "$QtPluginsDir\$pluginSubdirName\*.dll" | % { + deployBinary "$targetBinaryDir\$pluginSubdirName" "$QtPluginsDir\$pluginSubdirName" $_.Name + } + } else { + Write-Verbose " Skipping plugins directory '$pluginSubdirName': doesn't exist" + } + } + + # We detect Qt modules in use via the DLLs themselves. See qtModuleEntries in Qt to find the mapping. + if ($targetBinaryName -like "Qt5Gui*.dll") { + Write-Verbose " Deploying platforms" + New-Item "$targetBinaryDir\platforms" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null + Get-ChildItem "$QtPluginsDir\platforms\qwindows*.dll" | % { + deployBinary "$targetBinaryDir\platforms" "$QtPluginsDir\platforms" $_.Name + } + + deployPlugins "accessible" + deployPlugins "imageformats" + deployPlugins "iconengines" + deployPlugins "platforminputcontexts" + } elseif ($targetBinaryName -like "Qt5Network*.dll") { + deployPlugins "bearer" + } elseif ($targetBinaryName -like "Qt5Sql*.dll") { + deployPlugins "sqldrivers" + } elseif ($targetBinaryName -like "Qt5Multimedia*.dll") { + deployPlugins "audio" + deployPlugins "mediaservice" + deployPlugins "playlistformats" + } elseif ($targetBinaryName -like "Qt5PrintSupport*.dll") { + deployPlugins "printsupport" + } elseif ($targetBinaryName -like "Qt5Quick*.dll") { + deployPlugins "scenegraph" + deployPlugins "qmltooling" + } elseif ($targetBinaryName -like "Qt5Declarative*.dll") { + deployPlugins "qml1tooling" + } elseif ($targetBinaryName -like "Qt5Positioning*.dll") { + deployPlugins "position" + } elseif ($targetBinaryName -like "Qt5Location*.dll") { + deployPlugins "geoservices" + } elseif ($targetBinaryName -like "Qt5Sensors*.dll") { + deployPlugins "sensors" + deployPlugins "sensorgestures" + } elseif ($targetBinaryName -like "Qt5WebEngineCore*.dll") { + deployPlugins "qtwebengine" + } elseif ($targetBinaryName -like "Qt53DRenderer*.dll") { + deployPlugins "sceneparsers" + } elseif ($targetBinaryName -like "Qt5TextToSpeech*.dll") { + deployPlugins "texttospeech" + } elseif ($targetBinaryName -like "Qt5SerialBus*.dll") { + deployPlugins "canbus" + } +} |
