Skip to content

A minimal C++ project generator. One command, ready-to-build project

License

Notifications You must be signed in to change notification settings

arferreira/smith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smith

This project was created while I was looking for an easy way to start a minimal project in C++, inspired by cargo new. Smith allows you to generate a ready-to-build C++ project with a single command, including src/, include/, tests/, CMakeLists.txt, and README.md.

Features

  • Generates a minimal C++ project structure.
  • Automatically replaces placeholders with your project name.
  • Includes a basic main.cpp and test file.
  • Ready-to-build with CMake out of the box.
  • Self-contained: no external templates required.

Installation

Compile the smith executable:

g++ -std=c++17 -o smith src/main.cpp

(Optional) Move it to a location in your PATH to use globally:

sudo mv smith /usr/local/bin/

Usage

Generate a new project:

smith MyProject

This will create:

MyProject/
 ├─ src/
 │   └─ main.cpp
 ├─ include/
 ├─ tests/
 │   └─ test.cpp
 ├─ CMakeLists.txt
 └─ README.md

Compile and run your project:

cd MyProject/build
cmake ..
cmake --build .
./MyProject

Contributing

Smith is open source! Feel free to:

  • Add new templates
  • Improve the project structure
  • Add optional flags (C++ standard, tests, README, etc.)

Please open an issue or pull request if you have ideas or improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A minimal C++ project generator. One command, ready-to-build project

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •