Skip to main content

A CLI helper tool for managing C++ projects

Project description

CppM

A CLI helper tool for easy management of C++ project, inspired on npm workflow.

The intent of this project is to provide an easy workflow for dealing with dependency and build management for C++ projects, so the main focus is easy usage, rather than full flexibility. The helper tool basically uses vcpkg and cmake under the hood, so you'll be able to structure and scale your project using these tools.

Requirements

In order to use this tool, you'll need to have git installed and accessible through command line, this is the only requirement. You don't need to have cmake installed, since the CppM tool leverages a Vcpkg's local cmake installation to build the project as well.

Installation

In order to install CppM on your system, you can use pip:

pip install cppm

How to use it

Generally, the CppM commands have this form:

cppm <command> <args>

The currently supported commands for CppM are:

  • new: Creates a starter project on the specified directory;
  • init: Initializes a starter project in the current folder;
  • add: Adds a third party package on the project using vcpkg;
  • install: Installs the currently added packages;
  • build: Builds the project;

The projects created by CppM follows this default structure:

Project
|-- src
    |-- main.cpp
| -- CMakeLists.txt
| -- vcpkg.json
| -- README.md
| -- .gitignore

new

  • Required argument: project path;

Usage:

cppm new <pathToNewProject>

e.g:

cppm new my-project

init

  • Optional argument: --project-name

Usage:

cppm init

This will create a starter project with name "new-project" in the current folder

Also, this command supports the user to specify a project name to be used instead of the default "new-project":

cppm init --project_name <your-project-name>

add

  • Required arguments: a list of the vcpkg dependencies to add in the project

Usage:

cppm add <vcpkg-libs>

For a reference on the available C++ libs on vcpkg you might look at https://vcpkg.io/en/packages?query= Also, the add command itself doesn't install the packages right away, it just add them to vcpkg.json. In order to properly install the packages, you need then to use the install command.

install

Usage:

cppm install

Installs the packages currently specified on vcpkg.json

build

  • Optional argument: -o, --output_dir
  • Optional argument: --cmake_args

Usage:

cppm build

You're able to specify another build folder, rather than "build" as well:

cppm build --output_dir <build_folder_name>

Finally, you can also forward CMake specific args to the build command:

cppm build --cmake_args -DCMAKE_BUILD_TYPE=RelWithDebInfo

Example

Supposing a project where we'll use the 7zip and abseil libraries, a typical setup would be:

cppm new my-project
cd my-project
cppm add 7zip abseil
cppm install
cppm build

Aside from doing these commands, you would also need to add the proper find_package and target_link_libraries calls on your CMake. Ususally these two calls get outputted by vcpkg during installation, so it's mostly a matter of copying the calls to your CMakeLists.txt

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

cppm-0.1.5.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

cppm-0.1.5-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file cppm-0.1.5.tar.gz.

File metadata

  • Download URL: cppm-0.1.5.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.4 Linux/6.8.0-71-generic

File hashes

Hashes for cppm-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f5c78b1dd26f15b761a2986ba0e549736bc999a4be8119fb05dab89cf58b1241
MD5 6b4f78d3ec9158f41007d8252e58f24c
BLAKE2b-256 96f38165ee36a1b03ee9d80657d2e0104ade8fafe50acdee97eae2013221a58b

See more details on using hashes here.

File details

Details for the file cppm-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: cppm-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.4 Linux/6.8.0-71-generic

File hashes

Hashes for cppm-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8d90884d2fb3ed4b5dde08c7f513932e0b7f4fd43c6c0d2170c9e05c530a2c2f
MD5 d5773e54ba77b5c6793a2a33c6629647
BLAKE2b-256 947e8a2c1b80bd3a56d280d4b2d674a54bea63a8e700c13140b05cf4da10a3ea

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