python/c++ - Compiling shared library with cmake and installing with distutils python/c++ - Compiling shared library with cmake and installing with distutils python python

python/c++ - Compiling shared library with cmake and installing with distutils


In the end I followed the answer here and overrode the build_ext command. As I want the build to be cross platform, and since the shared library lies inside the module source tree, I import the module shared library add use the file property to get the path to the shared library from setup.py.


scikit-build is a custom implemenation of setup that replaces distutils.core.Extension and uses cmake to compile the sources. A variety of sample projects can be found here. In the case you're using Pybind11, there is another simple example of usage here.