[CMake] escaping!

Andrew Roark andrewjroark at yahoo.com
Thu Dec 20 16:25:06 EST 2007


> On Dec 10, 2007 7:12 PM, Andrew Roark  wrote:
> >
> > For any tricky file operations (like "all files ending with
> XML
> 
 greater than 2Kb using DOS newlines" etc) I would personally write a
> python
> 
 script (e.g. ROOTDIR/util/xmlfinder.py) to do that work and make
> the
> 
 command simply invoke the python script.
> 
> I simply learned how to do everything in CMake script.  File input /
> output and regular expressions are certainly quite doable, there's no
> reason to use Python for that.  Or Perl, Ruby, grep, awk, or sed for
> that matter.  Lately I've written a lot of translation code to get rid
> of those tools.

By all means, if it can be done in CMake, then do it in CMake.

But the CMake philosophy itself is in dispute with your argument.

CMake doesn't do any building of its own; it uses an external tool (make, or studio, or whatever target) to do the building.

CMake doesn't do any compiling or assembling or linking - ultimately make will call gcc or CC or whatever to do that.

Its simply a matter of "right tool for the job". If you can do it in CMake, then great. But one thing I abhor is the notion of "pure" software development - developers love the distorted notion of "purity" meaning in this case "do EVERYTHING in CMake". Why?  If I want to build a tar file using a virtual tree structure  with fake symlinks and README content that I generate on the fly not from real files, then CMake simply AFAIK can't do it. So I use another tool.

In any case my earlier point still remains:

> > I never saw a Windows system with an installed Python. Strange isn't
> > it ;)
> 
> I see -- you're using one of those Windows systems that
> comes pre-installed with CMake?...

Pragmatic programmers know to use the right tool for the job.

Andrew




      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



More information about the CMake mailing list