[cmake-developers] Alternative Config.cmake format (was: Installing Qt5Config.cmake from the Qt repo?)

Alexander Neundorf neundorf at kde.org
Tue Nov 1 13:20:50 EDT 2011


On Tuesday 01 November 2011, Brad King wrote:
> On 10/31/2011 5:20 PM, Alexander Neundorf wrote:
> > Not sure what the other cmake developers would think about supporting an
> > additional file format for the Config.cmake files, e.g. xml or json, so
> > they could be easily used and generated also by other tools. I.e. not
> > only by/for cmake, but basically a standard format for installed
> > libraries to provide information about themselves.
> > 
> > Something like:
> > <libs>
> > 
> >    <lib>
> >    
> >       <name>QtCore</name>
> >       <configs>debug;release</configs>
> >       <location config="debug">/usr/lib/libQtCore.so</location>
> >       <include>/usr/include/QtCore</include>
> >       ...
> >    
> >    </lib>
> > 
> > </libs>
> 
> I've thought about that a few times.  This kind of format is hard to define
> generally without lots of use cases.  I suggest that you design a prototype
> for such a format that is sufficient for Qt's needs.  Write a
> Qt5Config.cmake that comes with Qt5 and *parses* the Qt5Config.xml file
> itself and sets the proper variables as CMake code expects.  Then you can
> tweak and refine it without being delayed by CMake's release schedule
> since the parser comes with the format.  After it has matured and perhaps
> a few other projects have picked it up we can consider adding first-class
> support for it in CMake.

Hmm, ok.

Would you prefer XML, JSON or something else ?

When you write "Qt5Config.cmake that comes with Qt5 and *parses* the 
Qt5Config.xml file itself" do you mean to file(READ ...) then xml file in the 
Config.cmake file and then do a lot of regexp matching on the xml, or do you 
have a better idea ?

Alex



More information about the cmake-developers mailing list