Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cmake-common

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmake-common

Utilities to help develop C++/CMake projects

  • 4.0
  • PyPI
  • Socket score

Maintainers
1

cmake-common

Basic usage Boost (toolsets) Examples (toolsets)

Utilities to help develop C++/CMake projects.

Description

This main goal of this project is to make it easier to build (potentially, cross-compile) Boost and CMake projects using different toolsets. It does so providing a set of command-line utilities that allow users to download/build Boost & use it in a CMake project in a consistent way — no matter the compiler or the target platform.

Installation

  • Via PyPI:

    pip install cmake-common
    
  • As a submodule:

    git submodule add https://github.com/egor-tensin/cmake-common.git
    

    All the scripts provided by the PyPI package are thin wrappers around the project package modules:

    ScriptModule
    boost-downloadpython3 -m project.boost.download
    boost-buildpython3 -m project.boost.build
    project-buildpython3 -m project.build

Toolsets

Supported platform/build system/compiler combinations include, but are not limited to:

PlatformBuild systemCompiler
LinuxmakeClang
GCC
MinGW-w64
Windowsmake [1]Clang [2]
MinGW-w64
msbuildMSVC
CygwinmakeClang
GCC
MinGW-w64
  1. Both GNU make and MinGW mingw32-make.
  2. clang-cl is supported by Boost 1.69.0 or higher only.

All of those are verified continuously by the Boost (toolsets) and Examples (toolsets) workflows.

For a complete list of possible --toolset parameter values, pass the --help-toolsets flag to either boost-build or project-build.

Usage

Boost

Download & build the Boost libraries in a cross-platform way.

$ boost-download 1.72.0
...

$ boost-build -- boost_1_72_0/ --with-filesystem --with-program_options
...

Pass the --help flag to view detailed usage information.

CMake project

Build (and optionally, install) a CMake project.

$ project-build --configuration Release --install path/to/somewhere --boost path/to/boost -- examples/simple build/
...

$ ./path/to/somewhere/bin/foo
foo

Pass the --help flag to view detailed usage information.

common.cmake

Use in a project by putting

include(path/to/common.cmake)

in CMakeLists.txt.

This file aids in quick-and-dirty development by

  • linking everything (including the runtime) statically by default,
  • setting some useful compilation options (enables warnings, defines common Windows-specific macros, strips debug symbols in release builds, etc.).

Everything is enabled by default (use the CC_* CMake options to opt out).

Tools

Examples

I use this in all of my C++/CMake projects, e.g. aes-tools and math-server.

Development

Make a git tag:

git tag "v$( python -m setuptools_scm --strip-dev )"

You can then review that the tag is fine and push w/ git push --tags.

License

Distributed under the MIT License. See LICENSE.txt for details.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc