I'm trying to understand the difference between the scope that one can specify in target_include_directories, specifically PRIVATE and INTERFACE. The documentation says (the specific context is header only library):
The INTERFACE, PUBLIC and PRIVATE keywords are required to specify the scope of the following arguments. PRIVATE and PUBLIC items will populate the INCLUDE_DIRECTORIES property of . PUBLIC and INTERFACE items will populate the INTERFACE_INCLUDE_DIRECTORIES property of . (IMPORTED targets only support INTERFACE items.) The following arguments specify include directories.
So basically using either PRIVATE or INTERFACE modifies INCLUDE_DIRECTORIES or INTERFACE_INCLUDE_DIRECTORIES. I do struggle to understand the difference between the two of them. From the description in the doc INCLUDE_DIRECTORIES seems to be the argument of the flag -I when compiling a C++ project.
I don't understand at all the latter instead, can anyone clarify?
Also apparently using INTERFACE is better when using headers only library, why is that?