Installation
This section explains the recommended ways to include the Gustave library into your project.
Make sure your project is built with C++20 (or later) enabled.
Conan
Conan center (SOON™)
Official releases of Gustave will be available on the Conan center.
Add the gustave dependency in your project's conanfile.txt:
[requires]
gustave/0.1.1
Usage in your project's CMakeLists.txt:
find_package(Gustave CONFIG REQUIRED Distrib-Std)
add_executable(your-binary
"main.cpp"
)
target_link_libraries(your-binary PRIVATE Gustave::Distrib-Std)
From source
The source tree has a valid conanfile that can be used to create the package locally on your machine.
git clone https://github.com/vsaulue/Gustave.git
conan create ./Gustave -s:h build_type=Release -c tools.build:skip_test=True -c user.gustave:build_tutorials=False -c user.gustave:build_docs=False -c user.gustave:build_tools=False --build=missing
Note
Repeat the last command line for all build_type
required by your project (Debug
, RelWithDebInfo
, ...)
This package can then be consumed normally by your other local Conan projects.
Vcpkg
Official registry (SOON™)
From source
Gustave's source tree has a vcpkg overlay that can be used by your projects locally.
Note
if you're using Visual Studio, use a standalone installation of vcpkg (the one shipped with the IDE seems to have issues with overlays).
-
Clone Gustave somewhere on your machine (and optionally, checkout a specific version):
git clone https://github.com/vsaulue/Gustave.git /home/user123/somewhere/Gustave
-
Add an overlay port in the vcpkg-configuration.json file of your project, to
packaging/vcpkg/overlay
inside Gustave. Example:{ "default-registry": { "kind": "git", "baseline": "1a21d756f26d6b974cf52544b291bcdc65de6f4c", "repository": "https://github.com/microsoft/vcpkg" }, "overlay-ports": [ "/home/user123/somewhere/Gustave/packaging/vcpkg/overlay" ] }
-
Add a dependency to Gustave in the vcpkg.json of your project:
{ "dependencies": [ "gustave" ] }
CMake
The release builds includes proper CMake packaging files in the cmake/
subfolder. To use them:
- Download a
gustave-release.zip
file from the Github releases. - Unzip it somewhere on your machine.
- Edit your project's
CMakeLists.txt
as follows:find_package(Gustave CONFIG REQUIRED Distrib-Std) add_executable(your-binary "main.cpp" ) target_link_libraries(your-binary PRIVATE Gustave::Distrib-Std)
- When configuring your project, add
-D Gustave_DIR=/path/to/unzipped/gustave-release/cmake
to your project's command line (note thecmake
subfolder).
Other
Gustave is currently a header-only library. The release builds package all headers in a single folder for easy integration with other build systems:
- Download a
gustave-release.zip
file from the Github releases. - Unzip it somewhere on your machine.
- Add the subfolder
distrib-std/include
of the unzippedgustave-release
as a header directory into your build.
For example, to compile directly with gcc
's command line:
g++ -std=c++20 -I /path/to/unzipped/gustave-release/distrib-std/include my-program.cpp -o my-program