Skip to content

shajeen/template-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Template Maker

Python PyPI License: GPL v3

A powerful CLI tool for generating CMake + Conan project templates for C++ applications and libraries.

Overview

Template Maker automates the creation of well-structured C++ projects with modern build systems. It generates complete project scaffolding including CMake configuration, Conan dependency management, and proper directory structure for both applications and libraries.

Key Features

  • πŸš€ Quick Setup: Generate complete C++ project structure in seconds
  • πŸ“¦ Conan Integration: Built-in support for modern C++ dependency management
  • πŸ—οΈ CMake Ready: Pre-configured CMake files for immediate development
  • πŸ“ Dual Modes: Support for both application and library project types
  • πŸ§ͺ Test Framework: Includes test structure and configuration
  • ⚑ Zero Configuration: Works out of the box with sensible defaults

Installation

From PyPI (Recommended)

pip install template-maker

From Source

pip install git+https://github.com/shajeen/template-maker.git

Verify Installation

template-maker --help

Usage

Template Maker requires two arguments:

  • --name: Your project name
  • --ptype: Project type (0 for application, 1 for library)

Quick Start

Create a C++ Application

template-maker --name="my_awesome_app" --ptype=0

This generates:

out/my_awesome_app/
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ conanfile.txt
└── src/
    └── main.cpp

Create a C++ Library

template-maker --name="my_awesome_lib" --ptype=1

This generates:

out/my_awesome_lib/
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ app/                    # Example application
β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   └── src/
β”‚       └── main.cpp
β”œβ”€β”€ lib/                    # Library source
β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   β”œβ”€β”€ conanfile.py
β”‚   β”œβ”€β”€ include/
β”‚   β”‚   └── main.h
β”‚   └── src/
β”‚       └── main.cpp
└── test/                   # Test framework
    β”œβ”€β”€ CMakeLists.txt
    β”œβ”€β”€ conanfile.txt
    └── src/
        └── main.cpp

Project Types

Type Value Description
Application 0 Standalone executable project
Library 1 Reusable library with tests and example app

Building Generated Projects

After generation, navigate to the output directory and build:

cd out/your_project_name
mkdir build && cd build
conan install .. --build=missing
cmake ..
cmake --build .

Requirements

  • Python 3.6+
  • Git (for installation from source)

Examples

Application Project Structure

The generated application includes:

  • Modern CMake configuration
  • Conan dependency management
  • Source code organization
  • Build scripts ready for immediate use

Library Project Structure

The generated library includes:

  • Separate lib, app, and test directories
  • Header/source separation
  • Conan package configuration
  • Example application demonstrating library usage
  • Test framework setup

Roadmap

  • Support for additional build systems (Meson, Bazel)
  • Template customization options
  • Integration with popular C++ frameworks
  • Docker support
  • CI/CD template generation

See the open issues for a list of proposed features and known issues.

Contributing

Contributions are welcome! Here's how you can help:

  1. Report Issues: Found a bug? Create an issue
  2. Suggest Features: Have an idea? Request a feature
  3. Submit Code:
    • Fork the repository
    • Create a feature branch
    • Make your changes with tests
    • Submit a pull request

Please read CONTRIBUTING.md for detailed contribution guidelines.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Support

Acknowledgments

  • The C++ community for continuous innovation
  • Conan team for excellent package management
  • CMake developers for the robust build system

About

CMake Conan template creator

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published