The popular stb libraries are a set of header-only libraries which are very easy to just copy and paste into existing codebases.
However, if you have already set up a cmake based project is sometimes convenient to have proper cmake targets for the individual libraries.
This wrapper creates cmake targets for each library that takes care of adding the actual implementation for the libraries, i.e., adding the proper STD_(...)_IMPLEMENTATION
define.
After adding this wrapper to you project you have access to the std::LIBRARY_NAME
targets.
For example, to use the image library you simply add this to your cmake script:
target_link_libraries(YOUR_TARGET PUBLIC std::image)
- Via CPM: simply add
CPMAddPackage("gh:ovis-games/[email protected]")
to your cmake script. - Via git submodules: add a submodule to your repository and add
add_subdirectory(path/to/std-cmake-wrapper)
. Alternatively you can also copy and paste the conent of this repository instead of using git submodules.
This list gives an overview of the currently supported libraries. The libraries currently not supported by the wrapper are the ones needing additional defines to work (textedit, voxel_render, tilemap_editor, connected_components). In addition, the vorbis library is currently not supported as it is a .c file but somehow acts as a header and I currently do not want look into it how it actually works.
- stb::vorbis
- stb::hexwave
- stb::image
- stb::truetype
- stb::image_write
- stb::image_resize
- stb::rect_pack
- stb::perlin
- stb::ds
- stb::sprintf
- stb::textedit
- stb::voxel_render
- stb::dxt
- stb::easy_font
- stb::tilemap_editor
- stb::herringbone_wang_tile
- stb::c_lexer
- stb::divide
- stb::connected_components
- stb::leakcheck
- stb::include