Skip to content

Commit 0be234c

Browse files
committed
Windows build scripts
Signed-off-by: Maxime Gervais <gervais.maxime@gmail.com>
1 parent 0fb73fa commit 0be234c

16 files changed

Lines changed: 500 additions & 415 deletions

Project/Qt/MediaConch.pro

Lines changed: 56 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,9 @@
44
#
55
#-------------------------------------------------
66

7-
contains(QT_CONFIG, no-gui) {
8-
error("qt module gui not found")
9-
}
10-
11-
QT += core gui
12-
13-
greaterThan(QT_MAJOR_VERSION, 4) {
14-
!qtHaveModule(widgets) {
15-
error("qt module widgets not found")
16-
}
17-
QT += widgets
18-
}
7+
QT += core gui widgets
198

20-
WEB_MACHINE=
9+
WEB_MACHINE=webengine
2110

2211
contains(USE_WEBKIT, yes|1) {
2312
WEB_MACHINE = webkit
@@ -26,27 +15,15 @@ contains(USE_WEBENGINE, yes|1) {
2615
WEB_MACHINE = webengine
2716
}
2817

29-
isEmpty(WEB_MACHINE) {
30-
WEB_MACHINE = webengine
31-
lessThan(QT_MAJOR_VERSION, 5) {
32-
WEB_MACHINE = webkit
33-
}
34-
equals(QT_MAJOR_VERSION, 5) {
35-
lessThan(QT_MINOR_VERSION, 6) {
36-
WEB_MACHINE = webkit
37-
}
38-
}
39-
}
40-
4118
!defined(packagesExist, test) {
4219
defineTest(packagesExist) {
4320
system(pkg-config $$ARGS): return(true)
4421
return(false)
4522
}
4623
}
4724

48-
!macx:TARGET = mediaconch-gui
49-
macx:TARGET = MediaConch
25+
unix:!macx:TARGET = mediaconch-gui
26+
else:TARGET = MediaConch
5027
TEMPLATE = app
5128

5229
CONFIG += qt release c++11
@@ -226,18 +203,6 @@ equals(WEB_MACHINE, webengine) {
226203
../../Source/GUI/Qt/WebEngineView.h
227204
DEFINES += WEB_MACHINE_ENGINE
228205
} else {
229-
greaterThan(QT_MAJOR_VERSION, 4) {
230-
!qtHaveModule(webkit) {
231-
error("qt module webkit not found")
232-
}
233-
} else {
234-
# Ubuntu build QtWebKit from separate sources therefore QT_CONFIG contains
235-
# neither webkit nor no-webkit, so we also check for pkg-config module
236-
!contains(QT_CONFIG, webkit):!packagesExist(QtWebKit) {
237-
error("qt module webkit not found")
238-
}
239-
}
240-
241206
QT += webkit webkitwidgets
242207
SOURCES += ../../Source/GUI/Qt/WebKitPage.cpp \
243208
../../Source/GUI/Qt/WebKitView.cpp
@@ -248,6 +213,13 @@ equals(WEB_MACHINE, webengine) {
248213

249214
INCLUDEPATH += ../../Source
250215

216+
win32 {
217+
INCLUDEPATH += ../../../zlib
218+
contains(QT_ARCH, i386): LIBS += $${_PRO_FILE_PWD_}/../../../zlib/contrib/vstudio/vc17/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib
219+
contains(QT_ARCH, x86_64): LIBS += $${_PRO_FILE_PWD_}/../../../zlib/contrib/vstudio/vc17/x64/ZlibStatReleaseWithoutAsm/zlibstat.lib
220+
}
221+
222+
251223
unix:exists(../../../MediaInfoLib/Project/GNU/Library/libmediainfo-config) {
252224
INCLUDEPATH += ../../../MediaInfoLib/Source
253225
contains(STATIC_LIBS, yes|1) {
@@ -262,10 +234,14 @@ unix:exists(../../../MediaInfoLib/Project/GNU/Library/libmediainfo-config) {
262234
error("libmediainfo not found on system")
263235
}
264236
LIBS += $$system(pkg-config --libs libmediainfo)
237+
}else:win32 {
238+
INCLUDEPATH += ../../../MediaInfoLib/Source
239+
contains(QT_ARCH, i386): LIBS += $${_PRO_FILE_PWD_}/../../../MediaInfoLib/Project/MSVC2022/Win32/Release/MediaInfo-Static.lib
240+
contains(QT_ARCH, x86_64): LIBS += $${_PRO_FILE_PWD_}/../../../MediaInfoLib/Project/MSVC2022/x64/Release/MediaInfo-Static.lib
265241
}
266242

267243
unix:exists(../../../ZenLib/Project/GNU/Library/libzen-config) {
268-
INCLUDEPATH += ../../../ZenLib/Source
244+
INCLUDEPATH += ../../../ZenLib/Source
269245
contains(STATIC_LIBS, yes|1) {
270246
LIBS += $$system(../../../ZenLib/Project/GNU/Library/libzen-config LIBS_Static)
271247
message("custom libzen : yes (static)")
@@ -276,6 +252,10 @@ unix:exists(../../../ZenLib/Project/GNU/Library/libzen-config) {
276252
} else:unix {
277253
PKGCONFIG += libzen
278254
message("libzen : system")
255+
} else:win32 {
256+
INCLUDEPATH += ../../../ZenLib/Source
257+
contains(QT_ARCH, i386): LIBS += $${_PRO_FILE_PWD_}/../../../MediaInfoLib/Project/MSVC2022/Win32/Release/ZenLib.lib
258+
contains(QT_ARCH, x86_64): LIBS += $${_PRO_FILE_PWD_}/../../../MediaInfoLib/Project/MSVC2022/x64/Release/ZenLib.lib
279259
}
280260

281261
unix:exists(../../../libxml2/.libs/libxml2.a) {
@@ -289,6 +269,11 @@ unix:exists(../../../libxml2/.libs/libxml2.a) {
289269
PKGCONFIG += libxml-2.0
290270
}
291271
message("libxml2 : system")
272+
} else:win32 {
273+
DEFINES += LIBXML_STATIC
274+
INCLUDEPATH += ../../../libxml2/include
275+
contains(QT_ARCH, i386):LIBS += $${_PRO_FILE_PWD_}/../../../libxml2/win32/VC17/Win32/Release/libxml2.lib
276+
contains(QT_ARCH, x86_64):LIBS += $${_PRO_FILE_PWD_}/../../../libxml2/win32/VC17/x64/Release/libxml2.lib
292277
}
293278

294279
unix:exists(../../../libxslt/libxslt/.libs/libxslt.a) {
@@ -299,6 +284,13 @@ unix:exists(../../../libxslt/libxslt/.libs/libxslt.a) {
299284
} else:unix {
300285
PKGCONFIG += libxslt libexslt
301286
message("libxslt : system")
287+
} else:win32 {
288+
DEFINES += LIBXSLT_STATIC LIBEXSLT_STATIC
289+
INCLUDEPATH += ../../../libxslt
290+
contains(QT_ARCH, i386):LIBS += $${_PRO_FILE_PWD_}/../../../libxslt/win32/VC17/libxslt/Win32/Release/libxslt.lib
291+
contains(QT_ARCH, x86_64):LIBS += $${_PRO_FILE_PWD_}/../../../libxslt/win32/VC17/libxslt/x64/Release/libxslt.lib
292+
contains(QT_ARCH, i386):LIBS += $${_PRO_FILE_PWD_}/../../../libxslt/win32/VC17/libexslt/Win32/Release/libexslt.lib
293+
contains(QT_ARCH, x86_64):LIBS += $${_PRO_FILE_PWD_}/../../../libxslt/win32/VC17/libexslt/x64/Release/libexslt.lib
302294
}
303295

304296

@@ -313,6 +305,11 @@ contains(NO_SQLITE, yes|1) {
313305
} else:unix {
314306
PKGCONFIG += sqlite3
315307
message("libsqlite3 : system")
308+
} else:win32 {
309+
DEFINES += HAVE_SQLITE
310+
INCLUDEPATH += ../../Source/ThirdParty/sqlite
311+
SOURCES += ../../Source/ThirdParty/sqlite/sqlite3.c
312+
HEADERS += ../../Source/ThirdParty/sqlite/sqlite3.h
316313
}
317314
}
318315

@@ -327,6 +324,11 @@ contains(NO_JANSSON, yes|1) {
327324
} else:unix {
328325
PKGCONFIG += jansson
329326
message("libjansson : system")
327+
} else:win32 {
328+
DEFINES += HAVE_JANSSON
329+
INCLUDEPATH += ../../../jansson/Contrib/VC17/Jansson ../../../jansson/src
330+
contains(QT_ARCH, i386):LIBS += $${_PRO_FILE_PWD_}/../../../jansson/Contrib/VC17/Jansson/Win32/Release/Jansson.lib
331+
contains(QT_ARCH, x86_64):LIBS += $${_PRO_FILE_PWD_}/../../../jansson/Contrib/VC17/Jansson/x64/Release/Jansson.lib
330332
}
331333
}
332334

@@ -341,6 +343,11 @@ contains(NO_LIBEVENT, yes|1) {
341343
} else:unix {
342344
PKGCONFIG += libevent
343345
message("libevent : system")
346+
} else:win32 {
347+
DEFINES += HAVE_LIBEVENT
348+
INCLUDEPATH += ../../../libevent/WIN32-Code/nmake ../../../libevent/include
349+
contains(QT_ARCH, i386):LIBS += $${_PRO_FILE_PWD_}/../../../libevent/Contrib/VC17/event/Win32/Release/event.lib
350+
contains(QT_ARCH, x86_64):LIBS += $${_PRO_FILE_PWD_}/../../../libevent/Contrib/VC17/event/x64/Release/event.lib
344351
}
345352
}
346353

@@ -356,8 +363,15 @@ macx:contains(MACSTORE, yes|1) {
356363
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
357364
}
358365

359-
LIBS += -lz
360-
!macx:LIBS += -ldl -lrt
366+
win32 {
367+
RC_FILE = MediaConch.rc
368+
LIBS += winmm.lib ws2_32.lib imm32.lib ole32.lib
369+
contains(QT_ARCH, i386): DESTDIR = Win32
370+
contains(QT_ARCH, x86_64): DESTDIR = x64
371+
}
372+
373+
unix:LIBS += -lz
374+
unix:!macx:LIBS += -ldl -lrt
361375

362376
RESOURCES += ../../Source/Resource/Resources.qrc
363377

Project/Qt/MediaConch.rc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include <winresrc.h>
2+
3+
VS_VERSION_INFO VERSIONINFO
4+
FILEVERSION 25,04,20260214,0
5+
PRODUCTVERSION 25,04,20260214,0
6+
FILEFLAGSMASK 0x3fL
7+
#ifdef _DEBUG
8+
FILEFLAGS 0x1L
9+
#else
10+
FILEFLAGS 0x0L
11+
#endif
12+
FILEOS 0x40004L
13+
FILETYPE 0x1L
14+
FILESUBTYPE 0x0L
15+
BEGIN
16+
BLOCK "StringFileInfo"
17+
BEGIN
18+
BLOCK "040904B0" // U.S. English (0x0409, 1033), Unicode (0x04B0, 1200)
19+
BEGIN
20+
VALUE "CompanyName", "MediaArea.net"
21+
VALUE "FileDescription", "Implementation checker, policy checker, reporter, and fixer"
22+
VALUE "FileVersion", "25.04.20260214.0"
23+
VALUE "LegalCopyright", "Copyright (C) 2002-2015 MediaArea.net SARL"
24+
VALUE "ProductName", "MediaConch"
25+
VALUE "ProductVersion", "25.04.20260214.0"
26+
END
27+
END
28+
BLOCK "VarFileInfo"
29+
BEGIN
30+
VALUE "Translation", 0x409, 1200
31+
END
32+
END
33+
34+
//Icons
35+
aaaaaaaa ICON "../../Source/Resource/Image/MediaConch.ico"

Release/Build_CLI_Windows.ps1

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Copyright (c) MediaArea.net SARL. All Rights Reserved.
2+
##
3+
## Use of this source code is governed by a BSD-style license that can
4+
## be found in the License.html file in the root of the source tree.
5+
##
6+
7+
Param([parameter(Mandatory=$true)][String]$arch)
8+
9+
$ErrorActionPreference = "Stop"
10+
11+
#-----------------------------------------------------------------------
12+
# Setup
13+
$release_directory = Split-Path -Parent $MyInvocation.MyCommand.Path
14+
$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim()
15+
16+
#-----------------------------------------------------------------------
17+
# Prepare
18+
Push-Location -Path "${release_directory}\..\..\jansson\Contrib\VC17\Jansson"
19+
((Get-Content -Path Jansson.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Jansson.vcxproj
20+
Pop-Location
21+
22+
Push-Location -Path "${release_directory}\..\..\libevent\Contrib\VC17\event"
23+
((Get-Content -Path event.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path event.vcxproj
24+
Pop-Location
25+
26+
Push-Location -Path "${release_directory}\..\..\libxml2\win32\VC17"
27+
((Get-Content -Path libxml2.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path libxml2.vcxproj
28+
Pop-Location
29+
30+
Push-Location -Path "${release_directory}\..\..\libxslt\win32\VC17"
31+
((Get-Content -Path libxslt\libxslt.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path libxslt\libxslt.vcxproj
32+
((Get-Content -Path libexslt\libexslt.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path libexslt\libexslt.vcxproj
33+
Pop-Location
34+
35+
Push-Location -Path "${release_directory}\..\..\zlib\contrib\vstudio\vc17"
36+
((Get-Content -Path zlibstat.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path zlibstat.vcxproj
37+
Pop-Location
38+
39+
Push-Location -Path "${release_directory}\..\..\ZenLib\Project\MSVC2022\Library"
40+
((Get-Content -Path ZenLib.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path ZenLib.vcxproj
41+
Pop-Location
42+
43+
Push-Location -Path "${release_directory}\..\..\MediaInfoLib\Project\MSVC2022"
44+
((Get-Content -Path Library\MediaInfoLib.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Library\MediaInfoLib.vcxproj
45+
((Get-Content -Path Dll\MediaInfoDll.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Dll\MediaInfoDll.vcxproj
46+
((Get-Content -Path Example\HowToUse_Dll.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Example\HowToUse_Dll.vcxproj
47+
((Get-Content -Path ShellExtension\MediaInfoShellExt.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path ShellExtension\MediaInfoShellExt.vcxproj
48+
((Get-Content -Path FieldsDescription\FieldsDescription.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path FieldsDescription\FieldsDescription.vcxproj
49+
((Get-Content -Path RegressionTest\RegressionTest.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path RegressionTest\RegressionTest.vcxproj
50+
((Get-Content -Path PreRelease\PreRelease.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path PreRelease\PreRelease.vcxproj
51+
Pop-Location
52+
53+
Push-Location -Path "${release_directory}\..\Project\MSVC2022"
54+
((Get-Content -Path CLI\MediaConch.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path CLI\MediaConch.vcxproj
55+
Pop-Location
56+
57+
#-----------------------------------------------------------------------
58+
# Build
59+
Push-Location -Path "${release_directory}\..\Project\MSVC2022"
60+
MSBuild "/p:Configuration=Release;Platform=${arch}" "/t:MediaConch-CLI" MediaConch.sln
61+
Pop-Location

Release/Build_GUI_Windows.ps1

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Copyright (c) MediaArea.net SARL. All Rights Reserved.
2+
##
3+
## Use of this source code is governed by a BSD-style license that can
4+
## be found in the License.html file in the root of the source tree.
5+
##
6+
7+
Param([parameter(Mandatory=$true)][String]$arch)
8+
9+
$ErrorActionPreference = "Stop"
10+
11+
#-----------------------------------------------------------------------
12+
# Setup
13+
$release_directory = $PSScriptRoot
14+
$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim()
15+
16+
#-----------------------------------------------------------------------
17+
# Build
18+
Push-Location -Path "${release_directory}\..\..\libevent\Contrib\VC17\event"
19+
MSBuild "/p:Configuration=Release;Platform=${arch}" event.vcxproj
20+
Pop-Location
21+
22+
Push-Location -Path "${release_directory}\..\..\jansson\Contrib\VC17\Jansson"
23+
MSBuild "/p:Configuration=Release;Platform=${arch}" Jansson.vcxproj
24+
Pop-Location
25+
26+
Push-Location -Path "${release_directory}\..\..\libxml2\win32\VC17"
27+
MSBuild "/p:Configuration=Release;Platform=${arch}" libxml2.vcxproj
28+
Pop-Location
29+
30+
Push-Location -Path "${release_directory}\..\..\libxslt\win32\VC17"
31+
MSBuild "/p:Configuration=Release;Platform=${arch}" libxslt/libxslt.vcxproj
32+
MSBuild "/p:Configuration=Release;Platform=${arch}" libexslt/libexslt.vcxproj
33+
Pop-Location
34+
35+
Push-Location -Path "${release_directory}\..\..\MediaInfoLib\Project\MSVC2022"
36+
MSBuild "/p:Configuration=Release;Platform=${arch}" MediaInfoLib.sln
37+
Pop-Location
38+
39+
Push-Location -Path "${release_directory}\..\Project\Qt"
40+
New-Item -Force -ItemType Directory "${arch}"
41+
Push-Location -Path "${arch}"
42+
qmake ..
43+
nmake
44+
windeployqt MediaConch.exe
45+
Pop-Location
46+
Pop-Location

Release/Build_Server_Windows.ps1

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Copyright (c) MediaArea.net SARL. All Rights Reserved.
2+
##
3+
## Use of this source code is governed by a BSD-style license that can
4+
## be found in the License.html file in the root of the source tree.
5+
##
6+
7+
Param([parameter(Mandatory=$true)][String]$arch)
8+
9+
$ErrorActionPreference = "Stop"
10+
11+
#-----------------------------------------------------------------------
12+
# Setup
13+
$release_directory = Split-Path -Parent $MyInvocation.MyCommand.Path
14+
$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim()
15+
16+
#-----------------------------------------------------------------------
17+
# Prepare
18+
Push-Location -Path "${release_directory}\..\..\jansson\Contrib\VC17\Jansson"
19+
((Get-Content -Path Jansson.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Jansson.vcxproj
20+
Pop-Location
21+
22+
Push-Location -Path "${release_directory}\..\..\libevent\Contrib\VC17\event"
23+
((Get-Content -Path event.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path event.vcxproj
24+
Pop-Location
25+
26+
Push-Location -Path "${release_directory}\..\..\libxml2\win32\VC17"
27+
((Get-Content -Path libxml2.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path libxml2.vcxproj
28+
Pop-Location
29+
30+
Push-Location -Path "${release_directory}\..\..\libxslt\win32\VC17"
31+
((Get-Content -Path libxslt\libxslt.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path libxslt\libxslt.vcxproj
32+
((Get-Content -Path libexslt\libexslt.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path libexslt\libexslt.vcxproj
33+
Pop-Location
34+
35+
Push-Location -Path "${release_directory}\..\..\zlib\contrib\vstudio\vc17"
36+
((Get-Content -Path zlibstat.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path zlibstat.vcxproj
37+
Pop-Location
38+
39+
Push-Location -Path "${release_directory}\..\..\ZenLib\Project\MSVC2022\Library"
40+
((Get-Content -Path ZenLib.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path ZenLib.vcxproj
41+
Pop-Location
42+
43+
Push-Location -Path "${release_directory}\..\..\MediaInfoLib\Project\MSVC2022"
44+
((Get-Content -Path Library\MediaInfoLib.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Library\MediaInfoLib.vcxproj
45+
((Get-Content -Path Dll\MediaInfoDll.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Dll\MediaInfoDll.vcxproj
46+
((Get-Content -Path Example\HowToUse_Dll.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Example\HowToUse_Dll.vcxproj
47+
((Get-Content -Path ShellExtension\MediaInfoShellExt.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path ShellExtension\MediaInfoShellExt.vcxproj
48+
((Get-Content -Path FieldsDescription\FieldsDescription.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path FieldsDescription\FieldsDescription.vcxproj
49+
((Get-Content -Path RegressionTest\RegressionTest.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path RegressionTest\RegressionTest.vcxproj
50+
((Get-Content -Path PreRelease\PreRelease.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path PreRelease\PreRelease.vcxproj
51+
Pop-Location
52+
53+
Push-Location -Path "${release_directory}\..\Project\MSVC2022"
54+
((Get-Content -Path Server\MediaConch-Server.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Server\MediaConch-Server.vcxproj
55+
Pop-Location
56+
57+
#-----------------------------------------------------------------------
58+
# Build
59+
Push-Location -Path "${release_directory}\..\Project\MSVC2022"
60+
MSBuild "/p:Configuration=Release;Platform=${arch}" "/t:MediaConch-Server" MediaConch.sln
61+
Pop-Location

0 commit comments

Comments
 (0)