Follow these steps to build this version of Layers and use it in your own project.

Build Guide - Layers

Requires CMake 3.22+ and a C++17 compiler.

Step 1 - Clone Layers

Clone Layers from the Codeberg repository:

git clone https://codeberg.org/HuntrSoftware/Layers.git

If you prefer, you can add it as a submodule:

git submodule add https://codeberg.org/HuntrSoftware/Layers.git

Step 2 - Build Layers

From the project root, run the following to build Layers:

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

This produces the shared library in lib/ (debug builds append a d suffix). Tests build by default (-DLAYERS_BUILD_TESTS=OFF to skip; run them with ctest from build/), and the runnable examples are opt-in with -DLAYERS_BUILD_EXAMPLES=ON.

Using Layers in your project

Layers is a standard CMake package: link the Layers::Layers target and include headers as #include <Layers/lengine.h>. It requires C++17 and has no external dependencies. Pick whichever route fits your project:

As a subdirectory (vendored copy or submodule):

add_subdirectory(ext/Layers)

target_link_libraries(my-app PRIVATE Layers::Layers)

As a subproject, Layers keeps to itself: tests and examples are skipped by default and no output directories are overridden, so your project's layout is untouched.

With FetchContent:

include(FetchContent)
FetchContent_Declare(Layers
    GIT_REPOSITORY https://codeberg.org/HuntrSoftware/Layers.git
    GIT_TAG        X.X.X)   # REPLACE with the tag/commit you want!
FetchContent_MakeAvailable(Layers)

target_link_libraries(my-app PRIVATE Layers::Layers)

As an installed package:

cmake --install build   # from a built Layers checkout
find_package(Layers CONFIG REQUIRED)
target_link_libraries(my-app PRIVATE Layers::Layers)
Appearance
Theme
—