[cmake-developers] Generating buildsystem metadata from CMake

Tobias Hunger tobias.hunger at gmail.com
Mon Mar 30 19:20:15 EDT 2015


On Mon, Mar 30, 2015 at 7:04 PM, Anton Makeev
<Anton.Makeev at jetbrains.com> wrote:
>> Another item of note is that CMake does not know the compile flags as a
>> sequential container of individual flags currently, but it knows them as a
>> string (that's also why it appears as a string in my generated json
>> currently).
>
> The problem with the following format:
> ---
> "include_directories" : ["/foo", "/opt"]
> "compile_definitions" : ["DEF=\"Foo\"", "OTHER_DEF=1"]
> "compile_flags": [ "-c" ]
>> Is that it’s incomplete and cannot be used directly:
> * include directories list misses compiler-defined search paths
> * quote include directories are not distinguishable
> * compiler definition do not include compiler-defined(built-in) definitions
> etc.
>
> That is, to have the complete list of include directories and compiler definitions, the IDE will have to call the compiler anyways.
> And here is where it will need the actual compiler’s command line.

Oh, yes, we do need the path to the compiler to be run, too.

I think we can combine the include_directories, compile definitions
and flags ourselves though when that is needed for us to run the
compiler. I do not see the need to have the full command line that
would be run for each and every file, which is how I read "full
compiler command line".

> Should we had the full list of include directories (split into groups like: <>, quote, and frameworks) and the list of all compiler defines, we would not need the compiler command-line at all.

We need the compiler binary anyway:-)

Best Regards,
Tobias


More information about the cmake-developers mailing list