Search the web
Sign In
New User? Sign Up
hackers-il · Creative programming discussed
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: Last Meeting ("Programming Red Flags") Summary + What's Next for   Message List  
Reply | Forward Message #5055 of 5093 |
Re: Last Meeting ("Programming Red Flags") Summary + What's Next forTelFOSS?

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@...>
>
> > 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.



Tue Jul 7, 2009 10:38 am

shlomif3
Offline Offline
Send Email Send Email

Forward
Message #5055 of 5093 |
Expand Messages Author Sort by Date

... I would be interested in a separate presentation about SCons. Don't know about the other club attendees, but if you have the will and the time, then I say ...
Shlomi Fish
shlomif3
Offline Send Email
Jul 6, 2009
2:34 pm

... Well, Offer was also referring to some threads on the KDE mailing lists (which I haven't read either). ... CMake supports all of those except perhaps...
Shlomi Fish
shlomif3
Offline Send Email
Jul 7, 2009
10:47 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help