0

I am writing a library that uses other libraries which I have included in my header files due to templates. I am using CMake for a build system, and the helper libraries are kept as submodules in the external directory. I want to provide the user access to header files of these libraries so the user can do #include <mylib/helperlib/helper.h>. How do I arrange my project tree to achieve this? Also, How do I integrate it with CMake to generate install targets?

This is my project tree.

.
├── examples
├── external
├── include
├── res
└── src

Links:

This is my library.

libfmt is the library I want to package with my project.

P.S. Helper libraries are not necessarily header only.

  • you might want to investigate conan or vcpkg, they might make your life easier – Alan Birtles Mar 25 '22 at 12:01
  • Why do you want to prefix third-party headers with your own directory? That's a weird thing to ask for. If everybody did this, you'd have a bunch of different ways of including the same header. – HolyBlackCat Mar 25 '22 at 12:28
  • I am using that library in my header files. Is there a way to access those headers after installation? – Mansoor Ahmed Memon Mar 25 '22 at 12:36
  • You should be using the library as usual, and it should be installed alongside your library. I'm not familiar with CMake though. – HolyBlackCat Mar 25 '22 at 17:49

0 Answers0