[CMake] Behaviour of FindPythonInterp appears suboptimal

Rolf Eike Beer eike at sf-mail.de
Fri Aug 22 06:48:15 EDT 2014


Roger Leigh wrote:
> I thought using FindPythonInterp would be more portable than
> simply invoking "python" directly (i.e. using $PYTHON_EXECUTABLE).
> However, this does not appear to be the case.  I'd be interested to
> know if this is intentional or if I'm doing something wrong.
> 
> I've tried using "find_package(PythonInterp 2.6.0 REQUIRED)" on a
> variety of systems.  The software in question works with any
> python 2.6 or 2.7 version.
> 
> On Debian, with the default python 2.7 installed, it picked up
> python 2.6.8 (from python2.6-minimal) which lacked all the
> required modules.  /usr/bin/python was 2.7 and matched the
> version requirement, and had all the required modules
> available.

In case you want the newest version of any Python major, as in your case, try 
find_package(PythonInterp 2 REQUIRED). But you are right, this would also 
successfully return you a 2.5.

Greetings,

Eike
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140822/9a9d9afd/attachment.sig>


More information about the CMake mailing list