intel / mavlink-vehicles

A Mavlink wrapper dedicated to the most common messages that are exchanged between an air vehicle and a ground station
Apache License 2.0
6 stars 9 forks source link

Replace include_directories with target_include_directories #39

Closed guiccbr closed 8 years ago

guiccbr commented 8 years ago

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:

```
#include "mavlink_vehicles/src/mavlink_vehicles.hh"
```

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:

```
#include "mavlink_vehicles.hh"
```

Signed-off-by: Guilherme Campos Camargo guilherme.campos.camargo@intel.com

rchiossi commented 8 years ago

LGTM.