[CMake] target_include_directories and system headers

Nils Gladitz nilsgladitz at gmail.com
Thu Jun 28 02:03:31 EDT 2018


On Thu, Jun 28, 2018 at 7:12 AM Jim Lloyd <jim.lloyd at etagen.com> wrote:

> [...]
> But if I make a trivial project that simply includes yaml-cpp as a
> dependency, the generated compile commands use `-isystem` to include the
> yaml-cpp headers.
>
> Is this a bug in CMake?
>
> Also, is there any way I may be able to work around this problem with
> CMake 3.10? I would be happy to globally force the use of `-I` for all
> include directories.
>

I think the question and a potential work around are covered by
https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#include-directories-and-usage-requirements
Specifically the paragraph close to the end starting with "When the
INTERFACE_INCLUDE_DIRECTORIES of an imported target...".

Basically include directories inherited from imported targets are
implicitly "SYSTEM" by default.

Nils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180628/133008db/attachment.html>


More information about the CMake mailing list