cargo-newcpp 0.5.43

A cargo plugin for creating new C++ projects.
Documentation
cargo-newcpp-0.5.43 has been yanked.

cargo newcpp

This tool extends Cargo to allow for the creation of new C++ projects in the spirit of cargo new <project>

cargo install cargo-newcpp

Ensure that you have a fairly recent version of rust/cargo installed. On Ubuntu you might also want to install cmake and gcc or g++ so that you can actually build project.

Recommended prereqs

If you'd like to kick the tires on the build feature (cargo buildcpp) you will want the following installed

sudo apt install gcc, g++, ninja-build, build-essential, cmake

Create a new project

Create a new CPP project with the following command.

cargo newcpp <your_project_name>

This will output to the following default project scaffolding.

scaffolding

Building the CPP project with cargo

Once you've create the project, you can use the following example to build the project.

cd <your_project_name> 
cargo buildcpp [--debug | --release]

By default, buildcpp will place cmake buildtree artifacts into the target/debug folder. Specifying the --release flag will generate the buildtree artifacts in target/release

Cleaning the CPP project with cargo-cleancpp

This is functionally equivilant to "rm -rf target/". I struggled with whether or not I should do something more idiomatic to modern cmake (e.g. cmake --build <target> -t clean or cmake --fresh ...) but these did not feel right and chose to default to what ```cargo clean`` does instead.

cargo cleancpp