Skip to main content

Make C++ a piece of cake.

Project description

Make C++ a piece of cake.

Build status Documentation status Latest PyPI version Python versions supported

Cupcake is a thin layer over CMake and Conan that tries to offer a better user experience in the style of Yarn or Poetry.

Audience

To use this tool, your C++ project must fit a certain profile and follow some conventions. The profile is what I call a basic C++ project:

  • A name that is a valid C++ identifier.
  • Zero or more public dependencies. These may be runtime dependencies of the library or executables, or they may be build time dependencies of the public headers. Users must install the public dependencies when they install the project.
  • Some public headers nested under a directory named after the project.
  • One library, named after the project, that can be linked statically or dynamically (with no other options). The library depends on the public headers and the public dependencies.
  • Zero or more executables that depend on the public headers, the library, and the public dependencies.
  • Zero or more private dependencies. These are often test frameworks. Developers working on the library expect them to be installed, but users of the library do not.
  • Zero or more tests that depend on the public headers, the library, the public dependencies, and the private dependencies.

The conventions are popular in the community and seem to be considered best practices:

  • The project is built and installed with CMake [1].
  • The project uses semantic versioning.
  • The project installs itself relative to a prefix. Public headers are installed in include/; static and dynamic libraries are installed in lib/; executables are installed in bin/.
  • The project installs a CMake package configuration file that exports a target for the library. The target is named after the project, and it is scoped within a namespace named after the project. Dependents link against that target with the same syntax whether it was installed with CMake or with Conan.

Commands

package

This abstracts the conan create ↗️ command. It:

  • Copies a Conan recipe for your project to your local Conan cache, a la conan export ↗️.

  • Builds the recipe for your current settings (CPU architecture, operating system, compiler) and the Release build type, a la conan install ↗️.

  • Configures and builds an example that depends on your project as a test of its packaging, a la conan test ↗️. That example must reside in the example/ directory of your project with a CMakeLists.txt that looks like this:

    add_executable(example example.cpp)
    target_link_libraries(example ${PROJECT_NAME}::${PROJECT_NAME})
    

Etymology

I love Make, but it’s just not cross-platform. Just about every other single letter prefix of “-ake” is taken, including the obvious candidate for C++ (but stolen by C#), Cake. From there, it’s a small step to Cppcake, which needs an easy pronunciation. “Cupcake” works. I prefer names to be spelled with an unambiguous pronunciation so that readers are not left confused, so I might as well name the tool Cupcake. A brief Google search appears to confirm the name is unclaimed in the C++ community.

[1]CMake likes to remind everyone that it is a build system generator, not a build system, but it is reaching a level of abstraction that lets us think of it as a cross-platform build system.

Project details


Download files

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

Files for cupcake, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size cupcake-0.0.4-py3-none-any.whl (11.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size cupcake-0.0.4.tar.gz (12.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page