DEV Community

Jariullah Safi
Jariullah Safi

Posted on


pybind11-cmake: Straightforward boilerplate generation for pybind11 + cmake

pybind11 is great for making python wrappers of C++ code and I use it all the time. In most cases I need to work with a cmake file so I start the project off using their cmake example. This usually involves copying the CMakeExtension / Builder class to my file and adding pybind11 to my project as a git submodule. I could do without cmake in simpler projects as shown in the python_example but I find it difficult to use for more complicated projects.

So I made a boilerplate generator ( that also encapsulates the extension module and provides a script to generate all the files you would need to get started with a project. This allows you to work on a pybind11 project purely in a virtualenv using cmake (no need to make a git submodule).

I've already simplified my existing projects with this and hope it is useful to others as well.

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesnโ€™t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.