[CMake] CMake finds the wrong Python interpreter on Windows

Hendrik Sattler post at hendrik-sattler.de
Fri Feb 26 03:17:44 EST 2010


Zitat von Bill Hoffman <bill.hoffman at kitware.com>:

> Noel O'Boyle wrote:
>
>>
>> Done. I've attached the result (off list). In summary it seems to be
>> searching for python2.6.exe first, instead of python.exe.
>>
>
> OK, so that is the problem....
>
> It looks for names in this order:
>
> NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python2.1
> python2.0 python1.6 python1.5 python
>
>
> It will prefer python2.6 over python in the PATH, and it has no way of
> knowing or caring if one is cygwin or not.  I don't think there is much
> we can do about this.
>
> I should have noticed this:
> C:/Python26/python.exe
> C:/Cygwin/bin/python2.5.exe
>
>
> I suppose one fix could be to to have the windows one prefer python
> over any of the named version ones...

Or find both independently and compare their versions. OTOH, the  
problem was the library/executable mismatch, so it doesn't matter  
which is found as long as the library matches the executable.

HS






More information about the CMake mailing list