Re: [CMake] Python version specification in FindPythonInterp is ignored

2012-06-26 Thread Ateljevich, Eli
Hi Andreas,
Thanks. This must be what is happening. The references I saw to 
CMAKE_PREFIX_PATH suggested it was environment-only and needs to be known at 
cmake time. That didn't fit my needs well and even though it seemed funny I 
never challenged that.

You are suggesting it can be set in cmake which I'll try. It would solve my 
issues, though my experience with customizing of this type is it needs to be 
done at the right moment in the cmake process which isn't always clear. Is 
there going to be a lot of extra stuff on CMAKE_PREFIX_PATH and I need to be 
appending?

Thanks!
Eli


From: Andreas Pakulat [ap...@gmx.de]
Sent: Monday, June 25, 2012 2:35 PM
To: Ateljevich, Eli
Cc: cmake@cmake.org
Subject: Re: [CMake] Python version specification in FindPythonInterp is ignored

Hi,

On Mon, Jun 25, 2012 at 11:20 PM, Ateljevich, Eli 
e...@water.ca.govmailto:e...@water.ca.gov wrote:
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?

Well, that depends on how the module actually finds stuff - unless it documents 
the ways in its 'header section' (which is also available in the cmake manual 
usually). Usually it would use find_path/find_library and may find_file, which 
all understand CMAKE_PREFIX_PATH as either cmake or environment variable and 
append the necessary include/lib etc. suffix.

Andreas
--

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


Re: [CMake] Python version specification in FindPythonInterp is ignored

2012-06-26 Thread Andreas Pakulat
Hi,

Am Dienstag, 26. Juni 2012 schrieb Ateljevich, Eli :

 Hi Andreas,
 Thanks. This must be what is happening. The references I saw to
 CMAKE_PREFIX_PATH suggested it was environment-only and needs to be known
 at cmake time. That didn't fit my needs well and even though it seemed
 funny I never challenged that.

 You are suggesting it can be set in cmake which I'll try. It would solve
 my issues, though my experience with customizing of this type is it needs
 to be done at the right moment in the cmake process which isn't always
 clear. Is there going to be a lot of extra stuff on CMAKE_PREFIX_PATH and I
 need to be appending?


Well, you just need to set it before the corresponding find_* calls,
usually this is supposed to be done on the cmake commandline via
-DCMAKE_PREFIX_PATH=... Since the actual path to be used is usually
user-specific and hence for everybody needing it.

Andreas
--

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

Re: [CMake] Python version specification in FindPythonInterp is ignored

2012-06-26 Thread Rolf Eike Beer
 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


Re: [CMake] Python version specification in FindPythonInterp is ignored

2012-06-26 Thread Ateljevich, Eli
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-boun...@cmake.org [cmake-boun...@cmake.org] On Behalf Of Rolf Eike 
Beer [e...@sf-mail.de]
Sent: Tuesday, June 26, 2012 10:18 AM
To: cmake@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 
--

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


Re: [CMake] Python version specification in FindPythonInterp is ignored

2012-06-25 Thread Ateljevich, Eli
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?

I am on linux, by the way. Most of what I see there seems to be for Windows. 
Any clues?

Eli

From: Ateljevich, Eli
Sent: Monday, June 25, 2012 1:54 PM
To: Ateljevich, Eli; cmake@cmake.org
Subject: RE: Python version specification in FindPythonInterp is ignored

Apologies to all. It worked OK after I blew away the cache.

From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Ateljevich, Eli
Sent: Monday, June 25, 2012 1:40 PM
To: cmake@cmake.org
Subject: [CMake] Python version specification in FindPythonInterp is ignored

Hi,
I am working with cmake 2.6 but have grabbed FindPythonInterp.cmake and its 
dependencies from 2.8.8. From what I can tell, this version is touted as having 
resolved most issues with specifying the python version.

Our OS has a python 2.4 called python installed in /usr/bin. There is another 
python 2.7 also called python we all load from the local module system. The 
2.7 version is ahead of the 2.4 on path ... I have verified that the command 
line which python gives the path to the 2.7 version.

FindPythonInterp seems to find the 2.4 version no matter what I write. If I 
write: find_package(PythonInterp 2.7 REQUIRED) cmake will realize this is wrong 
and indicate an error, but it doesn't keep looking. I am trying to come up to 
speed, but I can't quite make out from the script what hint I might need to 
supply for FindPythonInterp.cmake to find the 2.7 version.  Can anyone help me 
out?

Thanks,
Eli
--

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

Re: [CMake] Python version specification in FindPythonInterp is ignored

2012-06-25 Thread Andreas Pakulat
Hi,

On Mon, Jun 25, 2012 at 11:20 PM, Ateljevich, Eli e...@water.ca.gov wrote:

 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?


Well, that depends on how the module actually finds stuff - unless it
documents the ways in its 'header section' (which is also available in the
cmake manual usually). Usually it would use find_path/find_library and may
find_file, which all understand CMAKE_PREFIX_PATH as either cmake or
environment variable and append the necessary include/lib etc. suffix.

Andreas
--

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