Depending on single header libraries #11817
-
Some libraries are distributed as a single header file: https://github.com/nothings/stb What is the current best practice to include those as dependency? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For tinyobjloader it provides a pkg-config and a cmake config file, so: dependency('tinyobjloader') For stb this is complicated because upstream doesn't really support anything other than copying the header into your own project sources. No installation routines are provided, and there are multiple separate projects in one git repo that each have separate versioning policies -- which per the upstream developer you may want to have different versions of, so even adding it as a git submodule doesn't work, because you can't have multiple versions of the git repo at the same time. See e.g. nothings/stb#359 |
Beta Was this translation helpful? Give feedback.
For tinyobjloader it provides a pkg-config and a cmake config file, so:
For stb this is complicated because upstream doesn't really support anything other than copying the header into your own project sources. No installation routines are provided, and there are multiple separate projects in one git repo that each have separate versioning policies -- which per the upstream developer you may want to have different versions of, so even adding it as a git submodule doesn't work, because you can't have multiple versions of the git repo at the same time.
See e.g. nothings/stb#359