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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cpp-projects-manager-cli-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 252cc95a45a2c77703ecf7e49dfd4234c53ce759fbb09da99c0d883b9d846f87 |
|
MD5 | 9a6d57923c2c5140f0a470ab2ff21b4d |
|
BLAKE2b-256 | 9377e104010f5d3c2c5dc9317175fc3e3aeb40b4d0fe1a03cc4fcea232571359 |
Close
Hashes for cpp_projects_manager_cli-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8840eec73e84bd9c9456190a7b414d2a0e87131f3723c5135b3ddb0b328e8dc |
|
MD5 | f20e52e1bcc5f38f24d8c9ea31c02311 |
|
BLAKE2b-256 | 097b0dc9c242f04f8816c6223683cbc2c9982ffef981d97be82718fc587c6bdc |