This project demonstrates how to integrate and use the Areg SDK for various purposes. The current build status is shown below:
- Introduction
- System Requirements
- Integration Methods
- Advanced Features
- Building the Areg SDK Demo Project
- Demo Applications
- Contribution Guidelines
- License
- Issues and Feedback
The Areg SDK Demo Project provides a practical example and template for developers to create new projects using the Areg SDK or integrating it into existing projects.
This demo showcases three primary ways to integrate Areg SDK into your project:
- Fetching source code using CMake — directly fetch Areg SDK source files and build them alongside your project.
- Using pre-built vcpkg packages — integrate the Areg SDK as a package via CMake and vcpkg.
- Adding Areg SDK as a Git submodule — integrate Areg SDK into your project to work with MSBuild and/or CMake.
Each method is described in detail below.
Ensure your system includes the following:
- Git for repository cloning.
- Java 17+ for code generation tools.
- Compilers: GNU or LLVM (Linux); MSVC or Clang (Windows). Must support C++17 or newer.
- Build Tools: CMake 3.20+ or Microsoft Visual Studio 2019+.
- Linux: Install ncurses if you want to compile with extended objects.
- Windows: Requires Microsoft Visual C++, including CMake, Clang for Windows, and MFC for GUI examples.
- Optional Libraries:
- Google Test (GTest) for unit tests (or let Areg SDK build it from sources).
- SQLite3 (or let Areg SDK build from sources).
Modify your project’s CMakeLists.txt
to include:
include(FetchContent)
FetchContent_Declare(
areg-sdk
GIT_REPOSITORY https://github.com/aregtech/areg-sdk.git
GIT_TAG "master"
)
FetchContent_MakeAvailable(areg-sdk)
# Set the root directory of the fetched Areg SDK
set(AREG_SDK_ROOT "${areg-sdk_SOURCE_DIR}")
include_directories(${AREG_SDK_ROOT}/framework)
Once fetched, you can use the Areg SDK libraries via the areg::
namespace:
areg::areg
— core framework libraryareg::aregextend
— extended objectsareg::areglogger
— logging client API
This method also gives access to the code generator (codegen
), multicast router (mcrouter
), and logging services (logger
).
Important
Areg SDK is prepared and tested as a vcpkg
package. It is expected to be included in the upcoming version 2.0.0.
Steps:
- Clone, build, and install vcpkg (see vcpkg repo).
- Install the Areg SDK package:
Windows (64-bit):
vcpkg install areg:x64-windows
Linux (64-bit):
vcpkg install areg:x64-linux
- Integrate vcpkg into your project:
vcpkg integrate install
- Update
CMakeLists.txt
:
find_package(areg CONFIG REQUIRED)
include_directories(${AREG_FRAMEWORK})
Compile with:
cmake -B ./build -DCMAKE_TOOLCHAIN_FILE=<vcpkg-root>/scripts/buildsystems/vcpkg.cmake
This method offers a modular approach to using the Areg SDK.
Add Areg SDK as a submodule (useful for Visual Studio):
[submodule "thirdparty/areg-sdk"]
path = thirdparty/areg-sdk
url = https://github.com/aregtech/areg-sdk.git
Initialize:
git submodule update --init --recursive
git submodule update --remote --recursive
Update CMakeLists.txt
:
set(AREG_SDK_ROOT "${CMAKE_SOURCE_DIR}/thirdparty/areg-sdk")
include("${AREG_SDK_ROOT}/CMakeLists.txt")
This allows direct inclusion of Areg SDK projects in Visual Studio solutions.
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).
This demo includes an option INTEGRATE_AREG_BEFORE_PROJECT
. Set it to TRUE
or FALSE
to experiment with both approaches.
For more customization, include areg.cmake and check user.cmake.
You can include via:
include("${AREG_CMAKE_CONFIG_DIR}/areg.cmake")
or (for vcpkg integration):
include("${AREG_CMAKE_EXPORTS}")
Ensure:
- CMake 3.20+
- Java 17+
- C++17+ compiler
Clone the repo:
git clone https://github.com/aregtech/areg-sdk-demo.git
Build (fetching Areg SDK sources):
cmake -B ./build
cmake --build ./build
Build (Areg SDK via vcpkg):
cmake -B ./build -DCMAKE_TOOLCHAIN_FILE=<vcpkg-root>/scripts/buildsystems/vcpkg.cmake
cmake --build ./build
Build with Visual Studio:
Open areg-sdk-demo.sln
and compile.
Important
For Visual Studio builds, clone with submodules:
git clone --recurse-submodules https://github.com/aregtech/areg-sdk-demo.git
Located in ./demo/
.
They are adapted from Areg SDK examples.
You can explore, modify, or add new demos.
Contributions are welcome! You can:
- Add new example projects
- Provide configuration/build examples
- Create CI/CD workflows
To contribute:
- Fork the repo.
- Make your changes.
- Ensure compatibility (CMake, Visual Studio, GCC, MSVC, Clang).
- Open a Pull Request with details.
Licensed under the MIT License. Free for personal and commercial use.
For bugs or feature requests, open an issue in the Issues section. Your feedback is appreciated!