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

Brad King brad.king at kitware.com
Tue Nov 1 13:14:48 EDT 2011


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.

-Brad



More information about the cmake-developers mailing list