[Cmake] Modules/FindPythonLibs.cmake : 8.4 + registry support

Sebastien BARRE sebastien at barre.nom.fr
Sat May 12 17:42:19 EDT 2001


Hi Ken

At 12/05/2001 15:31, Ken Martin wrote:

> > The specific value name is appended to the key name after the "§" char (I
> > modified the regexp accordingly to accept this char). Every suggestion is
> > welcome as a better separator : I tried ':', '|', '#', '$', sadly they
> > could all be found in some (or many) key name. "§" was not found
> > in any key
> > name of my registry (which is big).
>
>Can we pick a different character for this? US keyboards do not have that
>symbol so many of us will end up sitting around trying to figure out how to
>type it for hours.

Yes, sorry, that's exactly what I've been thinking about after commiting my 
changes :) this char was typically "french" :)

>Do you think any of ~ - ; * ^ would work for most cases?

~: more than 50 times in my registry, than I gave up
- : do not even think about it :)
; : sounds good, it was found only in the RealPlayer settings located in 
the registry, on very very strange keys (these RealPlayer keys seems to try 
very hard to use all the character set)
* : does not look good, because it is used to refer to something matching 
all extensions in the "File Association" settings,
^: found a couple of times, in very strange keys too (DiscJuggler)

OK, ';' and '^' looks good to me.

>Or maybe we could rework the logic so that when given
>
>HKEY_LOCAL_MACHINE\SOFTWARE\Scriptics\Tcl\8.4\Root
>
>it tries the entire "path" first and if that entry doesn't exist then it
>strips of the last value and uses it for the key.

Nice idea, but it's a bit dangerous, because you can actually have a key 
named :
HKEY_LOCAL_MACHINE\SOFTWARE\Scriptics\Tcl\8.4\Root
and a key named HKEY_LOCAL_MACHINE\SOFTWARE\Scriptics\Tcl\8.4 with a "Root" 
value.
I've just tested that both are possible simultaneously. This could lead to 
errors.

Let me know your decision.
';' looks fine to me :)

> > I do not know how your regexp engine works, but if it tries to match as
> > many chars as possible, this regexp will fail if *more* than one key is
> > used in the same string (eg. [HKEY stuff]foo/bar[KHEY stuff2] will return
> > only one match : [HKEY stuff]foo/bar[KHEY stuff2] instead of [HKEY stuff]
> > then [HKEY stuff2] ). The usual regexp trick is to disable this "greedy
> > mode" by using *? instead of *. I does not seem to be supported. Neither
> > does the \\[(HKEY[^\\]]*)\\] look to be supported. Any clues ?
>
>Instead of allowing all characters we should exclude [ and ] so that we
>don't have the problem of multiple keys. The regexp code will keep replacing
>keys until none are left, so as long as we exclude [ and ] your example
>above should work.

As said previously, I tried \\[(HKEY[^\\]]*)\\] and it was not working.  I 
do not know why.

Seb





More information about the CMake mailing list