Skip to content

Releases: cpm-cmake/CPM.cmake

Spaces in paths and FetchContent interoperability

29 Aug 20:10
ea6a8eb
Compare
Choose a tag to compare
  • Fixes an issue (#285) when spaces are used in the CPM.cmake path.
  • Fixes an issue (#287) when using "naked" FetchContent together with CPM.cmake.

Thanks to @MixusMinimax and @OlivierLDff for finding and fixing the issues!

Bitbucket support and relative paths

08 Jun 17:18
91585e3
Compare
Choose a tag to compare
  • Projects hosted on Bitbucket can now be added through the named argument BITBUCKET_REPOSITORY or using the bb: prefix in the single-argument syntax. Thanks @pgorgon-hem for the PR!
  • Using a relative path for CMAKE_SOURCE_CACHE will now work thanks to a fix by @studoot!

Respect FETCHCONTENT_BASE_DIR if set by a user

16 Apr 15:31
7644c3a
Compare
Choose a tag to compare

Fixes an issue where a user-set FETCHCONTENT_BASE_DIR would be ignored when adding a cached dependency.

Thanks to @trxcllnt for the fix!

Options are now scoped to the dependency

25 Mar 19:15
4fad2ea
Compare
Choose a tag to compare

Previously, function passed to a dependency were stored in the CMake cache. Following version 0.32.0, options are now scoped to the dependency and not leaked into the parent or CMake cache. This could potentially break projects, if relied on options entering the cache, however we assume that the change leads to a more predictable behaviour for almost all use cases. See #222 for a detailed discussion.

Additionally, the change means that we cannot (easily) check for option consistency, so the check has been disabled for now and is planned to be re-implemented in a further update.

Fix source subdirectories support

25 Mar 09:45
32b063e
Compare
Choose a tag to compare

Fixes a bug that prevented SOURCE_SUBDIR from working as expected.

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.