POSIX regex support (was: Re: [CMake] Any suggestions for packaging a bizillion subprojects?)

Pau Garcia i Quiles pgquiles at elpauer.org
Fri Aug 10 15:11:23 EDT 2007


Quoting Brandon Van Every <bvanevery at gmail.com>:

> On 8/10/07, Christian Convey <christian.convey at gmail.com> wrote:
>>
>> What I'm trying to avoid is having to go into all 70 of those
>> subdirectories and modifying each of those 70 CMakeLists.txt files,
>> adding an INSTALL command to each file.
>
> Why avoid that?  You could just write some regex replaces in CMake
> script and make a fairly trivial job out of it.  Or use some other
> language you know with regex support, like Ruby.  But for some reason
> I think it's cool to use CMake script to modify CMake stuff.
>
> CMake's regex had some bugs and limitations.  ^ and $ are broken with
> respect to multi-line input, see bug #5380.  So you end up doing a lot
> of \n and (\r?\n) stuff.  Matches are greedy, there's no non-greedy
> matching available, which makes some problems difficult.  I've got
> code to work around that if you're interested though.
>
> If I already knew Ruby I would have used that, but I didn't.  Ruby
> looks like it's got the best regex support, in languages more modern
> than Perl.  Python implements regexes externally, not as convenient.

I took a quick look a few weeks ago and replacing the current regex  
library with PCRE seems "easy" (most of the work would be replacing  
the regexp's in current .cmake files with their POSIX equivalents). Is  
Kitware or anyone else already working on that?

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)


More information about the CMake mailing list