- A compiler with C++11 support
- Pip 10+ or CMake >= 3.4 (or 3.14+ on Windows, which was the first version to support VS 2019)
- Ninja or Pip 10+
Just clone this repository and pip install. Note the --recursive option which is
needed for the pybind11 submodule:
pip install ./cmake_example
With the setup.py file included in this example, the pip install command will
invoke CMake and build the pybind11 module as specified in CMakeLists.txt.
pip install setuptools wheel python setup.py bdist_wheel
Documentation for the example project is generated using Sphinx. Sphinx has the ability to automatically inspect the signatures and documentation strings in the extension module to generate beautiful documentation in a variety formats. The following command generates HTML-based reference documentation; for other formats please refer to the Sphinx manual:
cd cmake_example/docsmake html
import cmake_example cmake_example.add(1, 2)