Package: cubao-cmake-example
Usagepython3-mpipinstallcubao_cmake_example# install from pypipython3-c'import cubao_cmake_example; print(cubao_cmake_example.add(1, 2))'python3-mcubao_cmake_exampleadd12python3-mcubao_cmake_examplesubtract94$python3-mcubao_cmake_examplepure_python_func--help
INFO:Showinghelpwiththecommand'__main__.py pure_python_func -- --help'.

NAME__main__.pypure_python_func

SYNOPSIS__main__.pypure_python_func<flags>

FLAGS--arg1=ARG1Type:intDefault:42--arg2=ARG2Type:floatDefault:3.14--arg3=ARG3Type:strDefault:'you shall not pass'$python3-mcubao_cmake_examplepure_python_func--arg1=43234int:43234,float:3.14,str:youshallnotpassSee more examples atcubao, e.g.:pybind11-rdp: C++ implementation
of the Ramer-Douglas-Peucker algorithm (binding to python via pybind11)concave_hull:  A very fast 2D concave hull algorithm, for pythonMake a releaseOn linuxInstall docker thenmake python_build_all_in_linux
make upload_wheelsOn macOSInstall c++ compiler and cmake.Install conda and envs:# conda create -y -n py36 python=3.6
# conda create -y -n py37 python=3.7
conda create -y -n py38 python=3.8
conda create -y -n py39 python=3.9
conda create -y -n py310 python=3.10
conda env listThenmake python_build_all_in_macos
make upload_wheelsOn windowsInstall visual studio and cmake, (also git for windows, maybe).Install conda and envs same as on macOS, then:make python_build_all_in_windows
make upload_wheelscmake_example for pybind11CIstatusMSVC 2015conda.recipepip buildscibuildwheelAn examplepybind11module 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 byscikit_build_example, which usesscikit-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 (seepython_example). Python 3.6+ required;
see the commit history for older versions of Python.PrerequisitesA compiler with C++11 supportPip 10+ or CMake >= 3.4 (or 3.8+ on Windows, which was the first version to support VS 2015)Ninja or Pip 10+InstallationJust clone this repository and pip install. Note the--recursiveoption which is
needed for the pybind11 submodule:gitclone--recursivehttps://github.com/pybind/cmake_example.git
pipinstall./cmake_exampleWith thesetup.pyfile included in this example, thepip installcommand will
invoke CMake and build the pybind11 module as specified inCMakeLists.txt.Building the documentationDocumentation 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 htmlLicensePybind11 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 callimportcubao_cmake_examplecubao_cmake_example.add(1,2)