MantisBT - CMake
View Issue Details
0008788CMakeModulespublic2009-03-25 01:152012-07-09 06:53
Haoyu Bai 
Rolf Eike Beer 
normalfeatureN/A
closedfixed 
CMake-2-6 
CMake 2.8.8CMake 2.8.8 
0008788: Python 3 support
The current FindPythonLibs.cmake and FindPythonInterp.cmake only find Python version up to 2.6. So how about Python 3?

In my opinion, to support Python 3 should not mean to just simply add "3.0" to the version search list. Currently Python 3 is installed as an alternative Python in most system, and extension module author may want to build and test on both Python 2 and 3. So it is feasible to have a Python 3 edition of every PYTHON_* variables, eg. PYTHON3_LIBRARY and PYTHON3_INCLUDE_PATH.

Any thoughts? If you argee this, I may try to produce a patch for CMake.

Thanks!
No tags attached.
Issue History
2009-03-25 01:15Haoyu BaiNew Issue
2009-07-18 02:05Philip LowmanNote Added: 0016905
2009-07-18 02:05Philip LowmanStatusnew => assigned
2009-07-18 02:05Philip LowmanAssigned To => Philip Lowman
2009-08-12 22:46Philip LowmanSeverityminor => feature
2009-08-12 22:46Philip LowmanReproducibilityalways => N/A
2009-08-29 21:38Philip LowmanNote Added: 0017236
2009-08-29 21:38Philip LowmanAssigned ToPhilip Lowman =>
2009-08-29 21:38Philip LowmanStatusassigned => new
2009-09-11 17:27Bill HoffmanStatusnew => assigned
2009-09-11 17:27Bill HoffmanAssigned To => Philip Lowman
2011-01-18 13:28David ColeAssigned ToPhilip Lowman => Marcus D. Hanwell
2011-01-18 13:28David ColeNote Added: 0024889
2012-02-21 15:51Rolf Eike BeerNote Added: 0028690
2012-02-21 15:51Rolf Eike BeerAssigned ToMarcus D. Hanwell => Rolf Eike Beer
2012-02-21 15:51Rolf Eike BeerStatusassigned => resolved
2012-02-21 15:51Rolf Eike BeerResolutionopen => fixed
2012-02-21 15:51Rolf Eike BeerFixed in Version => CMake 2.8.8
2012-02-21 15:51Rolf Eike BeerTarget Version => CMake 2.8.8
2012-07-09 06:53David ColeNote Added: 0029983
2012-07-09 06:53David ColeStatusresolved => closed

Notes
(0016905)
Philip Lowman   
2009-07-18 02:05   
Hello,

Good idea. I will volunteer to check-in and support a FindPython3Libs.cmake and FindPython3Interp.cmake if you will code them up and test them on your distro. Or you're welcome to follow the standard procedures for obtaining CMake module commit access (see below) and maintain them yourself if you'd like (I encourage this if you have the time).

As part of this effort I would expect that as much code as possible between FindPython3Libs and FindPythonLibs be shared in a separate .cmake file (via functions).

It may also be advantageous to clear up any confusion, to put the code for the 2.x python in FindPython2Libs/FindPython2Interp just for clarity and simply have one line include() directives in the existing FindPythonLibs/FindPythonInterp files.

http://www.cmake.org/pipermail/cmake/2007-July/015258.html [^]
(0017236)
Philip Lowman   
2009-08-29 21:38   
As an alternative to the above (as discussed on the mailing list) someone could modify FindPythonLibs/FindPythonInterp to be version aware and then make an assumption that if 3.0 isn't specified in the version field that only 2.x will be searched for (and document this).

I don't have time at the moment to write such a patch so I'm orphaning this feature request in case anyone else wants to work on it.
(0024889)
David Cole   
2011-01-18 13:28   
Marcus,

Is this covered by your recent python changes...?
(0028690)
Rolf Eike Beer   
2012-02-21 15:51   
This is now fixed for both FindPythonInterp.cmake and FindPythonLibs.cmake.

Something like

find_package(PythonInterp 3)
find_package(PythonLibs 3.1)

Will give you any python3 binary and a python library of at least 3.1.
(0029983)
David Cole   
2012-07-09 06:53   
Closing resolved issues that have not been updated in more than 4 months.