Skip to content

Fix CMake targets include path propagation#414

Open
FredeHoey wants to merge 2 commits into
MicrochipTech:mainfrom
FredeHoey:main
Open

Fix CMake targets include path propagation#414
FredeHoey wants to merge 2 commits into
MicrochipTech:mainfrom
FredeHoey:main

Conversation

@FredeHoey

Copy link
Copy Markdown

In all places where the cmake files call include_directories, the first and second parameters are a target and a scope specifier. For include_directories, that means literally adding those parameters to the include path via -I flags, ie.

include_directories(target PUBLIC ...) -> -Itarget -IPUBLIC

This was probably intended to be a target_include_directories instead, such that any library or executable calling target_link_libraries would also have those includes propagated

see:
https://cmake.org/cmake/help/latest/command/include_directories.html https://cmake.org/cmake/help/latest/command/target_include_directories.html#command:target_include_directories

Checklist

In all places where the cmake files call include_directories, the first
and second parameters are a target and a scope specifier. For
include_directories, that means literally adding those parameters to the
include path via -I flags, ie.

```cmake
include_directories(target PUBLIC ...) -> -Itarget -IPUBLIC
```

This was probably intended to be a target_include_directories instead,
such that any library or executable calling target_link_libraries would
also have those includes propagated

see:
https://cmake.org/cmake/help/latest/command/include_directories.html
https://cmake.org/cmake/help/latest/command/target_include_directories.html#command:target_include_directories
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

This PR has been marked as stale and will be automatically closed in 7 days.

@github-actions github-actions Bot added the Stale label Jun 8, 2026
@github-actions github-actions Bot removed the Stale label Jun 9, 2026
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