This guide gets you from a fresh clone to a working build with demos and tests. It targets contributors and developers who want to build imgui_bundle from source.
Prerequisites¶
| Tool | Version | Notes |
|---|---|---|
| git | any recent | With submodule support |
| CMake | >= 3.18 | |
| C++ compiler | C++17 | GCC 9+, Clang 10+, MSVC 2019+, or Apple Clang 12+ |
| Python | >= 3.8 | Only needed if building Python bindings |
| just | any | Optional but recommended — task runner for common commands (brew install just / cargo install just) |
Linux only: install libglfw3-dev (or pass -DHELLOIMGUI_DOWNLOAD_GLFW_IF_NEEDED=ON).
Clone & init submodules¶
git clone --recursive https://github.com/pthom/imgui_bundle.git
cd imgui_bundleIf you already cloned without --recursive:
git submodule update --init --recursiveSubmodules are auto-cloned during CMake configure by default (via IMGUI_BUNDLE_AUTO_CLONE_SUBMODULES=ON), so this step is often optional.
Quick build: C++ only (desktop)¶
mkdir -p builds/my_build && cd builds/my_build
cmake ../.. --preset default
cmake --build . -jThis builds with GLFW + OpenGL3 (the default). Run the demos:
./demo_imgui_bundle # Main demo showcasing all librariesQuick build: Python bindings¶
# Create a venv
python -m venv venv && source venv/bin/activate
pip install -r requirements-dev.txt # numpy, pytest, mypy, etc.
# Build
mkdir -p builds/my_python && cd builds/my_python
cmake ../.. --preset python_bindings -DPython_EXECUTABLE=$(which python)
cmake --build . -jThen set your PYTHONPATH to include the build output, and run:
cd ../..
python bindings/imgui_bundle/demos_python/demo_imgui_bundle.pyAlternative: editable pip install¶
For a development workflow where changes are picked up without rebuilding manually:
pip install -v -e .This uses scikit-build-core under the hood and takes longer the first time.
Build with ImmVision (OpenCV)¶
ImmVision works without OpenCV (using ImageBuffer / numpy arrays). To also enable cv::Mat interop:
cmake ../.. --preset python_bindings \
-DPython_EXECUTABLE=$(which python) \
-DIMMVISION_FETCH_OPENCV=ONThis fetches and builds a minimal OpenCV in the build directory. See OpenCV builds for immvision for platform-specific details.
Run the tests¶
# From the repo root
just test_pytest # Run pytest
just test_mypy # Run mypy type checking on bindingsOr without just:
pytest
cd bindings && ./mypy_bindings.shSee Testing for details on GUI tests and CI.
Build the docs¶
just doc_serve_interactive # Live-reload dev server
# or
just doc_build_static # Static HTML build
just doc_serve_static # Serve the static build on port 7005Useful justfile commands¶
Run just (no arguments) to see all available commands. Key groups:
| Command | What it does |
|---|---|
just libs_info | Show all external libraries with their remotes and branches |
just libs_bindings <name> | Regenerate Python bindings for one library |
just libs_bindings_all | Regenerate all Python bindings |
just libs_check_upstream | Check which fork libraries have new upstream changes |
just test_pytest | Run pytest |
just test_mypy | Run mypy on bindings |
just doc_serve_interactive | Build & serve docs with live reload |
See Build Guide for the full command reference.
What next?¶
| I want to... | See |
|---|---|
| Understand the folder layout | Repository structure |
| Learn about the build system & CMake options | Build guide |
| Understand how bindings are generated | Bindings introduction |
| Update an existing library’s bindings | Update bindings |
| Add a new C++ library to the bundle | Add new library |
| Debug native C++ code from Python | Debug bindings |
| Run and write tests | Testing |
| Deploy to PyPI | PyPI deployment |
| Build with OpenCV / ImmVision | OpenCV build guide |