Skip to content
Snippets Groups Projects
Commit 470d3c98 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

misc: allow building using qmake generated Makefile on windows

Don't implicitly configure a vcxproj with qmake allowing building
and debugging from QtCreator as well as Visual Studio.

Change-Id: Ifbb181d6d910c1b5bd9167d015f4ed6860d6ccaf
Gitlab: #581
Gitlab: #7
parent 03d04a80
No related branches found
No related tags found
Loading
...@@ -3,31 +3,28 @@ param ( ...@@ -3,31 +3,28 @@ param (
[string]$mode, [string]$mode,
[string]$qtver, [string]$qtver,
[string]$daemonDir, [string]$daemonDir,
[string]$lrcDir [string]$lrcDir,
[string]$outDir
); );
write-host "Copying runtime files..." -ForegroundColor Green write-host "Copying deployment files..." -ForegroundColor Green
# default values # default values
$qtver = If ($qtver) {$qtver} Else {"5.15.0"} $qtver = If ($qtver) { $qtver } Else { "5.15.0" }
$mode = If ($mode) {$mode} Else {"Release"} $mode = If ($mode) { $mode } Else { "Release" }
$qtverSplit1, $qtverSplit2 ,$qtverSplit3 = $qtver.Split('.') $qtverSplit1, $qtverSplit2 , $qtverSplit3 = $qtver.Split('.')
$qtMsvcDir = If((([int]$qtverSplit1) -ge 6) -OR ( (([int]$qtverSplit1) -eq 5) -AND (([int]$qtverSplit2) -ge 15))) { $qtMsvcDir = "msvc2019_64"
"msvc2019_64"
} Else {
"msvc2017_64"
}
$QtDir = "C:\Qt\$qtver\$qtMsvcDir" $QtDir = "C:\Qt\$qtver\$qtMsvcDir"
$ClientDir = split-path -parent $MyInvocation.MyCommand.Definition $clientDir = split-path -parent $MyInvocation.MyCommand.Definition
$OutDir = $ClientDir + "\x64\" + $mode if (!$outDir) { $outDir = $clientDir + "\x64\" + $mode }
If(!(test-path $OutDir)) { New-Item -ItemType directory -Path $OutDir -Force } If (!(test-path $outDir)) { New-Item -ItemType directory -Path $outDir -Force }
if (!$daemonDir) { $daemonDir = $ClientDir + '\..\daemon' } if (!$daemonDir) { $daemonDir = $clientDir + '\..\daemon' }
if (!$lrcDir) { $lrcDir = $ClientDir + '\..\lrc' } if (!$lrcDir) { $lrcDir = $clientDir + '\..\lrc' }
write-host "********************************************************************************" -ForegroundColor Magenta write-host "********************************************************************************" -ForegroundColor Magenta
write-host "using daemonDir: " $daemonDir -ForegroundColor Magenta write-host "using daemonDir: " $daemonDir -ForegroundColor Magenta
...@@ -46,25 +43,25 @@ $FilesToCopy = @( ...@@ -46,25 +43,25 @@ $FilesToCopy = @(
"$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\avfilter-7.dll", "$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\avfilter-7.dll",
"$daemonDir\contrib\build\openssl\out32dll\libeay32.dll", "$daemonDir\contrib\build\openssl\out32dll\libeay32.dll",
"$daemonDir\contrib\build\openssl\out32dll\ssleay32.dll", "$daemonDir\contrib\build\openssl\out32dll\ssleay32.dll",
"$ClientDir\qt.conf", "$clientDir\qt.conf",
"$ClientDir\images\jami.ico", "$clientDir\images\jami.ico",
"$ClientDir\License.rtf" "$clientDir\License.rtf"
) )
foreach ($i in $FilesToCopy) { foreach ($i in $FilesToCopy) {
write-host "copying: " $i " => " $OutDir -ForegroundColor Cyan write-host "copying: " $i " => " $outDir -ForegroundColor Cyan
Copy-Item -Path $i -Recurse -Destination $OutDir -Force -Container Copy-Item -Path $i -Recurse -Destination $outDir -Force -Container
} }
############ ############
# qt # qt
############ ############
$windeployqt = "$QtDir\bin\windeployqt.exe --qmldir $ClientDir\src --release $OutDir\Jami.exe" $windeployqt = "$QtDir\bin\windeployqt.exe --qmldir $clientDir\src --release $outDir\Jami.exe"
iex $windeployqt Invoke-Expression $windeployqt
# ringtones # ringtones
$CopyDir = $OutDir + "\ringtones" $CopyDir = $outDir + "\ringtones"
If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force } If (!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
$RingtonePath = "$ClientDir\..\daemon\ringtones" $RingtonePath = "$clientDir\..\daemon\ringtones"
write-host "copying ringtones..." write-host "copying ringtones..."
Get-ChildItem -Path $RingtonePath -Include *.ul, *.ogg, *.wav, *.opus -Recurse | ForEach-Object { Get-ChildItem -Path $RingtonePath -Include *.ul, *.ogg, *.wav, *.opus -Recurse | ForEach-Object {
write-host "copying ringtone: " $_.FullName " => " $CopyDir -ForegroundColor Cyan write-host "copying ringtone: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
...@@ -79,8 +76,8 @@ $lrcTSPath = "$lrcDir\translations" ...@@ -79,8 +76,8 @@ $lrcTSPath = "$lrcDir\translations"
Get-ChildItem -Path $lrcTSPath -Include *.ts -Recurse | ForEach-Object { Get-ChildItem -Path $lrcTSPath -Include *.ts -Recurse | ForEach-Object {
& $lrelease $_.FullName & $lrelease $_.FullName
} }
$CopyDir = $OutDir + "\share\libringclient\translations" $CopyDir = $outDir + "\share\libringclient\translations"
If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force } If (!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
write-host "copying lrc translations..." write-host "copying lrc translations..."
Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object { Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object {
write-host "copying translation file: " $_.FullName " => " $CopyDir -ForegroundColor Cyan write-host "copying translation file: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
...@@ -88,12 +85,12 @@ Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object { ...@@ -88,12 +85,12 @@ Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object {
} }
# client translations # client translations
$clientTSPath = "$ClientDir\translations" $clientTSPath = "$clientDir\translations"
Get-ChildItem -Path $clientTSPath -Include *.ts -Recurse | ForEach-Object { Get-ChildItem -Path $clientTSPath -Include *.ts -Recurse | ForEach-Object {
& $lrelease $_.FullName & $lrelease $_.FullName
} }
$CopyDir = $OutDir + "\share\ring\translations" $CopyDir = $outDir + "\share\ring\translations"
If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force } If (!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
write-host "copying client translations..." write-host "copying client translations..."
Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object { Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object {
write-host "copying translation file: " $_.FullName " => " $CopyDir -ForegroundColor Cyan write-host "copying translation file: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
......
win32-msvc { win32-msvc {
TARGET = Jami TARGET = Jami
TEMPLATE = vcapp TEMPLATE = app
QT += core winextras qml quickcontrols2 quick xml multimedia network webengine svg sql QT += core winextras qml quickcontrols2 quick xml multimedia network webengine svg sql
...@@ -22,7 +22,7 @@ win32-msvc { ...@@ -22,7 +22,7 @@ win32-msvc {
# dependencies # dependencies
LRC= ../lrc LRC= ../lrc
DRING= ../daemon DRING= ../daemon
QRENCODE= qrencode-win32/qrencode-win32 QRENCODE= $$PWD/qrencode-win32/qrencode-win32
# client deps # client deps
INCLUDEPATH += $${QRENCODE} INCLUDEPATH += $${QRENCODE}
...@@ -75,6 +75,9 @@ win32-msvc { ...@@ -75,6 +75,9 @@ win32-msvc {
# exe icons # exe icons
Release: RC_FILE = ico.rc Release: RC_FILE = ico.rc
# run the deployment script(run windeployqt)
QMAKE_POST_LINK += $$quote(powershell -ExecutionPolicy Unrestricted -File $$PWD/copy-runtime-files.ps1 -outDir $${DESTDIR})
} }
unix { unix {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment