kdev-python: finding the required Python library version via CMake

René J.V. Bertin rjvbertin at gmail.com
Wed Jun 24 21:28:15 BST 2015


On Wednesday June 24 2015 21:19:21 René J.V. Bertin wrote:

An answer from another ML:

> Part of the problem is that there is no way to force the default CMake modules for finding an python interpreter and python libraries to agree on the same version. As a way around that I wrote my own FindPython.cmake:
> 
> https://bitbucket.org/ompl/ompl/src/tip/CMakeModules/FindPython.cmake
> 
> You can then specify a specific version:
> 
> 	find_package(python 3.4)
> 
> This will define PYTHON_EXEC, PYTHON_LIBRARIES, PYTHON_INCLUDE_DIRS, PYTHON_SITE_MODULES, and PYTHON_VERSION. If you run cmake like so:
> 
> 	cmake -DPYTHON_EXEC=/opt/local/bin/python3.4 ..
> 
> then the other variables are automatically defined appropriately.
> 
> You can also use it to find python modules:
> 
> 	find_python_module(numpy [version] [REQUIRED|QUIET])
> 
> Best,
> Mark

Worth checking out for kdev-python?

R.



More information about the KDevelop mailing list