Or you can also manually run `windeployqt.exe {your_build_dir}/goldendict.exe` which will copy the qt related things to `build_dir`.
#### Using Vcpkg
The dependencies can be built via Vcpkg instead of using the pre-built ones.
Vcpkg CMake build utilize the "manifest mode", all you need to do is basically
set `CMAKE_TOOLCHAIN_FILE` as described [here](https://learn.microsoft.com/en-us/vcpkg/consume/manifest-mode?tabs=cmake%2Cbuild-MSBuild#2---integrate-vcpkg-with-your-build-system).
To make the `.app` runnable elsewhere, you can run `cmake --install build_dir/` which will invoke macdeployqt, ad-hoc code signing and various other things. The produced app will end up in `build_dir/redist/goldendict-ng.app`
To create `.dmg` installer, you have to have [create-dmg](https://github.com/create-dmg/create-dmg) installed on your machine, then also `cmake --install build_dir/`.
**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.
After successful build, run windeployqt.exe(bundled with Qt installation) in the target folder (where GoldenDict.exe is located), which will copy all necessary files to this folder.