/cmake-release

semantic-release plugin for updating CMake modules w/ release information

Primary LanguageJavaScriptMIT LicenseMIT

@s0cks/cmake-release

semantic-release plugin for updating CMake project releases

Usage

Add the following to your .releaserc:

{
  ...
  "plugins": [
    ...
    "@s0cks/cmake-release"
  ]
}

Download BuildInfo.cmake and place it in your CMake scripts directory:

Ex:

cd /path/to/project
# create scripts directory if it doesn't exist
mkdir cmake/
# download BuildInfo.cmake
wget https://raw.githubusercontent.com/s0cks/cmake-release/main/cmake/BuildInfo.cmake

Add the following to your CMakeLists.txt:

include(BuildInfo)
project(
  ${BUILD_JSON_NAME}
  VERSION ${BUILD_JSON_VERSION}
  HOMEPAGE_URL ${BUILD_JSON_HOMEPAGE}
  LANGUAGES C CXX)

Finally, create a build.json:

{
  "name": "my-project",
  "version": "1.0.0",
  "homepage": "https://github.com/me/my-project"
}

build.json Schema Validation

You can validate your build.json schema against: build.schema.json

Ex:

{
  "$schema": "build.schema.json",
  ...
}

Build & Install

Prerequisites

  • node & npm
  • cmake

Install Locally

# clone the repository
git clone https://github.com/s0cks/cmake-release
# install npm dependencies & link
npm i
npm link

Changelog

See CHANGELOG.md

License

See LICENSE

Contributing

See CONTRIBUTING.md