[CMake] XML CMake ?

Jorgen Bodde solidstl at xs4all.nl
Mon Feb 28 10:20:39 EST 2005


Hi,

>  From a user standpoint I vastly prefer CMake syntax over XML. CMake 
> syntax is human readable, and XML is human readable but not pleasant to 
> read.

That's a matter of taste ofcourse. I never claimed CMake's syntax was
worse then XML, I only opened up a discussion to see how others would
feel about it. Like I said, there are tons of XML parsers out there, and
my original statement was that it would open up the road for GUI config
tools (like istool). I would consider making an XML based GUI tool that
would make life easier and contribute something that way to the CMake
community, but with the current language, no. I would not do that.

Problems with CMAKE syntax when parsing are:
1. You loose a lot of formatting when re-generating the code, with XML
it is pretty well defined.
2. The CMake syntax is harder to parse with respect to XML that already
gives you a tree which you can use and extract data elements from

Personally I have been working with ANT and WANT and Bakefile for a
while, all XML flavor build tools. And my general opinion is, the
learning curve is less steep because XML is already a known factor. My
first hassle with CMake was that it was a language unknown to me,
although I came to learn that most of the CMake syntax is easy once
you're at it.

> engineering your application code, and little time engineering your 
> build system. Config and build problems are very relevant to 
> maintainability.

I agree. But the more complex a grammar gets, the more ways there are to
do things. When that happens, people choose the easy and often
unreadable way of doing things. For example C++ is both elegant and a
curse when it comes to readability based on how long the developer
spends on formatting. With XML there aren't that many possibilities

> built-up culture of applications for it.  That's great, as far as it 
> goes, but if you're afraid of writing a parser, in my arrogant opinion, 
> you're not a real programmer.

I wrote my share of parsers already, I am familiar with the techniques
and possibilities. :-) XML is however the most common, readable, most
transparent and widely available. So from a time / logical point of
view, that would be the most logic choice.

But, I have the feeling I am getting flamed over something that was
merely a question out of interest like; "would it be nice if ..." or
"what do others think about it" .. If this didn't really came through as
I meant it that's because I don't have a native English tongue.

If CMake has no plans for XML, that is fine by me. Sometimes it takes
one person to get a new feature started when others only think it would
be nice. If I take the blame (and flame) for asking this, so be it.
Can't hurt to ask, right ??

> That last bit is meant to be humorous, if that doesn't come through.
> I've sworn off emoticons for Lent.

I am glad you mentioned it, or I would have 'parsed' it correctly, but
interpreted it wrong ;-)

- Jorgen



More information about the CMake mailing list