Skip to content

Conversation

@dennisklein
Copy link
Contributor

CMake offers three visibility qualifiers for target include
directories, which are populated to target properties as shown in the
following table:

INTERFACE PUBLIC PRIVATE
INCLUDE_DIRECTORIES x x
INTERFACE_INCLUDE_DIRECTORIES X x

For dictionary generation the PUBLIC and INTERFACE qualifiers and
hence the INTERFACE_INCLUDE_DIRECTORIES are to be preferred, because
header files meant to be consumed by the user are usually put into
PUBLIC and/or INTERFACE qualified directories. Furthermore, the CMake
imported targets always have INTERFACE visibility.

This commit changes the current behaviour to read the
INTERFACE_INCLUDE_DIRECTORIES (as opposed to the INCLUDE_DIRECTORIES)
target property which will catch more desired use cases, including
imported targets. In other words, this will now ignore PRIVATE include
directories, but include INTERFACE include directories - PUBLIC ones
stay unchanged.

In addition, this commit adds a condition which ignores include
directories formulated as a CMake generator expression. Unfortunately,
there is currently no way to evaluate those seperately.

CMake offers three visibility qualifiers for target include
directories, which are populated to target properties as shown in the
following table:

 |                               | INTERFACE | PUBLIC | PRIVATE |
 | INCLUDE_DIRECTORIES           |           |   x    |    x    |
 | INTERFACE_INCLUDE_DIRECTORIES |     X     |   x    |         |

For dictionary generation the PUBLIC and INTERFACE qualifiers and
hence the INTERFACE_INCLUDE_DIRECTORIES are to be preferred, because
header files meant to be consumed by the user are usually put into
PUBLIC and/or INTERFACE qualified directories. Furthermore, the CMake
imported targets always have INTERFACE visibility.

This commit changes the current behaviour to read the
INTERFACE_INCLUDE_DIRECTORIES (as opposed to the INCLUDE_DIRECTORIES)
target property which will catch more desired use cases, including
imported targets. In other words, this will now ignore PRIVATE include
directories, but include INTERFACE include directories - PUBLIC ones
stay unchanged.

In addition, this commit adds a condition which ignores include
directories formulated as a CMake generator expression. Unfortunately,
there is currently no way to evaluate those seperately.
@phsft-bot
Copy link

Can one of the admins verify this patch?

Turns out, naked absolute include directories as target properties will
prohibit those targets from being exported with INSTALL(EXPORT ...).
Therefore, one cannot ignore the $<BUILD_INTERFACE:...> type generator
expressions.

This commit will add another condition which detects BUILD_INTERFACE
generator expressions and extracts the value which is then added to the
list of include directories for rootcling.
@Teemperor
Copy link
Contributor

@phsft-bot build

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, ubuntu14/native with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@dennisklein
Copy link
Contributor Author

Do not merge yet, I found a bug, will update on Monday.

@dennisklein
Copy link
Contributor Author

Closing this. There are much bigger and invasive changes needed, so I decided to just implement ROOT_GENERATE_DICTIONARY and ROOT_LINKER_LIBRARY inside our own CMake module based on the root implementation for now. Maybe in the future I can contribute them back.

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.

4 participants