[cmake-developers] [PATCH] QtCreator integration: C++ includes must come first

Tobias Hunger tobias.hunger at gmail.com
Fri Aug 26 10:49:18 EDT 2016


Hello CMake developers,

CMake used to break C++ projects in its CodeBlocks generator. Now it
probably breaks C projects.

I think the approach is wrong: C and C++ includes should never get
concatenated. Please consider to report compiler flags/include
paths/defines by language. You might want to keep the concatenated
information for backwards compatibility.

CMake 3.6 changed the include paths in the CodeBlocks generator to not
be in random order -- which might actually have caused the issue Kevin
is seeing. The IDEs using CodeBlocks generator seem to be pretty
robust at the Include paths front... considering there were no
complaints for *years* about the broken include paths ordering. So
maybe it is safe to not bother about backward compatibility here.

Best Regards,
Tobias

On Fri, Aug 26, 2016 at 3:59 PM, Brad King <brad.king at kitware.com> wrote:
> On 08/25/2016 02:54 PM, Kevin Ottens wrote:
>> When using the Clang Code Model in QtCreator, it turned out that having
>> the C system include dirs can make it report false positives for most
>> uses on the STL. This is due to the order the Clang Code Model looks at
>> the include directories and some C includes in /usr/include could be
>> incompatible with the used STL if found first.
>
> Thanks, applied:
>
>  CodeBlocks: List C++ includes first
>  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38995d19
>
> -Brad


More information about the cmake-developers mailing list