Brad King wrote: > On 1/17/2012 1:50 PM, Rolf Eike Beer wrote: > > Today a user was in #cmake that had a system default python that was > > some 3.x version, and therefore /usr/bin/python was a symlink to > > /usr/bin/python3. The current module has no possiblity for a developer > > to specify that FindPythonInterp should search for python2 first. So I > > wrote the attached patch which allow the developer to say that a > > python2 or python3 major version should be preferred. > > > > This is actually a bit hacky, but nevertheless "works for him"(tm). > > [snip] > > > +# You may specify either PYTHONINTERP_PREFER_PYTHON2 or > > +# PYTHONINTERP_PREFER_PYTHON3 to tell the module to probe for a > > specific +# python major version first. > > Can this use the version argument to find_package? If a project's > python code works only with 2 or only with 3 why bother even looking > for other versions?
No, it can not. This argument gives either a minimum version, or an exact version. This way it is impossible to specify that any 2.x version would match. It would be enough for 3.x versions, but for that this module has to be fixed to actually find 3.x versions at all. Currently it would only find them by accident if /usr/bin/python points to one. 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers