Repository navigation
python-template-cpp
Public template
About
A Python/C++ project template
python-project-templates.github.io/python-template-cpp/
Topics
cmake cpp cpp-template cpp-templates project-template project-templates pybind11 python python-binding python-cpp python-template python-templates
Resources
Readme
Apache-2.0 license
Code of conduct
Code of conduct
Activity
Custom properties
Stars
7 stars
Watchers
2 watching
Forks
1 fork
Report repository
Branches
Tags
Go to Branches page Go to Tags page
Latest commit
History
177 Commits
View commit history for this file.
Folders and files
Repository files navigation
python template cpp
A C++-Python project template
Overview
C ABI
cpp/python-template-cpp builds libpython_template_cpp, a C ABI over the C++ code, declared in
python_template_cpp/include/python_template_cpp/python_template_cpp.h. Wheels ship the library under python_template_cpp/lib and
the header under python_template_cpp/include/python_template_cpp, and the Python extension in cpp/python links
against the library. The tests compile a C program against the installed package. Other
projects build against the installed wheel with python_template_cpp.get_include(),
get_library_dirs(), get_libraries(), and get_prefix().
HATCH_CPP_LIBRARY_SOURCE chooses where the library comes from at build time:
bundled (the default, for wheels), external (a prebuilt library found
through HATCH_CPP_LIBRARY_ROOT, pkg-config, or the conda prefix), or direct
(compile the library sources into the extension).
cpp/CMakeLists.txt builds and installs the library without Python, with a CMake
package config and a pkg-config file, for conda, vcpkg, and system packages:
cmake -S cpp -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build --prefix /path/to/prefix
Note
This library was generated using copier from the Base Python Project Template repository .
About
A Python/C++ project template
python-project-templates.github.io/python-template-cpp/
Topics
cmake cpp cpp-template cpp-templates project-template project-templates pybind11 python python-binding python-cpp python-template python-templates
Resources
Readme
Apache-2.0 license
Code of conduct
Code of conduct
Activity
Custom properties
Stars
7 stars
Watchers
2 watching
Forks
1 fork
Report repository
Used by
Contributors
Languages