[cmake-developers] Extracting target metadata, IDE integration

Aleix Pol aleixpol at kde.org
Mon Sep 22 19:15:40 EDT 2014


On Fri, Sep 19, 2014 at 7:44 PM, Brad King <brad.king at kitware.com> wrote:

> On 09/18/2014 08:10 PM, Aleix Pol wrote:
> > I added a CMAKE_OUTPUT_PROJECT_TARGETS variable that can be used to
> > enable the generation of the file.
> > I also renamed the file to ProjectTargets.json.
> >
> > http://www.proli.net/meu/kdevelop/cmake-targetsdata.patch
>
> Thanks.  I made some style updates and converted it to a patch
> generated with 'git format-patch'.  See attached.  I also
> attached a sample ProjectTargets.json generated for the "COnly"
> test from our test suite.
>
Cool! Thanks a lot for taking your time to look into this!


>
> I'd really like to hear from others on the file format itself.
>
> Some comments on the format:
>
> * A version number field is needed at the top.
>
Sure, can't hurt.
So you'd encapsulate it such as:
{
version: "1.0",
targets: [...]
}


>
> * There needs to be support for multi-config generators.
>   Perhaps everything that can be affected by the configuration
>   needs to be inside a list that enumerates all configurations.
>   In single-configuration generators the list would have only
>   one entry for the CMAKE_BUILD_TYPE.  In multi-configuration
>   generators it would be all of the CMAKE_CONFIGURATION_TYPES.
>
I've never worked with those, but it sounds like it would make sense. What
about:

{
version: ..
configurations: {
{ name: "Debug", targets: [...] },
{ name: "Release", targets: [...] }
}
}


>
> * Don't IDEs want to know the list of source files so they can
>   be used for editing?
>
It would probably make sense, yes. We can introduce an input field.


>
> I haven't looked at what the Extra generators produce in a
> while but since they are meant for IDEs they would be a good
> reference for the information needed.  However, AFAIK there
> is not an extra generator for a multi-config generator.
>
> -Brad
>

Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140923/bc82b9a1/attachment-0002.html>


More information about the cmake-developers mailing list