I am not an expert C or C++ programmer, but I have to write a C and a C++ application for two course projects. To start off on the right foot, I was reading a guide about how to structure the code of a CMake project.
I would like to clarify the meaning and usage of the include
directory:
- If the project is a library, is the
include
directory meant to contain the API functions that the users of the library can include in their code and invoke? If so, what directory should be used for headers containing declarations of internal functions? Should such headers be put together with the source code (which is contained in thesrc
directory)? - If the project is an application, is the
include
directory meant to contain the header files of the source code? If so, what is the advantage of separating headers from sources? Is it just a matter of preference of organization?
Thank you for any insight.