[CMake] improve the CMake language?

Brandon Van Every bvanevery at gmail.com
Fri Nov 2 12:10:07 EDT 2007


On Nov 2, 2007 9:04 AM, Gonzalo Garramuño <ggarra at advancedsl.com.ar> wrote:
> Brandon Van Every wrote:
> >
> > My concern is that if the status quo is maintained, CMake script will
> > always be ugly to program with.
>
> Yes.  No doubt about that.  It is already uglier to program with than
> most modern scripting languages.
> Personally I think you need to see cmake as what it is: a tool to create
> makefiles.  Not a scripting language.

But I think this is the wrong idea from a marketing standpoint.
Programmers are programmers.  They don't care what they're
programming.  If you tell 'em to "suck it up," they don't wanna hear
it.  They'll just go use something that's more pleasant to work with,
if it exists somewhere.  And if it doesn't, they'll write it!  I don't
see any inherent reason why Makefile programming has to be tons uglier
than "regular" programming.  It's just the historical accident of
where the implementation is at.  Sooner or later, someone's going to
decide that Makefile programming doesn't have to suck.  Then that
Makefile language is going to become popular.  It could be CMake, with
a little planning.

> If you are doing lots of file,
> regex or string manipulation... alarms should be going off.  You should
> probably write that as a small tool in ruby, perl or python and have
> cmake just call the command.

Yes I probably should have written my (Autoconf + GMake) --> CMake
translator in Ruby.  But I didn't know Ruby and I did know CMake
script.  I wanted to see how far I could get with CMake regexes and
macro constructions, and I found out.  You know, frankly, I could get
a lot farther with some pretty basic language improvements.  Like a
better regex engine, macro string passing that doesn't mess up the
escapes, and lexical scoping.  I don't need "fancy dynamic" scripting
stuff to scale up CMake quite a bit more.  Currently my code is 3
macros deep.

>  > I'm not just talking about SCons and so forth.
>
> python scons, ruby's rake and jam are (currently) cmake's closest
> contenders.

Don't forget Ant.  As far as I'm concerned, a "CMake contender" is any
build system that is very popular and can supplant the jobs that CMake
does.

> > we'll write our own
> > custom build system in our favorite scripting language.  It happens in
> > the game industry all the time.
> >
>
> Does it?  I work in a related industry and I never heard of such.  Only
> very large companies can afford that kind of luxury.

Game developers are an extremely immature lot.  They will write new
build systems and new scripting languages because they can.  Meaning,
because they've fooled someone into paying them to do it.  The game
developer postmortems are filled with stories of "we made this
scripting language, it did things X Y Z for us, but it took forever
and we really suffered from tools immaturity."  Yet the industry keeps
doing it over and over again.  You could say that basically it's an
industry of technical ferment.  I hang out on the sweng-gamedev
mailing list, and I'm forever hearing about guys who think a
cross-platform build system is hacking Visual Studio .sln files to
export values to other platforms.  They'll drive everything from
Visual Studio or some such.  Scripting language gurus are a real
threat to software stability.  They're getting paid, and like a
standing army they're gonna find a way to get used.

> That being said, the gaming industry is also mostly oriented towards one
> or two platforms, so the need for a comprehensive multiplatform system
> like cmake is also probably overkill.

The mainstream game industry is oriented towards Windows, Sony
Playstation3, Nintendo Wii, and XBox360.  They need comprehensive
cross-platform build systems and it appears that none exist yet.  So
it is with an eye towards stalking them that I ask these questions.
I'd like to get paid to do things related to game industry concerns,
seeing as how I'm an indie game developer.  Rather than the orthogonal
"open source pays my bills" stuff I'm currently doing.

Mainstream game titles often have multi-million $ budgets and teams of
100 people working on them.  Granted, the bulk of those are artists.
Asset management systems are a big deal in the game industry.


Cheers,
Brandon Van Every


More information about the CMake mailing list