[CMake] Parsing XML from CMAke

Martin Guillon MGuillon at movea.com
Tue Sep 29 11:17:04 EDT 2009


Those configuration files are read by perl scripts and CMake scripts. IN them we store 3rd parties info live version, local path, include path relative ...
So I need to find a syntax easy enough for CMake to parse it but complex enough too.

Currently I use ini files, and so for a third party, in order to create a section for it I would have to create sections prefixes like:
[3RD - QT]
VERSION=4.5.1
PATH=...
INCLUDE=include

That would work but I find it quite "heavy", that s why I was thinking about XML

-----Message d'origine-----
De : Tyler Roscoe [mailto:tyler at cryptio.net] 
Envoyé : Tuesday, September 29, 2009 4:58 PM
À : Martin Guillon
Cc : cmake at cmake.org
Objet : Re: [CMake] Parsing XML from CMAke

On Tue, Sep 29, 2009 at 11:10:29AM +0200, Martin Guillon wrote:
> IN our project we currently use ini file for configuration and so i read them from CMake.
> I am thinking about using XML because it allows me a lot more things.
> SO i was wondering if i could parse XML files from CMake ?

What kind of configuration are you reading from these ini files with
CMake?

AFAIK CMake has no native xml support. You could probably hack something
together but if you're reading CMake configuration data, I would store
that in a format that is as friendly as possible for CMake. Thus, I
would choose to use a CMake script. Something like:

set (var1 "value1")
set (var2 "value2")
...

It's really the same as XML, just with different syntax :).

tyler


More information about the CMake mailing list