Skip to content

ovis-interactive/stb-cmake-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stb cmake wrapper

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)

Adding the wrapper to your project

  1. Via CPM: simply add CPMAddPackage("gh:ovis-games/[email protected]") to your cmake script.
  2. 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.

Library support

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.

License

MIT

About

A convenience wrapper around the popular stb libraries

Topics

Resources

License

Stars

Watchers

Forks