A test project using pybind11 and CMake
Project description
make python_build_all_in_linux
cmake_example for pybind11
CI | status |
---|---|
MSVC 2015 | |
conda.recipe | |
pip builds | |
cibuildwheel |
An example pybind11 module built with a
CMake-based build system. This is useful for C++ codebases that have an
existing CMake project structure. This is in many cases superseded by
scikit_build_example
, which uses
scikit-build, a tool from the makers of CMake designed to allow Python
packages to be driven from CMake. However, there are still cases where you
might want full control over the CMake run; and both of these approaches have
some trade-offs not present in a pure setuptools build (see
python_example
). Python 3.6+ required;
see the commit history for older versions of Python.
Prerequisites
- A compiler with C++11 support
- Pip 10+ or CMake >= 3.4 (or 3.8+ on Windows, which was the first version to support VS 2015)
- Ninja or Pip 10+
Installation
Just clone this repository and pip install. Note the --recursive
option which is
needed for the pybind11 submodule:
git clone --recursive https://github.com/pybind/cmake_example.git
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
.
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
License
Pybind11 is provided under a BSD-style license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.
Test call
import cmake_example
cmake_example.add(1, 2)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for cubao_cmake_example-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79b35f34b3d37aff0c1dc545c488a451707046bce3f5d8b3b31e07c2170621d0 |
|
MD5 | 1f9221060813ada374c035ff9bae54f7 |
|
BLAKE2b-256 | 9abef8299207c949c11ec0b5089806bac728f6de046a76d6c6900c3946e5ed02 |
Hashes for cubao_cmake_example-0.0.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a64f234aa8802c64836910bac300f5174c123dc08f0ea878f3a99ca89ede663 |
|
MD5 | 40fe80933186768a730764c6ae3bcc06 |
|
BLAKE2b-256 | 641223a9bc3bcb31d6a8d660b356f291955be686d790cea5afa8db656d1f0467 |
Hashes for cubao_cmake_example-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e991eb46b905597cdb8de694802c05a16dfed00c04158050292e2413d43eb47d |
|
MD5 | b09508d9347cf8b43ddda7a53dae61de |
|
BLAKE2b-256 | 6e3f0c028f56d6bbe2845864810313968cc80ff82ce4fda9e708f5d09ae1f408 |
Hashes for cubao_cmake_example-0.0.1-cp310-cp310-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4e6bd7888c3d0678ffb48c5e0c47653bd7213dc7193a814446311a1c77350b |
|
MD5 | d717b0e3fad3ac921a381d1eeaf643b4 |
|
BLAKE2b-256 | 99f318cc13187d9ce969bfae8e30d6347a427b295cf31270dcbf09b83ec9ef81 |
Hashes for cubao_cmake_example-0.0.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83f399fb183e020a6a406e118fba0ef95549c305711b1c46aab8eae6f5117b2d |
|
MD5 | b947aa25f3db33922feaf50212de7f60 |
|
BLAKE2b-256 | 79481216d01f2f8657f6efded4d867d9d3569ff1001893c9ca26db2166151f7b |
Hashes for cubao_cmake_example-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c0e9de8f7cc135c49c8bca09a8ef65c8dbd5984d88db708d095bf7291f2ad96 |
|
MD5 | a4553f2005c0350cdf5fc5b788a56921 |
|
BLAKE2b-256 | effef50e302a874c564808032b98e4aafde451f69578c31e1464ad31be0c969a |
Hashes for cubao_cmake_example-0.0.1-cp39-cp39-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b442f7a557610edb6f3bf2a2363a46246b864cc5a2b4d51c8d328a787a3257f |
|
MD5 | 7a7e5948c525c5e51b5585706f4dfed4 |
|
BLAKE2b-256 | cde5d2a92649fa02ea530e99cc224b9706caebffd2c5fd3b2a08441e097c66a3 |
Hashes for cubao_cmake_example-0.0.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cd6f937748f8971b8b14df5e9f7d84a550e67b2e6c8eee20bfa1c3286c34173 |
|
MD5 | ee57e6c554f501e53be0e4665294b466 |
|
BLAKE2b-256 | ab860e679a7b6f162816b7b6b86886a5929193d4de964a43614f147c5c8b9e8e |
Hashes for cubao_cmake_example-0.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d38de79bdc1c62be1ed3d4ea5a7bcc0074d492ad6030930494fd77256e3e345f |
|
MD5 | 70dacd1d3ab534b5fbd9461bd27b1bde |
|
BLAKE2b-256 | f0ba3671065af894ee3d7541de647ce42f6d8b22629c0a13b53c63779a6156c7 |
Hashes for cubao_cmake_example-0.0.1-cp38-cp38-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b99d4320227fd04d0e7d72b7e331edc47b1b87298ad685a0a9b532a3abc1e9b6 |
|
MD5 | 27611a8d542437d5594503a940fe2828 |
|
BLAKE2b-256 | 68629a1c0ca69f9d676f94af572189719704d6ed750ed6f17e192bc24452730e |
Hashes for cubao_cmake_example-0.0.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb66b4528a10e1419db3f74b12b8331660e19e5d89fd958b25d368b6d830ae6 |
|
MD5 | af58a228a01c8c27677c31fd60665af5 |
|
BLAKE2b-256 | 3fbf955cbbdb7bbf5cf62f8dd65d0467cdb435b141695aa65016a3e9a70bfdf5 |
Hashes for cubao_cmake_example-0.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10d7b4d8c4253a1c9b1609b0750bbf1262576421a4fb0b4dd4a099d749856109 |
|
MD5 | e5537604ec9d23fbc83c18352b72bc32 |
|
BLAKE2b-256 | cdeb35044c11604163357b4090b33e2257c7fde3d2742210281f577d76422276 |
Hashes for cubao_cmake_example-0.0.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c784f976c08981fb6d9c515d16fad8427a493bbf11eaa12762f6cf9d93a35833 |
|
MD5 | d606a913546a0f468a44eeabcb1c2832 |
|
BLAKE2b-256 | 14c081ae78e6f52f14d02aeae4546b66b26c9655877194b921090a97d41adfde |
Hashes for cubao_cmake_example-0.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ba13d1ed34070a2cce7f054919174e58a424443eca1da7dae82e8e0edfa61b5 |
|
MD5 | 141229d9013a934b60eb33e1a2556a4a |
|
BLAKE2b-256 | 00fc2169b5367aadb41fb45d3dad7f52d54ebc56679b95094cc54e94adbdd459 |