Skip to main content

Easily batch-build cmake projects!

cmany is a command line tool to easily build variations of a CMake C/C++ project. It combines different compilers, cmake build types, bundles of compilation flags, processor architectures and operating systems. Each of these items can also have associated compilation flags.

For example, to configure and build a project combining clang++ and g++ with both Debug and Release:

$ cmany build -c clang++,g++ -t Debug,Release path/to/CMakeLists.txt

The command above will result in four different build trees, placed by default under a build subdirectory in the current working directory:

$ ls build/*
build/linux-x86_64-clang++3.9-Debug
build/linux-x86_64-clang++3.9-Release
build/linux-x86_64-gcc++6.1-Debug
build/linux-x86_64-gcc++6.1-Release

Each build tree is obtained by first configuring the project with the items in each combination, and then invoking cmake --build to build the project at once.

You can also use cmany just to simplify your cmake workflow! These two command sequences have the same effect (b is an alias to build):

typical cmake

cmany

$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
$ cmany b

Features

  • Easily configures and builds many variations of your project with one simple command.

  • Saves the tedious and error-prone work of dealing with many build trees by hand.

  • Sensible defaults: cmany build will create and build a single project using CMake’s defaults.

  • Transparently pass flags (compiler flags, processor defines or cmake cache variables) to any or all of the builds.

  • Useful for build comparison and benchmarking. You can easily setup bundles of flags, aka variants.

  • Useful for validating and unit-testing your project with different compilers and flags.

  • Useful for creating distributions of your project.

  • Avoids a full rebuild when the build type is changed. Although this feature already exists in multi-configuration cmake generators like Visual Studio, it is missing from mono-configuration generators like Unix Makefiles.

  • Runs arbitrary commands in every build tree or install tree.

  • Full control over how the build items are combined.

More info

Support

Current status

cmany is in alpha state, under current development.

Limitations & Known issues

  • cmany invokes the compilers given to it to find their name and version. So far, this successfully works with Visual Studio, gcc (also with arm-linux and mips-linux counterparts), clang, icc and zapcc. However, the current implementation for guessing the name and version is fragile and may fail in some compilers which were not tested. Please submit a bug or PR if you see such a failure.

  • Though cmany works in OS X with gcc and clang, using Xcode has not been tested at all. Get in touch if you are interested in getting cmany to work with Xcode.

  • Pure C projects (ie not C++) should work but have not yet been tested. Some bugs may be present.

License

cmany is permissively licensed under the MIT license.

Copyright (c) 2016, Joao Paulo Magalhaes <dev@jpmag.me>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for cmany 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmany 0.1.4
File Size Uploaded
cmany-0.1.4.tar.gz 117.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cmany 0.1.4
File Interpreter ABI Platform
cmany-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 235.3 kB

Release files / cmany-0.1.4.tar.gz

Download URL cmany-0.1.4.tar.gz
Size 117.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f08050086d7856fff06c606c8c9214c5e807b41f93e23307617106bfdf7986fb
BLAKE2b-256 checksum
How to use checksums
11a1a6c6414c420128eafc11bb83acd0d8ec8dfc0eb7357f5d2180302ad97f8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release files / cmany-0.1.4-py3-none-any.whl

Download URL cmany-0.1.4-py3-none-any.whl
Size 118.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6397ca08815b31d1e84ab4224bbb85ef33a2c724faa75db21fd0975914de3df1
BLAKE2b-256 checksum
How to use checksums
3a95af7a5b47305732f03bb94a496bd884fbd9b571798b0010a93e93224c0833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0.post4

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page