Skip to content

Conversation

@eaaltonen
Copy link

Declaring include directories on targets has the benefit that the
declarations are propagated to the INTERFACE_INCLUDE_DIRECTORIES
property in the CMake package file. This ensures that downstream
projects can link to the imported CMake targets and get the correct
include directories set automatically.

The target_include_directories declarations follow the recommendation
https://cmake.org/cmake/help/latest/command/target_include_directories.html
so that the packages are relocatable. This in turn allows
installing and testing without requiring root permissions.

Following same recommendations, Boost headers are included using the
imported target Boost::boost. This is available starting from CMake
version 3.5, and the required version is updated accordingly.

Signed-off-by: Eero Aaltonen [email protected]

Declaring include directories on targets has the benefit that the
declarations are propagated to the `INTERFACE_INCLUDE_DIRECTORIES`
property in the CMake package file. This ensures that downstream
projects can link to the imported CMake targets and get the correct
include directories set automatically.

The `target_include_directories` declarations follow the recommendation
https://cmake.org/cmake/help/latest/command/target_include_directories.html
so that the packages are **relocatable**. This in turn allows
installing and testing without requiring `root` permissions.

Following same recommendations, Boost headers are included using the
imported target `Boost::boost`. This is available starting from CMake
version 3.5, and the required version is updated accordingly.

Signed-off-by: Eero Aaltonen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant