Cmake include_directories() does not propagate up, what means that any project
that includes this project as a subdirectory will need to know the exact
location of our headers if it wants to use them. As a result, parent projects
will eventually need to make changes to their include paths if for some reason
we change something in ours, besides having to keep long names in their
#include directives or include_directories().
For example, the following line would be needed in orther include
mavlink_vehicles.hh in the source code of a parent project:
By using target_include_directories(), cmake deals with it transparently when a
target of a parent project links to our library. Then, the source code of that
target would need simply to add the following line to include our headers:
Cmake include_directories() does not propagate up, what means that any project that includes this project as a subdirectory will need to know the exact location of our headers if it wants to use them. As a result, parent projects will eventually need to make changes to their include paths if for some reason we change something in ours, besides having to keep long names in their #include directives or include_directories().
For example, the following line would be needed in orther include mavlink_vehicles.hh in the source code of a parent project:
By using target_include_directories(), cmake deals with it transparently when a target of a parent project links to our library. Then, the source code of that target would need simply to add the following line to include our headers:
Signed-off-by: Guilherme Campos Camargo guilherme.campos.camargo@intel.com