-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
doc: exactly how to build GD in local machine (#1675)
- vcpkg_250123_b588ddc8230705392c53448597f5892966a8db15
- v25.02.0-Release.e895b18c
- v24.11.0-alpha.60801620
- v24.11.0-alpha.44992766
- v24.11.0-alpha.979432e8
- v24.11.0-alpha.853700af
- v24.11.0-alpha.132552b0
- v24.11.0-alpha.71841de8
- v24.11.0-alpha.15207cf4
- v24.11.0-alpha.9851fffe
- v24.11.0-alpha.870ff080
- v24.11.0-alpha.0543cb2d
- v24.11.0-alpha.542ff722
- v24.11.0-alpha.429fc5c3
- v24.11.0-alpha.66ec0407
- v24.11.0-alpha.51cb0466
- v24.11.0-alpha.9b84bf40
- v24.11.0-alpha.7f62fc87
- v24.11.0-alpha.7a1df4b6
- v24.11.0-alpha.6a788ca9
- v24.11.0-alpha.4b3d090c
- v24.11.0-alpha.3c5b76f7
- v24.11.0-alpha.f8f62efa
- v24.11.0-alpha.f5ab68c8
- v24.11.0-alpha.c5e81df6
- v24.11.0-alpha.c5d682c9
- v24.11.0-alpha.c2f5c59b
- v24.11.0-alpha.c0c164c4
- v24.11.0-alpha.bed76f36
- v24.11.0-alpha.be14086c
- v24.11.0-alpha.bb87c55b
- v24.11.0-alpha.b19b3191
- v24.11.0-alpha.b9ab7dc0
- v24.11.0-alpha.b3fe3bbd
- v24.11.0-alpha.ad192634
- v24.11.0-alpha.a5337770
- v24.11.0-alpha.a16e560c
- v24.09.1-Release.ca9dd133
- v24.09.0-Release.316ec900
- v24.05.13-alpha.943973b2
- v24.05.13-alpha.652133a2
- v24.05.13-alpha.529871bd
- v24.05.13-alpha.9651e1bd
- v24.05.13-alpha.06735eee
- v24.05.13-alpha.02275b3f
- v24.05.13-alpha.644e6a2b
- v24.05.13-alpha.476c71d5
- v24.05.13-alpha.476aac75
- v24.05.13-alpha.318b8a15
- v24.05.13-alpha.181ba344
- v24.05.13-alpha.180f4c49
- v24.05.13-alpha.22b1c043
- v24.05.13-alpha.9eb206ca
- v24.05.13-alpha.8ee9a5a4
- v24.05.13-alpha.8cb9d116
- v24.05.13-alpha.6b045de2
- v24.05.13-alpha.5d934acc
- v24.05.13-alpha.4b7ae255
- v24.05.13-alpha.2f179276
- v24.05.13-alpha.2bdb452f
- v24.05.13-alpha.1ff838c8
- v24.05.13-alpha.1ad3e2dc
- v24.05.13-alpha.0fedfba9
- v24.05.13-alpha.0fa968d1
- v24.05.13-alpha.0e342a43
- v24.05.13-alpha.0be8814b
- v24.05.13-alpha.fe006d54
- v24.05.13-alpha.fc740bb9
- v24.05.13-alpha.ef6104c3
- v24.05.13-alpha.ec08622d
- v24.05.13-alpha.e9b9bfac
- v24.05.13-alpha.e09a898c
- v24.05.13-alpha.e8cb7090
- v24.05.13-alpha.dc464706
- v24.05.13-alpha.d969972a
- v24.05.13-alpha.d017f809
- v24.05.13-alpha.bb7d5172
- v24.05.13-alpha.b5297bd1
- v24.05.13-alpha.b34deadf
- v24.05.13-alpha.b8e5d721
- v24.05.13-alpha.af72c97c
- v24.05.13-alpha.a198010f
- v24.05.13-alpha.a64dadd1
- v24.05.13-alpha.a5ffbe3d
1 parent
3f6cfb8
commit b795818
Showing
4 changed files
with
97 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,104 @@ | ||
Developing GoldenDict is not hard. | ||
If you know some C++ and optionally some Qt, you can start to modify GoldenDict right now. | ||
|
||
If you know some C++ and optionally some Qt, you can start to modify GoldenDict right now: | ||
This page is a brief introduction on how to get started. | ||
|
||
## Install Qt and QtCreator | ||
(On Linux, install dependencies) | ||
For technical details see [how to build from source](howto/build_from_source.md). | ||
|
||
## 1. Install Qt | ||
|
||
To install Qt on macOS or Windows, uses the [Qt Online Installer](https://doc.qt.io/qt-6/get-and-install-qt.html). It can be downloaded from [Qt for Open Source](https://www.qt.io/download-open-source). | ||
|
||
Those Qt components are needed | ||
|
||
+ Qt | ||
+ 6.7.2 (Or another version) | ||
+ MSVC 2019 (or MSVC 2022) | ||
+ Qt5 Compatible Module | ||
+ Additional Libraries | ||
+ Qt Image formats | ||
+ Qt MultiMedia | ||
+ Qt Positioning | ||
+ Qt SerialPort (? super weird here, but it is needed.) | ||
+ Qt Speech | ||
+ Qt Webchannel | ||
+ Qt Webengine | ||
+ Qt Creator (optional) | ||
+ CMake | ||
+ Ninja | ||
|
||
Note that MinGW is not supported. | ||
|
||
CMake and Ninja are needed. | ||
|
||
## 2. Install a compiler | ||
|
||
For windows, MSVC can be obtained by [installing Visual Studio's "Desktop development with C++"](https://learn.microsoft.com/cpp/build/vscpp-step-0-installation). | ||
|
||
For macOS, install [XCode](https://developer.apple.com/xcode/). | ||
|
||
## 3. Obtain dependencies | ||
|
||
For Windows, prebuilt libraries will be automatically downloaded. | ||
|
||
For macOS, install [Homebrew](https://brew.sh/) and install related packages as described in [how to build from source](howto/build_from_source.md) or search `brew install` command in [macOS release's build file](https://github.com/xiaoyifang/goldendict-ng/blob/staged/.github/workflows/release-macos-homebrew.yml). | ||
|
||
## 4. Build | ||
|
||
First, get GoldenDict's source code by [Cloning a repository](https://docs.github.com/repositories/creating-and-managing-repositories/cloning-a-repository). | ||
|
||
Then choose your favorite IDE/editor and load the `CMakeLists.txt`. If unsure, just use Qt Creator. | ||
|
||
### Qt Creator | ||
|
||
Open `CMakeLists.txt` from Qt Creator, then you wil choose a "Kit" which is pretty much a Qt installation. | ||
|
||
Qt Creator usually can auto detect your Qt installation. In case it doesn't, check out "Kit" settings. Note that, the compiler must be set to MSVC on Windows. | ||
|
||
By default everything will be built, you can disable ffmpeg, epwing... | ||
|
||
![](https://github.com/xiaoyifang/goldendict-ng/assets/20123683/49f6a85e-50ec-4467-b0e4-cf088d218053) | ||
|
||
Then, hit the "Run" button at bottom-right corner should build and run GoldenDict. | ||
|
||
### Command Line only | ||
See [how to build from source](howto/build_from_source.md). | ||
|
||
[Qt's doc: Building projects on the command line](https://doc.qt.io/qt-6/cmake-build-on-cmdline.html) | ||
|
||
### Visual Studio | ||
VS2022 has CMake support. After opening the source code folder, VS will starts to configure CMake but likely won't succeed. | ||
|
||
You need to add Qt's path and other options to "CMake command arguments". Then, "save" the dialog with Ctrl+S or click one of the many "(re)configure cache" buttons. | ||
|
||
![](https://github.com/xiaoyifang/goldendict-ng/assets/20123683/33a52c52-2e8a-4b8c-bb05-4a753f95ff7e) | ||
|
||
Click run will build the project, but the `.exe` would not run, because the dependencies are not copied. | ||
|
||
Simply click "install", which is actually copying dependencies. | ||
|
||
![](https://github.com/xiaoyifang/goldendict-ng/assets/20123683/02e843b1-0842-445c-919c-75618346aaaf) | ||
|
||
### Visual Studio Code | ||
|
||
Install [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools). | ||
|
||
Then open GoldenDict's folder, and the CMake extension will kicks in. | ||
|
||
Then add Qt's path and various other options to configure arguments. | ||
|
||
Windows(qtcreator for example) | ||
### Prerequisite | ||
Install visual studio community ,choose C++ component. | ||
|
||
QtCreator Packages: | ||
``` | ||
[x]qtX.X.X version | ||
[x]MSVC2019 /GCC | ||
[x]Qt5 Compatible Module | ||
[*]Additional | ||
[x]Qt Image formats | ||
[x]Qt MultiMedia | ||
[x]Qt Positioning | ||
[x]Qt speech | ||
[x]Qt webchannel | ||
[x]Qt webengine | ||
-DCMAKE_PREFIX_PATH={Your Qt install path}\6.7.2\msvc2019_64 | ||
``` | ||
|
||
## Coding Standards | ||
![](https://github.com/xiaoyifang/goldendict-ng/assets/20123683/bd87155e-2e61-41d5-81e2-7bfb1f13c4c4) | ||
|
||
Please follow [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) and write modern C++ code. | ||
### CLion | ||
### XCode | ||
### CMake GUI | ||
### LSP + Editor? | ||
|
||
Commit messages should follow [Conventional Commits](https://www.conventionalcommits.org) | ||
## Related Things | ||
|
||
Reformat changes with `clang-format` [how to use clang-format](https://github.com/xiaoyifang/goldendict/blob/staged/howto/how%20to%20use%20.clang-format%20to%20format%20the%20code.md) | ||
Please follow [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) and write modern C++ code. | ||
|
||
Remember to enable `clang-tidy` support on your editor so that `.clang-tidy` will be respected. | ||
[Qt's documentation](https://doc.qt.io/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters