Skip to content

Commit

Permalink
[qt5-base] Update qtdeploy.ps1 to generate qt.conf, qml, and qtquick. F…
Browse files Browse the repository at this point in the history
…ixes #2857.
  • Loading branch information
ras0219-msft committed Oct 23, 2018
1 parent 8d62a87 commit a1fe954
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ports/qt5-base/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-base
Version: 5.11.1-2
Version: 5.11.1-5
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl
2 changes: 1 addition & 1 deletion ports/qt5-base/qt_debug.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Libraries = debug/lib
Binaries = debug/tools/qt5
LibraryExecutables = debug/tools/qt5
Plugins = debug/plugins
Qml2Imports = qml
Qml2Imports = debug/qml
Data = share/qt5/debug
ArchData = share/qt5/debug
HostData = share/qt5/debug
Expand Down
45 changes: 33 additions & 12 deletions ports/qt5-base/qtdeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,72 @@

# Note: this function signature and behavior is depended upon by applocal.ps1
function deployPluginsIfQt([string]$targetBinaryDir, [string]$QtPluginsDir, [string]$targetBinaryName) {

$baseDir = Split-Path $QtPluginsDir -parent
$binDir = "$baseDir\bin"

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
New-Item "$targetBinaryDir\plugins\$pluginSubdirName" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
Get-ChildItem "$QtPluginsDir\$pluginSubdirName\*.dll" | % {
deployBinary "$targetBinaryDir\$pluginSubdirName" "$QtPluginsDir\$pluginSubdirName" $_.Name
resolve $_
deployBinary "$targetBinaryDir\plugins\$pluginSubdirName" "$QtPluginsDir\$pluginSubdirName" $_.Name
resolve "$targetBinaryDir\plugins\$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") {
if ($targetBinaryName -match "Qt5Cored?.dll") {
if (!(Test-Path "$targetBinaryDir\qt.conf")) {
"[Paths]" | Out-File -encoding ascii "$targetBinaryDir\qt.conf"
}
} elseif ($targetBinaryName -match "Qt5Guid?.dll") {
Write-Verbose " Deploying platforms"
New-Item "$targetBinaryDir\platforms" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
New-Item "$targetBinaryDir\plugins\platforms" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
Get-ChildItem "$QtPluginsDir\platforms\qwindows*.dll" | % {
deployBinary "$targetBinaryDir\platforms" "$QtPluginsDir\platforms" $_.Name
deployBinary "$targetBinaryDir\plugins\platforms" "$QtPluginsDir\platforms" $_.Name
}

deployPlugins "accessible"
deployPlugins "imageformats"
deployPlugins "iconengines"
deployPlugins "platforminputcontexts"
} elseif ($targetBinaryName -like "Qt5Network*.dll") {
} elseif ($targetBinaryName -match "Qt5Networkd?.dll") {
deployPlugins "bearer"
if (Test-Path "$binDir\libeay32.dll")
{
deployBinary "$targetBinaryDir" "$binDir" "libeay32.dll"
deployBinary "$targetBinaryDir" "$binDir" "ssleay32.dll"
}
} elseif ($targetBinaryName -like "Qt5Sql*.dll") {
} elseif ($targetBinaryName -match "Qt5Sqld?.dll") {
deployPlugins "sqldrivers"
} elseif ($targetBinaryName -like "Qt5Multimedia*.dll") {
} elseif ($targetBinaryName -match "Qt5Multimediad?.dll") {
deployPlugins "audio"
deployPlugins "mediaservice"
deployPlugins "playlistformats"
} elseif ($targetBinaryName -like "Qt5PrintSupport*.dll") {
} elseif ($targetBinaryName -match "Qt5PrintSupportd?.dll") {
deployPlugins "printsupport"
} elseif ($targetBinaryName -like "Qt5Quick*.dll") {
} elseif ($targetBinaryName -match "Qt5Qmld?.dll") {
if(!(Test-Path "$targetBinaryDir\qml"))
{
if (Test-Path "$binDir\..\qml") {
cp -r "$binDir\..\qml" $targetBinaryDir
} elseif (Test-Path "$binDir\..\..\qml") {
cp -r "$binDir\..\..\qml" $targetBinaryDir
} else {
throw "FAILED"
}
}
} elseif ($targetBinaryName -match "Qt5Quickd?.dll") {
foreach ($a in @("Qt5QuickControls2", "Qt5QuickControls2d", "Qt5QuickTemplates2", "Qt5QuickTemplates2d"))
{
if (Test-Path "$binDir\$a.dll")
{
deployBinary "$targetBinaryDir" "$binDir" "$a.dll"
}
}
deployPlugins "scenegraph"
deployPlugins "qmltooling"
} elseif ($targetBinaryName -like "Qt5Declarative*.dll") {
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildsystems/msbuild/applocal.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function resolve([string]$targetBinary) {
$g_searched.Set_Item($_, $true)
if (Test-Path "$installedDir\$_") {
deployBinary $baseTargetBinaryDir $installedDir "$_"
if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" }
if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $baseTargetBinaryDir "$g_install_root\plugins" "$_" }
if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" }
if (Test-Path function:\deployPluginsIfMagnum) {
if ($g_is_debug) {
Expand Down

0 comments on commit a1fe954

Please sign in to comment.