https://github.com/brisklib/brisk-helloworld
Hello world example for the Brisk library
https://github.com/brisklib/brisk-helloworld
Last synced: 1 day ago
JSON representation
Hello world example for the Brisk library
- Host: GitHub
- URL: https://github.com/brisklib/brisk-helloworld
- Owner: brisklib
- Created: 2024-10-16T20:52:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-09T12:51:05.000Z (about 1 year ago)
- Last Synced: 2025-10-29T05:52:36.372Z (8 months ago)
- Language: C++
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Brisk Example Project
This project demonstrates how to use the [Brisk C++ library](https://github.com/brisklib/brisk) to build an application using CMake. It includes a simple executable that links to the Brisk library.
## Prerequisites
To build and run this project, ensure you have the following installed:
- **C++ compiler** supporting C++20 or later
- **CMake** version 3.22 or higher
- **Brisk Library** source code (Ensure `BRISK_DIR` is properly set to the location of the Brisk repository: `-DBRISK_DIR=path/to/brisk/repository`)
## Project Structure
- `main.cpp`: This file contains the entry point and core logic for the example application.
- `CMakeLists.txt`: Configuration file for CMake to build the project and link necessary libraries.
## Building the Project
1. Clone or download the repository to your local machine.
2. Navigate to the project directory:
```bash
cd path/to/project
```
3. Create a build directory and navigate into it:
```bash
mkdir build && cd build
```
4. Run CMake to configure the project:
```bash
cmake -DBRISK_DIR=path/to/brisk/repository -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
```
5. Build the project:
```bash
cmake --build .
```
## Dependencies
The Brisk dependencies are built using the [vcpkg package manager](https://github.com/microsoft/vcpkg/). Vcpkg manages the dependencies by using source packages and builds each dependent library from its sources, which may lead to significant build times on the first run. It is recommended to set up a [binary cache](https://learn.microsoft.com/en-us/vcpkg/users/binarycaching) to reuse built libraries across multiple Brisk projects.
## CMake Configuration
The provided `CMakeLists.txt` file includes the following key components:
- **Project Setup**: The project is configured with the `brisk_setup()` function, and the metadata for the application is defined via `brisk_metadata()`.
- **Executable Setup**: The project compiles the `main.cpp` file into an executable and links it to the Brisk libraries (`brisk-widgets` and `brisk-executable`).
```cmake
add_executable(main main.cpp)
target_link_libraries(main PRIVATE brisk-widgets brisk-executable)
```
Ensure that the Brisk library is available and properly linked in your environment.
## License
The Brisk library is licensed under a dual GPLv2+/Commercial license.
The example project contained in this repository is licensed under the public domain or CC0. You are free to modify this code and use it as a starting point for your own projects, either GPL-licensed or proprietary (provided you have acquired a commercial license for the Brisk library, for details, contact brisk@brisklib.com).
## Compatibility
The code in this example is compatible with Brisk 0.9.8+.