|
3 | 3 | - [Simplified Chinese](README.md)
|
4 | 4 | - [English](README.en.md)
|
5 | 5 |
|
6 |
| -Picture resources and so on come from the Internet. |
7 |
| -This code warehouse is for learning only, if it is used by others for commercial purposes, it has nothing to do with me! Please obey the license! |
| 6 | +Picture resources etc. come from the Internet. |
| 7 | +This code repository is for learning only. If it is used for commercial purposes by others, it has nothing to do with me! Please obey the license! |
8 | 8 |
|
9 | 9 | ## Qt-App
|
10 | 10 |
|
11 |
| -A desktop application framework developed based on plug-ins, which can be used to quickly develop desktop applications;[qt-creator/src/libs/extensionsystem at master · qt-creator/qt-creator (github.com)](https://github.com/qt-creator/qt-creator/tree/master/src/libs/extensionsystem); |
| 11 | +- A desktop application framework developed based on plug-ins, which can be used to quickly develop desktop applications;[qt-creator/src/libs/extensionsystem at master · qt-creator/qt-creator (github.com)](https://github.com/qt-creator/qt-creator/tree/master/src/libs/extensionsystem); |
| 12 | +- Cooperate[vcpkg](https://github.com/microsoft/vcpkg)to use; |
| 13 | +- Support both[cmake](.github/workflows/cmake.yml)and[qmake](.github/workflows/qmake.yml)compile; |
| 14 | +- [Support Apple Silicon native compilation;](#问题和备注) |
| 15 | +- support[actions](.github/workflows/cmake.yml)Compile, package and publish; |
12 | 16 |
|
13 | 17 | <div align="center"><img src="doc/Qt-App.jpg" width="90%" height="90%" /></div>
|
14 | 18 |
|
15 | 19 | ## CrashReport
|
16 | 20 |
|
17 |
| -Crash Reporter; |
| 21 | +crash reporting program; |
18 | 22 |
|
19 | 23 | <div align="center"><img src="doc/CrashReport.jpg" width="50%" height="50%" /></div>
|
20 | 24 |
|
21 |
| -## code structure |
| 25 | +## Code structure |
22 | 26 |
|
23 |
| -1. [3rdparty](3rdparty): third-party library; |
24 |
| - 1. [qtlockedfile](3rdparty/qtlockedfile): Qt file lock; |
| 27 | +1. [3rdparty](3rdparty): Third-party library; |
| 28 | + 1. [qtlockedfile](3rdparty/qtlockedfile):Qt file lock; |
25 | 29 | 2. [qtsingleapplication](3rdparty/qtsingleapplication): Qt single instance;
|
26 | 30 | 3. [breakpad](3rdparty/breakpad.hpp): Crash capture based on Google Breakpad package;
|
27 | 31 | 2. [aggregate](aggregate):polymerization;
|
28 |
| -3. [apps](apps):application; |
| 32 | +3. [apps](apps):app; |
29 | 33 | 1. [app](apps/app):Qt-App;
|
30 | 34 | 2. [crashreport](apps/crashreport):CrashReport;
|
31 | 35 | 4. [cmake](cmake): Encapsulated CMake utility function;
|
32 |
| - 1. [utils](cmake/utils.cmake): utility function; |
33 |
| -5. [core](core): All plugins inherit from this; |
| 36 | + 1. [utils](cmake/utils.cmake): Utility function; |
| 37 | +5. [core](core): Plug-ins are inherited here; |
34 | 38 | 6. [extensionsystem](extensionsystem): Plug-in system, the code comes from Qt-Creator, with some modifications;
|
35 |
| -7. [gui](gui): encapsulated interface components; |
36 |
| -8. [plugins](plugins): plugin; |
37 |
| - 1. [coreplugin](plugins/coreplugin): Core plugin, main interface, menu, toolbar, status bar, settings, plugin manager, etc.; |
38 |
| - 2. [hashplugin](plugins/hashplugin): Hash plugin, hash algorithm provided by QT; |
39 |
| - 3. [serialplugin](plugins/serialplugin): serial port plug-in; |
40 |
| - 4. [tcpplugin](plugins/tcpplugin): TCP plugin; |
41 |
| -9. [resource](resource): pictures and QSS files; |
42 |
| -10. [utils](utils): utility function package; |
43 |
| - |
44 |
| -## Questions and Notes |
45 |
| - |
46 |
| -1. MacOS, the bundle generated by cmake is not generated under the .app/Contents/ folder`PkgInfo`document; |
47 |
| - 1. [app/CMakeLists](/apps/app/CMakeLists.txt), using this CMakeLists.txt can generate bundles on MacOS, and can also display icons normally, but there is no PkgInfo file; |
48 |
| - 2. How should cmake generate PkgInfo files? |
49 |
| - 1. WireShark uses`set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/PkgInfo PROPERTIES MACOSX_PACKAGE_LOCATION .)`In a similar way, copy it to the bundle; |
50 |
| - 3. qmake will generate PkgInfo file by default, only need to specify`TARGET=app`or`CONFIG+=bundle`can; |
51 |
| -2. Under the Unix system, it is necessary to use the static library as much as possible to avoid the dependency problem of the dynamic library; |
52 |
| - 1. Several modules in this project are dynamic libraries, because they are plugins, they need to be loaded dynamically; |
53 |
| - 2. Then you need to package these dynamic libraries, and then load them at runtime, and you also need to rpath`"-Wl,-rpath,\'\$$ORIGIN\':\'\$$ORIGIN/lib\':'\$$ORIGIN/../lib'")`, make settings, otherwise the dynamic library will not be found; |
| 39 | +7. [gui](gui): Encapsulated interface component; |
| 40 | +8. [plugins](plugins):Plug-in; |
| 41 | + 1. [coreplugin](plugins/coreplugin): Core plug-in, main interface, menu, toolbar, status bar, settings, plug-in manager, etc.; |
| 42 | + 2. [hashplugin](plugins/hashplugin): Hash plug-in, the hash algorithm provided by QT; |
| 43 | + 3. [serialplugin](plugins/serialplugin): Serial plug-in; |
| 44 | + 4. [tcpplugin](plugins/tcpplugin): TCP plug-in; |
| 45 | +9. [resource](resource): Pictures and QSS files; |
| 46 | +10. [utils](utils): Tool function encapsulation; |
| 47 | + |
| 48 | +## Questions and comments |
| 49 | + |
| 50 | +- MacOS, the bundle generated by cmake is not generated in the .app/Contents/ folder`PkgInfo`document; |
| 51 | + 1. [app/CMakeLists](/apps/app/CMakeLists.txt), use this CMakeLists.txt to generate a bundle on MacOS, and the icon can be displayed normally, but there is no PkgInfo file; |
| 52 | + 2. How does cmake generate PkgInfo files? |
| 53 | + 1. WireShark use`set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/PkgInfo PROPERTIES MACOSX_PACKAGE_LOCATION .)`In a similar way, copy it to the bundle; |
| 54 | + 3. qmake will generate a PkgInfo file by default, you only need to specify`TARGET=app`or`CONFIG+=bundle`That’s it; |
| 55 | + |
| 56 | +- Under Unix systems, you need to use static libraries as much as possible to avoid dependence on dynamic libraries; |
| 57 | + 1. Several modules in this project are dynamic libraries, and because they are plugins, they need to be loaded dynamically; |
| 58 | + 2. Then you need to package these dynamic libraries and load them at runtime. You also need to modify the rpath`"-Wl,-rpath,\'\$$ORIGIN\':\'\$$ORIGIN/lib\':'\$$ORIGIN/../lib'")`, set it, otherwise the dynamic library will not be found; |
54 | 59 | 3. Or use install_name_tool (macos), patchelf/chrpath (linux) to modify the dependency path of the dynamic library, which is very troublesome;
|
55 |
| - 4. Also consider that these libraries can be shared, so don't pack them repeatedly; |
56 |
| - 5. You can see the details[workflows](.github/workflows/cmake.yml); |
| 60 | + 4. Also consider that these libraries can be shared, so do not package them repeatedly; |
| 61 | + 5. For details, please see[workflows](.github/workflows/cmake.yml); |
| 62 | + |
| 63 | +- MacOS,[vcpkg](https://github.com/microsoft/vcpkg)Issues with compiling third-party libraries; |
| 64 | + 1. because[vcpkg](https://github.com/microsoft/vcpkg)at present[Only supports separate compilation of x64-osx and arm64-osx](https://github.com/microsoft/vcpkg/discussions/19454); |
| 65 | + 2. In use[cmake](.github/workflows/cmake.yml), you need to specify`CMAKE_OSX_ARCHITECTURES=x86_64`or`CMAKE_OSX_ARCHITECTURES=arm64`; |
| 66 | + 3. In use[qmake](.github/workflows/qmake.yml), you need to specify`QMAKE_APPLE_DEVICE_ARCHS=x86_64`or`QMAKE_APPLE_DEVICE_ARCHS=arm64`; |
0 commit comments