Skip to main content

A Python package for the creation of a CPM project.

Project description

CPM / C++ Project Manager.

CPM is a high-level Python Command Line Program.

Still in a buggy alpha state.

CPM using required

Python interpreter and Mingw g++/gcc complier

  python version 3.8 < 3.10

CPM Installation

Install cpm with pip

  pip install cpp-projects-manager-cli

create c++ project with CPM

  python -m cpm init <project-name> <directory> !directory is Optional
     _____   _____    __  __ 
    / ____| |  __ \  |  \/  |
   | |      | |__) | | \  / |
   | |      |  ___/  | |\/| |
   | |____  | |      | |  | |
    \_____| |_|      |_|  |_|
   
          welcome to cpm
   
project author: example  
project description: demo              
project entry point(main.cpp): 
successfully create your example project

cpm.json

{
    "name": "example",
    "version": "1.0.0",
    "author": "example",
    "description": "demo",
    "entry_point": "main.cpp"
}

run project

  python -m cpm run <c++-file-name> !Optional

How to add C++ App in project

First create c++ app

create app

  python -m cpm makeapp <app-name> <directory> !directory is Optional
  $~ python -m cpm makeapp test
  $~ successfully create your test app

app add in cpm.json

open cpm.json file in any text editor. and add c++ app

 {
  ....
  "apps": [
        {
            "name": "test"
        }
    ]
 }

again run your project with app

  $~ > python -m cpm run
  [ build ] --- test --- [ D:\......\test.a ] 0.174ms
  combine compile main.cpp
  compile successfully. 0.617ms
  Hello World!

Run new terminal

  $~ > python -m cpm run --new-terminal
  [ build ] --- test --- [ D:\......\test.a ] 0.174ms
  combine compile main.cpp
  compile successfully. 0.617ms
  Hello World!

Custom Command

make folder and file on current work dir:

|- extra_commands
|        |
|----- __init__.py
|----- commands
|           |
|--------- __init__.py
|--------- example.py
|- test
|- cpm.json
|- main.cpp

example.py

from cpm.core.base import BaseCommand

class Command(BaseCommand):
    """
    Example command
    """
    help = 'Example command'
    description = 'Example command'
    
    def add_arguments(self, parser):
        parser.add_argument('--example', action='store_true', help='Example argument')

    def handle(self, *args, **options):
        print('Example command', options)

check custom command

    $~ python -m cpm --help

    Type 'python -m cpm help <subcommand>' for help on a specific subcommand.

    Available subcommands:

    Commands:
       example                 Example command
       init                    Creates a c++ project.
       makeapp                 Creates a c++ app.
       run                     Runs c++ project.

run custom command

    $~ python -m cpm example
    Example command {'traceback': False, 'example': False}

Command help

$~ python -m cpm example --help
usage: __main__.py example [--example] [-h] [-v] [--traceback]

Example command

optional arguments:
  --example      Example argument
  -h, --help     show this help message and exit
  -v, --version  Show program's version number and exit.
  --traceback    Raise on CommandError exceptions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpp-projects-manager-cli-1.0.2.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cpp_projects_manager_cli-1.0.2-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file cpp-projects-manager-cli-1.0.2.tar.gz.

File metadata

  • Download URL: cpp-projects-manager-cli-1.0.2.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for cpp-projects-manager-cli-1.0.2.tar.gz
Algorithm Hash digest
SHA256 252cc95a45a2c77703ecf7e49dfd4234c53ce759fbb09da99c0d883b9d846f87
MD5 9a6d57923c2c5140f0a470ab2ff21b4d
BLAKE2b-256 9377e104010f5d3c2c5dc9317175fc3e3aeb40b4d0fe1a03cc4fcea232571359

See more details on using hashes here.

File details

Details for the file cpp_projects_manager_cli-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: cpp_projects_manager_cli-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for cpp_projects_manager_cli-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a8840eec73e84bd9c9456190a7b414d2a0e87131f3723c5135b3ddb0b328e8dc
MD5 f20e52e1bcc5f38f24d8c9ea31c02311
BLAKE2b-256 097b0dc9c242f04f8816c6223683cbc2c9982ffef981d97be82718fc587c6bdc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page