Yngve Inntjore Levinsen wrote: > On 21. mars 2013 12:00, Rolf Eike Beer wrote: > > Am 21.03.2013 11:03, schrieb Yngve Inntjore Levinsen: > >> Hi, > >> > >> I have a suggestion for the PythonInterp. On a system I am compiling my > >> code on, I need to find the python binary which is newer than 2.5. > >> However, the default /usr/bin/python is 2.4. > >> > >> If I then set the variable (which is not documented in the header by the > >> way) PythonInterp_FIND_VERSION to 2.5, it will first search for the > >> > >> following list of binary names: > >> python2.5 python2 python. > > > > This looks like you are using CMake 2.8.7 or before. Upgrade.
> cmake --version > cmake version 2.8.10.2 > > Have a look at line 64 and 79 of FindPythonInterp.cmake. If e.g. > PythonInterp_FIND_VERSION is set to 2.5, then _Python_NAMES in line 64 > is equal to "python2.5;python2;python" It then finds python2 or python. > Since PYTHON_EXECUTABLE then is found in line 79, it does not check the > other versions (2.6 and 2.7). Or? Oh, you are right. It takes the other versions only into account after doing a first find attempt. This is because it tries to pick up the systems default python for a given major first, e.g. whatever you have configured for python 2.x. But what it doesn't do is drop and search more if that is a too old version. Patches welcome. Eike --
signature.asc
Description: This is a digitally signed message part.
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake