[cmake-developers] FindPython.cmake alternative for FindPythonInterp.cmake and FindPythonLibs.cmake

Mark Moll mmoll at rice.edu
Mon Jun 29 21:41:29 EDT 2015


I have attached an alternative module that replaces the two current modules for finding python-related info. With the current modules it is easy to end up in a situation where the interpreter’s version and the library version do not match, which inevitably leads to problems. My version fixes that and defines a number of other useful things:
- PYTHON_SITE_MODULES: the directory where python modules should be installed.
- Various PYTHON_VERSION_* variables.
- A find_python_module macro, so that you can do something like "find_python_module(numpy REQUIRED)”

If you call "cmake -DPYTHON_EXEC=/my/own/python”, you can be sure that everything else is defined appropriately. It is harder to do that with the current Python modules. I have been using this module for a while for my own project, but perhaps it is useful for inclusion with cmake. Let me know if there’s any interest in this.

Best,
Mark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: FindPython.cmake
Type: application/octet-stream
Size: 7952 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150629/9d3f3c2a/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150629/9d3f3c2a/attachment-0001.sig>


More information about the cmake-developers mailing list