Skip to content

Latest commit

 

History

History
54 lines (33 loc) · 1.24 KB

README.md

File metadata and controls

54 lines (33 loc) · 1.24 KB

cmake_example for pybind11

Prerequisites

  • 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+

Installation

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.

build wsl file

pip install setuptools wheel

python setup.py bdist_wheel

Building the documentation

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/docs
  • make html

Test call

import cmake_example
cmake_example.add(1, 2)