ITADN

buildgen: a tool for generating scikit-build-core recipes

#1207Openshakfu 创建于 2026-01-14
S
shakfucommented
[buildgen](https://github.com/shakfu/buildgen) is a build system generator package supporting Makefile, CMake, and scikit-build-core project definitions. Basically, I wrote this tool because I kept wanting to use `scikit-build-core` with `uv` when building python extensions and a cmake backend and makefile frontend for c/c++ projects. It is pip installable via `pip install buildgen` ([pypi-project](https://pypi.org/project/buildgen/)), and it allows you to do the following: ```sh # Create a C++ project with cmake build-backend and Makefile frontend. buildgen new myapp # Create a Python extension with pybind11 using scikit-build-core and uv buildgen new myext -r py/pybind11 # List available recipes buildgen list ``` It has the following features: - **Makefile Generation**: Programmatic Makefile creation with variables, pattern rules, conditionals - **CMake Generation**: Full CMakeLists.txt generation with find_package, FetchContent, install rules - **Cross-Generator**: Define project recipes once in JSON/YAML, generate build systems - **CMake Frontend**: Use CMake as build system with convenient Makefile frontend - **Project Templates**: Quick-start templates for common project types - **scikit-build-core Templates**: Python extension project scaffolding (pybind11, cython, nanobind, C) - **Template Customization**: Override templates per-project, per-user, or via environment variable (Mako syntax) - **Configurable Project Recipes**: 2-step JSON/YAML recipes which include options and which are `rendered` to generate the project infrastructure. - **Full recipe testing**: all recipes are generated, built and tested using pytest.
4 条评论