[CMake] How to install Python3 package?

Torsten Bronger bronger at physik.rwth-aachen.de
Sat May 23 06:24:11 EDT 2015


Hallöchen!

I have a very simple Python 3 package that I want to install in the
Python path with CMake.  For example on Ubuntu, I'd like to install
it in /usr/lib/python3/dist-packages.  Anyway, assuming the Python
module is in mypackage/mymodule.py, the lines

    from mypackage import mymodule

must work fine after the installation.  I could execute

    python3 -c "import site; print(site.getsitepackages()[0])"

and store the result in a CMake variable, but is this the way to go?

I have also found
http://bloerg.net/2012/11/10/cmake-and-distutils.html but it is
awkward IMO.

Tschö,
Torsten.

-- 
Torsten Bronger    Jabber ID: torsten.bronger at jabber.rwth-aachen.de



More information about the CMake mailing list