I have a project that includes a library which I have written which can be reused in multiple projects. This library uses header files to configure it’s self depending on what the application requires. I am unsure what the best practice for this is - I want the library to be portable and to tell future users how to use it (even with minimum CMake experience)
As is the Library is added to the project as a git submodule and it’s is added via add_subdirectory in the main project. My current thinking is to have templates of the the config headers contained in the library which will be copied to a config folder in the main project (so the user can configure it and the changes will be saved in the main projects git). The submodule library’s CMakeLists.txt will then add these files to a interface library (as it’s headers only) and link this privately to the submodule library.
Are there any better ways to do this?
Thanks,
Larry