Skip to content

Releases: cpm-cmake/CPM.cmake

URL support in shorthand syntax

23 Feb 19:18
a3d1048
Compare
Choose a tag to compare

The shorthand syntax now supports URL patterns, inferring name and version automatically. Hash validation is also supported. See the readme or #220 for details.

Example

CPMAddPackage("https://example.com/my-package-1.2.3.zip#MD5=68e20f674a48be38d60e129f600faf7d")

Single-argument shorthand syntax

22 Feb 20:16
3f6cbe7
Compare
Choose a tag to compare

Adds a new single-argument shorthand syntax for CPMAddPackage, which tries to infer name, tag and version information from the provided argument string. See #205 and the readme for details.

Example

Before

CPMAddPackage(
  NAME catch2
  GITHUB_REPO catchorg/Catch2
  VERSION 2.5.0
  EXCLUDE_FROM_ALL YES
)

After

CPMAddPackage("gh:catchorg/[email protected]")

Infer name from git repo if possible

17 Feb 11:43
4cbf443
Compare
Choose a tag to compare

Now tries to infer the package name automatically from a given git repository URL. See #202 for details.

Example

CPMAddPackage(
  NAME Catch2
  GITHUB_REPOSITORY catchorg/Catch2
  VERSION 2.5.0
)

Is now equivalent to

CPMAddPackage(
  GITHUB_REPOSITORY catchorg/Catch2
  VERSION 2.5.0
)

Add option EXCLUDE_FROM_ALL

16 Feb 10:28
fd539b8
Compare
Choose a tag to compare

This adds an optional parameter EXCLUDE_FROM_ALL that prevents packages from leaking unwanted targets (such as tests, examples) to CPM.cmake projects. See #152 and #198 for details.

Usage example

CPMAddPackage(
  NAME googletest
  GITHUB_REPOSITORY google/googletest
  VERSION 1.8.0
  GIT_TAG release-1.8.0
  # prevent googletest targets from leaking into all
  EXCLUDE_FROM_ALL YES
)

Optionally add dependencies using EXCLUDE_FROM_ALL

15 Feb 14:59
Compare
Choose a tag to compare

This adds an optional parameter EXCLUDE_FROM_ALL that prevents packages from leaking unwanted targets (such as tests, examples) to CPM.cmake projects. This is a pre-release for testing the functionality. See #152 and #198 for details.

Add dependencies using EXCLUDE_FROM_ALL

15 Feb 12:49
Compare
Choose a tag to compare
Pre-release

This should prevent packages from leaking unwanted targets (such as tests, examples) to CPM.cmake projects. This is a pre-release for testing the functionality. See #152 and #198 for details.

Migrate to GitHub organisation

08 Feb 20:34
02d57a1
Compare
Choose a tag to compare

The CPM.cmake source code now resides at the brand new cpm-cmake organisation. This will help the project grow by organising related projects and managing collaborators. This release updates related URLs in the CPM.cmake script.

Fix super build issues

07 Feb 16:12
5f614e5
Compare
Choose a tag to compare
  • Fixed an issue caused by a bug in CMake < 3.17, where FetchContent wasn't properly included when importing CPM.cmake independently from different directories (#192).
  • Updated examples with newer versions and cleaner CMake code (#190).

Thanks to @ClausKlein and @xmuller for the PRs!

Prettify package lock

27 Jan 12:35
7000572
Compare
Choose a tag to compare

The package lock output is now prettified.

Before

# cxxopts
CPMDeclarePackage(cxxopts "NAME;cxxopts;VERSION;2.2.0;GITHUB_REPOSITORY;jarro2783/cxxopts;OPTIONS;CXXOPTS_BUILD_EXAMPLES Off;CXXOPTS_BUILD_TESTS Off")

After

# cxxopts
CPMDeclarePackage(cxxopts
  NAME cxxopts
  VERSION 2.2.0
  GITHUB_REPOSITORY jarro2783/cxxopts
  OPTIONS
    "CXXOPTS_BUILD_EXAMPLES Off"
    "CXXOPTS_BUILD_TESTS Off"
)

Thanks to @alexandreSalconiDenis for the suggestion and PR!

Expand CPM_SOURCE_CACHE path provided as a configure argument

25 Jan 14:44
fe8d15b
Compare
Choose a tag to compare

Now supports non-absolute paths for CPM_SOURCE_CACHE passed through configuration arguments, e.g. -DCPM_SOURCE_CACHE=~/some/path.

See #186 for details.