[CMake] CMake finds the wrong Python interpreter on Windows

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Feb 26 03:29:08 EST 2010


On Fri, Feb 26, 2010 at 9:17 AM, Hendrik Sattler
<post at hendrik-sattler.de> wrote:
> 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.

+1
There is an old bug report for cmake for this. PythonLibs should be
derived from a python -c"..." (see bug #2257)

Cheers
-- 
Mathieu


More information about the CMake mailing list