[CMake] escaping!

Brandon Van Every bvanevery at gmail.com
Mon Dec 10 20:19:07 EST 2007


On Dec 10, 2007 7:12 PM, Andrew Roark <andrewjroark at yahoo.com> 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.

>This has the added advantage of being cross-platform as well, keeping
the CMakeLists.txt file simpler.

I'm quite jaded about keeping CMakeLists.txt "simple."  As far as I'm
concerned, it should be as simple as the level of complication of your
build.  If I want encapsulation, I write a macro.  Otherwise I'll just
write straight CMake script, because I'd rather read CMake script than
the docs of 5 different Unixy tools that all do their own kind of
regular expression processing.


Cheers,
Brandon Van Every


More information about the CMake mailing list