Install the Parser as Static Library
You can build and install the Erbsland Configuration Parser as a standalone static library. This approach is useful if you:
Want to reuse the parser across multiple independent projects.
Prefer a system-wide installation.
Integrate it into an existing build or packaging workflow.
For most use cases, however, we recommend integrating the parser as a Git submodule directly into your project. This gives you tighter version control, reproducible builds, and simpler dependency management. See Integrate the Parser as Submodule for details.
Note
This page describes the default parser-only installation. If you also need a validation-rules static library, see Install Validation-Rules Static Libraries.
Build and Install
Follow these steps to clone, build, and install the library:
$ git clone https://github.com/erbsland-dev/erbsland-cpp-configuration.git
$ mkdir build
$ cd build
$ cmake ../erbsland-cpp-configuration -DCMAKE_BUILD_TYPE=Release
-- The CXX compiler identification is (...)
(...)
-- Build files have been written to: (...)/build
$ cmake --build .
[ 1%] Building CXX object (...)/TokenDecoder.cpp.o
[ 3%] Building CXX object (...)/Core.cpp.o
(...)
[100%] Linking CXX static library liberbsland-configuration-parser.a
[100%] Built target erbsland-configuration-parser
$ cmake --install .
-- Install configuration: "Release"
-- Installing: (...)/lib/liberbsland-configuration-parser.a
-- Installing: (...)/include
(...)
After installation, you will have:
The static library
liberbsland-configuration-parser.a.All public header files in the install include directory.
An exported CMake package configuration for
find_package.
By default, this installation does not include static libraries for validation rules. If you need one, refer to Install Validation-Rules Static Libraries.
Installation Prefix
By default, CMake installs to a platform-specific location:
/usr/localon most Unix-like systemsA platform-dependent directory on Windows
If you want to control the install location, set the prefix explicitly:
$ cmake --install . --prefix /your/custom/path
Alternatively, you can define CMAKE_INSTALL_PREFIX during configuration:
$ cmake ../erbsland-cpp-configuration \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/your/custom/path
For faster and more reliable incremental builds, we recommend using Ninja as your build tool on all platforms.
$ git clone https://github.com/erbsland-dev/erbsland-cpp-configuration.git
$ mkdir build
$ cd build
$ cmake ../erbsland-cpp-configuration -G Ninja -DCMAKE_BUILD_TYPE=Release
$ cmake --build . -j 8
Linking from a Consumer Project
The installation exports a CMake package that provides the parser target.
In your consuming project:
find_package(erbsland-configuration-parser REQUIRED)
add_executable(example src/main.cpp)
target_compile_features(example PRIVATE cxx_std_20)
target_link_libraries(example PRIVATE
ErbslandDEV::erbsland-configuration-parser
)
This ensures:
Proper include directories.
Correct compile definitions.
Clean and modern CMake-based integration.
If you prefer source-based integration with exported CMake targets for both the parser and validation rules, follow the submodule workflow described in Integrate the Parser as Submodule.