pybind11 cmake and more

for the past few days I’ve re-looked at the c++ project I’ve been working on since January. After failing to build a stepper module from scratch, I’m reverting back to using a mix of cpp and python.

I am going to use the pybind11 wrapper to build the relevant py module file so that I can load the module inside of python.

Tomorrow I will mess about with the setup.py so that I can build my own package for distribution…maybe use devops packages via azure. Maybe I could set it up there to deploy my code privately.

We’ll see… how this goes.

By the end of next week I should be able to get the c++ drivers for the 3D scanner running and put the python stepper module together so that it can 1) step each degree, then 2) scan a full 360 3) save the data in a file somewhere or in memory so that I can work with it to create my .e57 file.

The code below is my final cmakeFile so that I can configure the find_package via vcpkg of pybind11. This will then help me generate the module that I need for my scanner. Worst case I’ll have to call the scanner via command line…which is not ideal if this module doesn’t work.

cmake_minimum_required(VERSION 3.16)
project(pybindtest)
# I can use the find_package so that it includes the built pybind11 ready for development
find_package(pybind11 CONFIG REQUIRED)
pybind11_add_module(cmake_example src/main.cpp)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.