Last Meeting ("Programming Red Flags") Summary + What's Next forTelFOSS?
Shlomi Fish
shlomif at iglu.org.il
Tue Jul 7 13:38:55 IDT 2009
On Monday 06 July 2009 20:33:33 Dov Grobgeld wrote:
> I just reread the article Why the KDE project switched from scons to
> CMake<http://lwn.net/Articles/188693/>and compared it to my needs:
>
Well, Offer was also referring to some threads on the KDE mailing lists (which
I haven't read either).
> - Support compilation over a fixed number of platforms: Linux, Linux
> cross compilation for Windows, Windows mingw, Windows MS compiler,
CMake supports all of those except perhaps Linux-cross-compile-for-Windows
which I'm not sure about. It may exist or may not, but I'm not sure. CMake can
also generate proper Microsoft Developer Studio projects.
> Solaris. - Complete control over compiler flags for different platforms for
> release and debug mode.
CMake gives you that. I was able to override the C_FLAGS variable, etc.
> - No need to run "configure" since the code either relies on the cross
> platform glib infrastructure or ifdef's.
I don't understand that point.
> - A number of autogenerated h- and c-files through either perl or python
> scripts.
>
You can easily use custom commands or invoke external executables or scripts
with CMake. Naturally, this would mean the people building your program will
need to have perl, python or whatever installed, but it's probably not a deal
breaker.
> The last of these options is probably the reason I dropped CMake from my
> consideration list. E.g. the following code that I have in my scons files
> is difficult to translate:
>
> def file2c(env, target, source):
> out = open(str(target[0]), "wb")
> inp = open(str(source[0]), "rb")
>
> for line in inp.readlines():
> line = line.rstrip()
> line = re.sub("\\\\", "\\\\", line)
> line = re.sub("\\\"", "\\\"", line)
> line = '"'+line+'\\n"\n'
> out.write(line)
>
> out.close()
> inp.close()
>
You can put this in a script and call it from CMake or create a custom target
for it. You may also opt to write it in pure-CMake, but it's not absolutely
necessary.
Regards,
Shlomi Fish
> env.Command("menu-top-xml.i",
> "menu-top.xml",
> file2c)
>
> I.e. the dependency is resolved through a python function that is defined
> within the "makefile". I think that scons is the only system that kind of
> code. Whether it is sane is a different question...
>
> Regards,
> Dov
>
> 2009/7/6 Offer Kaye <offer.kaye at gmail.com>
>
> > 2009/7/6 Dov Grobgeld :
> > > I have switched to scons a couple of years back and couldn't be
> > > happier.
> >
> > I read some of the threads of the KDE developers detailing how/why the
> > moved from Autotools to CMake. It seems at first that actually SCons
> > was the preferred contender, but when they looked into it more deeply
> > they ran into trouble - apparently it was not mature enough and lacked
> > all the features required for a project of the size and complexity of
> > KDE4.
> >
> > Still it's probably good enough for less complex projects :)
> >
> > --
> > Offer Kaye
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
"Humanity" - Parody of Modern Life - http://xrl.us/bkeut
God gave us two eyes and ten fingers so we will type five times as much as we
read.
More information about the Linux-il
mailing list