-
Notifications
You must be signed in to change notification settings - Fork 18
/
building-windows-msys2.txt
127 lines (90 loc) · 3.33 KB
/
building-windows-msys2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
Building dpScreenOCR on Windows with MSYS2.
Contents:
1 Setting up environment
1.1 MSYS2
1.2 Dependencies
1.3 Pandoc
2 Building
3 Packaging
3.1 CPack
3.2 Inno Setup
1 Setting up environment
========================
1.1 MSYS2
---------
Visit https://www.msys2.org for instructions on how to install and set
up MSYS2.
MSYS2 provides several shells. Pick a MinGW shell depending on whether
you want to build a 32-bit or 64-bit version of the program, e.g.
"MSYS2 MINGW32" or "MSYS2 MINGW64". You will never need the MSYS
shell ("MSYS2 MSYS").
1.2 Dependencies
----------------
You will need the following tools and libraries to build dpScreenOCR:
Required:
* C++ compiler with C++17 support
* CMake >= 3.16. A particular version of Qt may require a newer
version of CMake.
* Make
* Qt 5.3.2 - 6. DPSO_QT_VERSION CMake option.
* tesseract >= 4.1.0
* jansson >= 2.7
* gettext >= 0.21
* pkg-config (recent MSYS2 uses a compatible pkgconf tool)
* dos2unix
Optional:
* pandoc to generate HTML manual. DPSO_GEN_HTML_MANUAL CMake option.
To install all dependencies except Pandoc, run in a MinGW shell:
pacman -S --needed \
dos2unix \
make \
$MINGW_PACKAGE_PREFIX-cmake \
$MINGW_PACKAGE_PREFIX-gcc \
$MINGW_PACKAGE_PREFIX-gettext \
$MINGW_PACKAGE_PREFIX-jansson \
$MINGW_PACKAGE_PREFIX-pkgconf \
$MINGW_PACKAGE_PREFIX-qt5-base \
$MINGW_PACKAGE_PREFIX-qt5-translations \
$MINGW_PACKAGE_PREFIX-tesseract-data-eng \
$MINGW_PACKAGE_PREFIX-tesseract-ocr
Note that Tesseact data files don't depend on the architecture, so
there is no need to install "tesseract-data-eng" and other languages
for both i686 and x86_64; when building for x86_64, you can use data
from i686 and vice versa. Alternatively, you can download languages as
described in the user manual. Still, be aware that CMake will try to
copy the English language pack installed for the current architecture.
1.3 Pandoc
----------
MSYS2 does not provide Pandoc, so you have to download it from
https://pandoc.org and make it visible to CMake by extending PATH in a
MinGW shell:
export PATH="$PATH:path_to_pandoc_dir"
2 Building
==========
You can build dpScreenOCR with the following commands:
cd path_to_dpscreenocr_source
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make
You can configure the build with various CMake options; run
"cmake -LH .." to see them all. Options specific to dpScreenOCR have
the "DPSO_" prefix.
3 Packaging
===========
3.1 CPack
---------
To create packages, run "cpack -G <generators>", where <generators>
is a semicolon-separated list of generator names you can find in
"cpack --help".
The NSIS, NSIS64, and WIX generators are no longer supported. Use Inno
Setup instead.
3.2 Inno Setup
--------------
CMake will generate inno_setup.iss in the build directory to create an
installer with Inno Setup >= 6.3.
You will need some unofficial language files listed in
inno_setup_languages.isi. Download them from the Inno Setup website or
source code repository (Files/Languages/Unofficial/) to the
"Languages/Unofficial/" directory in the root of your Inno Setup
installation.