[CMake] target_include_directories(): SYSTEM option does not seem to work on recent versions of CMake, when targeting Xcode.

A D boitoletre at gmail.com
Fri Aug 7 04:14:37 EDT 2015


Opened issue 15687 for this problem:
http://www.cmake.org/Bug/view.php?id=15687

Thank again for your help Nils.

(ps: sorry, just realize now that I forgot to forward other answers to the
list... Pasting the content below)

2015-08-07 9:27 GMT+02:00 A D <boitoletre at gmail.com>:

> 2015-08-06 10:57 GMT+02:00 Nils Gladitz <nilsgladitz at gmail.com>:
>
>> suggesting that even though the compiler might support -isystem, Xcode
>> itself does (or did) not. I can't tell if that is something that may or may
>> not have changed with current Xcode releases.
>>
>
> Xcode has been calling Clang behind the scene (I think it was a custom
> Apple GCC before). There is an Xcode setting for "header search path",
> which is a list of 'non-system' headers. Even if there is not a separate
> Xcode settings for "system headers", there is a setting for the cpp flags
> that are directly forwarded to the compiler: in practice, this allows to
> achieve everything that would be possible by invoking Clang directly. In
> particular, if I take the path from "header search path" setting, and put
> it as "-isystem ${path_value}" in the "Other C++ flags" setting, I obtain
> the expected result.
>
> If you have reason to believe it is supported now (e.g. because you are
>> able to create and Xcode project without cmake that has explicit system
>> includes) you may want to open an issue.
>>
>
> Thank you for this suggestion, I will report the issue referring to this
> exchange.
>
> Best regards,
>


2015-08-07 9:55 GMT+02:00 A D <boitoletre at gmail.com>:

>
> 2015-08-07 9:31 GMT+02:00 Nils Gladitz <nilsgladitz at gmail.com>:
>
>> One issue you might want to look for when passing the flag directly to
>> the compiler without allowing IDE interpretation might be that the internal
>> code model used by Xcode for e.g. auto-completion might then not know about
>> it.
>
>
> That is a good point indeed. So I just tried, and both the linter and
> auto-completion seem to make no difference with regard to how the header
> path is provided to the project (they kept working in the same way):
> * The linter stopped 'underlining' the boost include as soon as I gave the
> '-isystem <path>' to the C++ flags
> * Adding a new library to this '-isystem' flag, auto-completion was aware
> of its symbols as soon as I included its headers in a compilation units.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150807/96489f86/attachment-0001.html>


More information about the CMake mailing list