You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -31,13 +31,13 @@ This project demonstrates how to integrate and use the AREG SDK for various purp
31
31
32
32
## Introduction
33
33
34
-
The **AREG SDK Demo Project** provides a practical example and template for developers to create new projects using the [AREG SDK](https://github.com/aregtech/areg-sdk/) or integrating it into existing projects.
34
+
The **Areg SDK Demo Project** provides a practical example and template for developers to create new projects using the [Areg SDK](https://github.com/aregtech/areg-sdk/) or integrating it into existing projects.
35
35
36
-
This demo showcases three primary ways for seamless integration of AREG SDK into your project:
36
+
This demo showcases three primary ways to integrate Areg SDK into your project:
37
37
38
-
1.**Fetching source code using cmake**: Directly fetch AREG SDK source files and build them alongside your project using CMake.
39
-
2.**Using pre-built vcpkg packages**: Integrate the AREG SDK as a package via CMake and vcpkg.
40
-
3.**Adding AREG SDK as a submodule**: Add AREG SDK as a Git submodule to your project to integrate with `MSBuild` and/or `cmake`.
38
+
1.**Fetching source code using CMake** — directly fetch Areg SDK source files and build them alongside your project.
39
+
2.**Using pre-built vcpkg packages** — integrate the Areg SDK as a package via CMake and vcpkg.
40
+
3.**Adding Areg SDK as a Git submodule** — integrate Areg SDK into your project to work with MSBuild and/or CMake.
41
41
42
42
Each method is described in detail below.
43
43
@@ -47,25 +47,27 @@ Each method is described in detail below.
47
47
48
48
### General Requirements
49
49
Ensure your system includes the following:
50
-
-**Git** for repository cloning.
51
-
-**Java** version 17 or newer for code generation tools.
52
-
-**Compatible Compilers**: *GNU* or *LLVM* to build for Linux; *MSVC* or *Clang* to build for Windows. All compilers should support **C++17** or newer.
53
-
-**Build Tools**: *Cmake* version 3.20 or newer, or Microsoft Visual Studio 2019 or newer.
50
+
51
+
-**Git** for repository cloning.
52
+
-**Java 17+** for code generation tools.
53
+
-**Compilers**: GNU or LLVM (Linux); MSVC or Clang (Windows). Must support **C++17** or newer.
54
+
-**Build Tools**: CMake 3.20+ or Microsoft Visual Studio 2019+.
54
55
55
56
### Platform-Specific Requirements
56
-
-**Linux**: Install **ncurses** if you want to compile with extended objects.
57
-
-**Windows**: Requires Microsoft Visual C++, including packages **CMake** and **CLang compiler for Windows**, and **MFC** for GUI examples.
58
-
-**Optional Libraries**:
59
-
-**Google Test (GTest)** for unit tests or AREG SDK automatically builds from sources.
60
-
-**SQLite3** or AREG SDK can build from sources.
57
+
58
+
-**Linux**: Install **ncurses** if you want to compile with extended objects.
59
+
-**Windows**: Requires Microsoft Visual C++, including **CMake**, **Clang for Windows**, and **MFC** for GUI examples.
60
+
-**Optional Libraries**:
61
+
-**Google Test (GTest)** for unit tests (or let Areg SDK build it from sources).
62
+
-**SQLite3** (or let Areg SDK build from sources).
61
63
62
64
---
63
65
64
66
## Integration Methods
65
67
66
-
### Method 1: Integrate by Fetching AREG SDK Source Code
68
+
### Method 1: Integrate by Fetching Areg SDK Source Code
67
69
68
-
To integrate the AREG SDK by fetching its source code, modify your project’s `CMakeLists.txt` to include the following script:
70
+
Modify your project’s `CMakeLists.txt` to include:
69
71
70
72
```cmake
71
73
include(FetchContent)
@@ -76,162 +78,190 @@ FetchContent_Declare(
76
78
)
77
79
FetchContent_MakeAvailable(areg-sdk)
78
80
79
-
# Set the root directory of the fetched AREG SDK
81
+
# Set the root directory of the fetched Areg SDK
80
82
set(AREG_SDK_ROOT "${areg-sdk_SOURCE_DIR}")
81
83
include_directories(${AREG_SDK_ROOT}/framework)
82
-
```
84
+
````
83
85
84
-
Once fetched, you can use the AREG SDK libraries in your project via the `areg::` namespace:
86
+
Once fetched, you can use the Areg SDK libraries via the `areg::` namespace:
85
87
86
-
-`areg::areg`for the core framework library
87
-
-`areg::aregextend`for extended objects
88
-
-`areg::areglogger`for the logging client API
88
+
* `areg::areg` — core framework library
89
+
* `areg::aregextend` — extended objects
90
+
* `areg::areglogger` — logging client API
89
91
90
-
Projects built by fetching the AREG SDK source code directly, compile it alongside project code.
91
-
Developers can also access the code generator (`codegen`), multicast router (`mcrouter`), and logging services (`logger`).
92
+
This method also gives access to the **code generator (`codegen`)**, **multicast router (`mcrouter`)**, and **logging services (`logger`)**.
92
93
93
94
---
94
95
95
-
### Method 2: Integrate via AREG SDK Package (vcpkg)
96
+
### Method 2: Integrate via Areg SDK Package (vcpkg)
96
97
97
98
> [!IMPORTANT]
98
-
> AREG SDK is prepared and tested to be a `vcpkg` package. It is expected to be included in the upcoming version 2.0.0
99
+
> Areg SDK is prepared and tested as a `vcpkg` package. It is expected to be included in the upcoming version 2.0.0.
99
100
100
-
Projects using CMake can integrate AREG SDK through the `vcpkg` package manager. To install, follow these steps:
101
+
Steps:
101
102
102
-
1. Clone, build and install vcpkg by following the instructions in the [official vcpkg repository](https://github.com/microsoft/vcpkg).
103
-
2. Install the AREG SDK package using the following commands:
103
+
1. Clone, build, and install vcpkg (see [vcpkg repo](https://github.com/microsoft/vcpkg)).
104
+
2. Install the Areg SDK package:
104
105
105
106
**Windows (64-bit):**
107
+
106
108
```bash
107
109
vcpkg install areg:x64-windows
108
110
```
109
111
110
112
**Linux (64-bit):**
113
+
111
114
```bash
112
115
vcpkg install areg:x64-linux
113
116
```
114
117
115
-
After installing the package, add the vcpkg toolchain to your project displayed after running this command:
118
+
3. Integrate vcpkg into your project:
119
+
116
120
```bash
117
121
vcpkg integrate install
118
122
```
119
123
120
-
To include the AREG SDK package in your project, update your `CMakeLists.txt` like this:
124
+
4. Update `CMakeLists.txt`:
125
+
121
126
```cmake
122
127
find_package(areg CONFIG REQUIRED)
123
128
include_directories(${AREG_FRAMEWORK})
124
129
```
125
130
126
-
To compile the sources, configure the project with CMake option `-DCMAKE_TOOLCHAIN_FILE=<vcpkg-root>/scripts/buildsystems/vcpkg.cmake`, where `<vcpkg-root>` should indicate the root folder of `vcpkg`, and build it.
This method provides a simpler and more modular approach to integrating the AREG SDK.
137
+
This method offers a modular approach to using the Areg SDK.
129
138
130
139
---
131
140
132
-
### Method 3: Integrate AREG SDK as a Git Submodule
141
+
### Method 3: Integrate Areg SDK as a Git Submodule
133
142
134
-
Alternatively, you can add AREG SDK as a submodule to your project. This is particularly useful for managing dependencies in Microsoft Visual Studio solutions. To integrate AREG SDK as a submodule, add the following to your `.gitmodules` file:
143
+
Add Areg SDK as a submodule (useful for Visual Studio):
135
144
136
145
```txt
137
146
[submodule "thirdparty/areg-sdk"]
138
147
path = thirdparty/areg-sdk
139
148
url = https://github.com/aregtech/areg-sdk.git
140
149
```
141
150
142
-
Then run the following commands to update and/or fetch the submodule:
151
+
Initialize:
143
152
144
153
```bash
145
154
git submodule update --init --recursive
146
155
git submodule update --remote --recursive
147
156
```
148
157
149
-
Add the AREG SDK to your `CMakeLists.txt` like this:
This method is particularly useful for Microsoft Visual Studio builds by including desired project of AREG SDK in your solution file.
165
+
This allows direct inclusion of Areg SDK projects in Visual Studio solutions.
156
166
157
167
---
158
168
159
169
## Advanced Features
160
170
161
-
The AREG SDK can be integrated before or after the first call of `project()` in CMake, depending on your needs.
162
-
This flexibility allows for custom configurations, such as specifying the compiler or enabling features like shared/static libraries, logging, and advanced objects.
163
-
To explore this flexibility, the demo project includes a compiler option `INTEGRATE_AREG_BEFORE_PROJECT`. Set this option to `TRUE` or `FALSE` to experiment with both approaches.
171
+
The Areg SDK can be integrated **before or after** the first `project()` call in CMake, enabling flexible customization (e.g., compiler choice, shared/static libraries, logging, advanced objects).
164
172
165
-
For more advanced configuration, include [areg.cmake](https://github.com/aregtech/areg-sdk/blob/master/conf/cmake/areg.cmake) in your `CMakeLists.txt` file
166
-
and refer to the available options described in the [user.cmake](https://github.com/aregtech/areg-sdk/blob/master/conf/cmake/user.cmake)
167
-
file located in the `conf/cmake` directory of the AREG SDK. Your can use this CMake script in your CMakeLists.txt: `include("${AREG_CMAKE_CONFIG_DIR}/areg.cmake")`
168
-
or script `include("${AREG_CMAKE_EXPORTS}")` if use AREG SDK package.
173
+
This demo includes an option `INTEGRATE_AREG_BEFORE_PROJECT`. Set it to `TRUE` or `FALSE` to experiment with both approaches.
174
+
175
+
For more customization, include [areg.cmake](https://github.com/aregtech/areg-sdk/blob/master/conf/cmake/areg.cmake) and check [user.cmake](https://github.com/aregtech/areg-sdk/blob/master/conf/cmake/user.cmake).
176
+
177
+
You can include via:
178
+
179
+
```cmake
180
+
include("${AREG_CMAKE_CONFIG_DIR}/areg.cmake")
181
+
```
182
+
183
+
or (for vcpkg integration):
184
+
185
+
```cmake
186
+
include("${AREG_CMAKE_EXPORTS}")
187
+
```
169
188
170
189
---
171
190
172
-
## Building the AREG SDK Demo Project
191
+
## Building the Areg SDK Demo Project
173
192
174
-
To build the demo applications, ensure that you have:
Open the solution file (`areg-sdk-demo.sln`) and compile.
221
+
Open `areg-sdk-demo.sln` and compile.
200
222
201
223
> [!IMPORTANT]
202
-
> Compilation with Visual Studio requires to clone this repository with AREG SDK submodule. Make sure that you have cloned the repository by calling `git clone --recurse-submodules https://github.com/aregtech/areg-sdk-demo.git`.
224
+
> For Visual Studio builds, clone with submodules:
The demo applications are located in the `./demo/` directory. They are simple examples taken from the [AREG SDK examples](https://github.com/aregtech/areg-sdk/tree/master/examples). You can explore, modify, or contribute new examples to showcase additional features or use cases.
234
+
Located in`./demo/`.
235
+
They are adapted from [Areg SDK examples](https://github.com/aregtech/areg-sdk/tree/master/examples).
236
+
You can explore, modify, or add new demos.
209
237
210
238
---
211
239
212
240
## Contribution Guidelines
213
241
214
242
Contributions are welcome! You can:
215
243
216
-
- Add new example projects
217
-
- Provide configuration and build examples
218
-
- Create workflows for automated builds and tests
244
+
* Add new example projects
245
+
* Provide configuration/build examples
246
+
* Create CI/CD workflows
219
247
220
248
To contribute:
221
249
222
-
1. Fork the repository.
223
-
2.Implement your changes.
224
-
3. Ensure compatibility with CMake, Microsoft Visual Studio, and multiple compilers (GCC, MSVC, Clang).
225
-
4.Submit a Pull Request with a detailed description.
This project is licensed under the [MIT License](https://github.com/aregtech/areg-sdk-demo/blob/main/LICENSE), offering flexibility for personal and commercial use.
259
+
Licensed under the [MIT License](https://github.com/aregtech/areg-sdk-demo/blob/main/LICENSE).
260
+
Free for personal and commercial use.
232
261
233
262
---
234
263
235
264
## Issues and Feedback
236
265
237
-
For any change requests or bug reports, please submit an issue in the [Issues](https://github.com/aregtech/areg-sdk-demo/issues) section. We value your feedback and contributions!
266
+
For bugs or feature requests, open an issue in the [Issues](https://github.com/aregtech/areg-sdk-demo/issues) section.
0 commit comments