Skip to content

iamdavidson/cppgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp-gen

A desktop GUI for scaffolding modern C++/CMake and ROS2 Jazzy projects in seconds.

Built with Python 3 and PySide6. No web framework, no Electron — just a fast native Qt app.


Features

  • Two project types — standard C++/CMake and ROS2 Jazzy (ament_cmake)
  • Live preview — CMakeLists.txt, package.xml, and README update as you type
  • Dependency manager — categorised package tree with one-click add/remove
  • Dynamic executable list — add any number of named targets with per-target options
  • Library configuration — STATIC / SHARED / INTERFACE, CMake package export, ament exports
  • Extras — .gitignore, .clang-format, .clang-tidy, .editorconfig, GitHub Actions, Dockerfile, GoogleTest stubs
  • VS Code integration — settings / tasks / launch.json; always builds in Release mode
  • Preset system — 4 built-in presets, save/load custom presets as JSON
  • Git init — optional git init + initial commit after generation

Requirements

  • Python ≥ 3.10
  • PySide6 ≥ 6.4

Installation

Recommended — pipx (isolated, no system pollution)

pipx install git+https://github.com/<your-org>/cpp-gen.git

or from a local clone:

git clone https://github.com/<your-org>/cpp-gen.git
cd cpp-gen
pipx install .

Alternative — pip

pip install git+https://github.com/<your-org>/cpp-gen.git
# or
pip install -e .   # editable / development install

Usage

cpp-gen

That's it. The GUI opens immediately.

Keyboard shortcuts

Shortcut Action
Ctrl+N Reset to defaults
Ctrl+O Load preset
Ctrl+S Save preset
Ctrl+Enter Generate project
Ctrl+Q Quit

Typical workflow

  1. Project tab — set name, choose Normal C++ or ROS2 Jazzy, pick license and C++ standard
  2. Dependencies tab — double-click packages from the suggestion tree or type custom names
  3. Executables tab — click + Add Executable for each binary target
  4. Library tab — choose SHARED / STATIC / INTERFACE; enable CMake package export if needed
  5. Extras tab — enable .clang-format, GitHub Actions, tests, etc.
  6. Preview tab — verify the generated CMakeLists.txt and file tree
  7. Click ▶ Generate Project

Built-in presets

Preset Description
Minimal C++ Library + one executable, no dependencies
C++ + Eigen / OpenCV Adds Eigen3, OpenCV, fmt, spdlog, .clang-format
ROS2 Minimal Node rclcpp + std_msgs, launch + config files
ROS2 Robotics Full sensor/geometry/tf2/PCL/Eigen stack

Generated project — build instructions

Normal C++:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

ROS2 Jazzy (from your workspace root):

colcon build --packages-select <name> --cmake-args -DCMAKE_BUILD_TYPE=Release
source install/setup.bash
ros2 run <name> <executable>

Project layout

cpp-gen/
├── run.py                   # convenience launcher (python run.py)
├── requirements.txt
├── pyproject.toml
└── src/cpp_project_generator/
    ├── main.py
    ├── gui/
    │   ├── main_window.py   # main window, toolbar, preset handling
    │   ├── project_tab.py
    │   ├── deps_tab.py
    │   ├── executables_tab.py
    │   ├── library_tab.py
    │   ├── extras_tab.py
    │   └── preview_tab.py   # live preview + CMake syntax highlighting
    ├── generator/
    │   ├── models.py               # dataclasses + JSON serialisation
    │   ├── cmake_generator.py      # CMakeLists.txt (CPP + ROS2)
    │   ├── package_xml_generator.py
    │   ├── source_generator.py     # placeholder C++ files
    │   ├── vscode_generator.py
    │   ├── readme_generator.py
    │   ├── extras_generator.py     # gitignore, license, CI, …
    │   └── file_writer.py          # orchestrates all generators
    └── presets/
        ├── cpp_minimal.json
        ├── cpp_opencv_eigen.json
        ├── ros2_minimal.json
        └── ros2_robotics.json

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Open a pull request — please keep commits focused and add tests for new generator logic

License

MIT — see LICENSE.

About

A desktop GUI for scaffolding modern C++/CMake and ROS2 Jazzy projects in seconds.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages