The built artifacts will end up in `build_dir/goldendict`
To run the built `goldendict.exe` directly, you have to add `F:\Qt\6.5.2\msvc2019_64\bin` to your PATH environment variable
To have a redistributable goldendict (runable on someone else's computer by just copying the folder), you can build the deployment target which will copy necessary files to the folder
```
cmake --build . --target windeploy
```
The `build_dir/goldendict` will be ready to share with others.
**Note**: Some linux distros do not support latest zim version, so you need to compile from latest source.
On Windows, you can use vcpkg to compile the libzim
```
vcpkg install libzim:x64-windows
```
and copy the corresponding(debug/release) library to the `winlibs/lib` folder. the zim's `include` directory to the `winlibs/include` directory.
#### Building without Epwing format support
If you have problem building with libeb-dev package, you can pass
`"CONFIG+=no_epwing_support"` to `qmake` in order to disable Epwing format support
#### Building without internal audio players
If you have problem building with FFmpeg (for example, very old linux distro), you can pass
`"CONFIG+=no_ffmpeg_player"` to `qmake` in order to disable FFmpeg internal audio player back end.
If you have problem building with Qt5 Multimedia or experience GStreamer run-time errors (for example, Ubuntu 14.04), you can pass
`"CONFIG+=no_qtmultimedia_player"` to `qmake` in order to disable Qt Multimedia internal audio player back end.
#### Building with xapian
build xapian from source, download and extract the xapian-core source code.
```
./configure
make
make install
```
On Windows, `vcpkg install xapian:x64-windows` and copy the libs/dlls into the `winlibs`
A precompiled version of xapian lib has provided in winlibs.
On Linux, install libxapian-dev package using package manager.
On Mac, use homebrew to install xapian `brew install xapian`
Goldendict-ng has used xapian as the default and the only one fulltext engine.
#### use iconv (recommend to enable)
use `CONFIG+=use_iconv` to enable this feature. when enabled ,iconv will be used to convert encoding other than the QTextCodec(which will be deprecated in future Qt version)
```
qmake "CONFIG+=use_iconv"
```
when enabled ,iconv should be installed on the platform at the same time.
#### use breakpad
use `CONFIG+=use_breakpad` to enable this crash dump. when enabled [breakpad](https://chromium.googlesource.com/breakpad/breakpad/+/master/docs), goldendict will generate a crash dump alongside with Goldendict in the `crash` directory.
on Windows:
`vcpkg install breakpad:x64-windows-release` and copy the installed packages into `thirdparty/breakpad` directory.
with a structure like this:
```
├─breakpad
│ ├─include
│ │ ├─client
│ │ │ └─windows
│ │ │ ├─common
│ │ │ ├─crash_generation
│ │ │ ├─handler
│ │ │ └─sender
│ │ ├─common
│ │ │ └─windows
│ │ └─google_breakpad
│ │ ├─common
│ │ └─processor
│ └─lib
```
on Mac/Linux:
[vcpkg](https://techviewleo.com/install-vcpkg-c-library-manager-on-linux-macos-windows/) can also be used or you can just install breakpad from source or use precompiled packages.
Then enable google breakpad like this with qmake:
```
qmake "CONFIG+=use_breakpad"
```
### Build with VS2019
Install `QT tool for VS` from VS extension
#### steps:
- configure qt path
toolbar Extensions=>Qt VS Tools=>Options=>versions.
add qt installation folder
- Open pro project file directly throughttoolbar Extensions=>Qt VS Tools=>Open Qt Project file(.pro)