[CMake] Python version specification in FindPythonInterp is ignored

Ateljevich, Eli eli at water.ca.gov
Tue Jun 26 14:55:10 EDT 2012


This would be great, at least it would improve my experience in two ways: 
1) it would make sure that the library and interpreter are compatible and 
2) it would make the library automatically locatable. 

I agree I can use CMAKE_PREFIX_PATH to solve my immediate problem, though.




________________________________________
From: cmake-bounces at cmake.org [cmake-bounces at cmake.org] On Behalf Of Rolf Eike Beer [eike at sf-mail.de]
Sent: Tuesday, June 26, 2012 10:18 AM
To: cmake at cmake.org
Subject: Re: [CMake] Python version specification in FindPythonInterp is ignored

> Actually, clearing the cache worked for FindPythonInterp but I still can't
> get FindPythonLibs.cmake to work. Same problem .... it can find the 2.4
> version but not the 2.7 version - and gives an error when 2.7 is required.
> Obviously, I cleared the cache this time. Again, is there a hint I can
> give to help it find the version I want?

You already got an answer regarding CMAKE_PREFIX_PATH which should fix
most of your issue.

But I wonder if we should import what the current FindPythonLibs.cmake
from kdelibs does: ask the found python interpreter for it's library first
and use that if available. In most cases I assume that you want to get a
python library that matches your default python interpreter (or a
specified one). So doing find_package(PythonLibs 3.2) would search for
python3.2, then ask it for the library and then fall back to the usual
searching.

I don't do any python stuff, I just cleaned up all the version number
stuff in there and argue with the Gentoo CMake maintainers because they
keep adding stuff that breaks the version selection later. From what I was
able to get out of them the above should fit their needs too (even if they
were not able until today to specify what they would see as the "right"
behavior of this at all).

This is certainly nothing for 2.8.9, but something that I would do shortly
after to get maximum testing until 2.8.10. Opinions?

Eike
--

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


More information about the CMake mailing list