Skip to content

Tags: cpm-cmake/CPM.cmake

Tags

v0.42.0

Toggle v0.42.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Implement #624: Use shorter hashes with CPM_SOURCE_CACHE (#631)

* Add ASSERT_CONTENTS_EQUAL test macro in testing.cmake

Checks if the contents of a file matches the given input

* Use shorter hashes with CPM_SOURCE_CACHE (#624)

Uses shorter hashes with CPM_SOURCE_CACHE. Falls back to a longer hash
if necessary (ie, if there's a collision with an existing hash).

See: #624

* Update integration tests to support shorter hashes

* trigger ci

* run cmake-format

* if already available, use the legacy cache hash

* create temporary file in current binary dir

* add test case for legacy hash

---------

Co-authored-by: Lars Melchior <[email protected]>
Co-authored-by: Lars Melchior <[email protected]>

v0.41.0

Toggle v0.41.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feature: allow URI to use shorthand syntax with additional options (#617

)

* feature: add URI to use shorthand syntax with additional options

This allows to combine the shorthand syntax with URI and additional arguments:
```
CPMAddPackage(URI "gh:nlohmann/[email protected]" OPTIONS "JSON_BUildTests OFF")
```

This is much shorter than the longer syntax way of writing:
```
CPMAddPackage(
  NAME nlohmann_json
  VERSION 3.9.1
  GITHUB_REPOSITORY nlohmann/json
  OPTIONS
    "JSON_BuildTests OFF"
)
```

* fix: use shorthand syntax in examples

* test: add test for shorthand syntax with options

* doc: extend README mentioning shorthand syntax with options

* feat: URI keyword also sets EXCLUDE_FROM AND SYSTEM

* doc: more explicit about the behavior of URI

* doc: adjust README accordingly to PR-Review

* test: fix inline documentation of test_simple

* move URI comment

* added new test for shorthand syntax

* reset simple test

* add that URI must be the first argument

---------

Co-authored-by: Lars Melchior <[email protected]>

v0.40.8

Toggle v0.40.8's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: do not generate module files with DOWNLOAD_ONLY (#654)

Co-authored-by: Avus <[email protected]>

v0.40.7

Toggle v0.40.7's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fetch content (#593)

* Add git_archival mechanism

* fetch_content

* Delete .pre-commit-config.yaml

* Update CPM.cmake

* cmake-format

v0.40.6

Toggle v0.40.6's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix version filename for find_package redirects (#630)

Co-authored-by: Lars Melchior <[email protected]>

v0.40.5

Toggle v0.40.5's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix finding patch executable when cross-compiling on windows. (#627)

`WIN32` checks whether current build context is windows. This is not correct in case of cross-compiling, because we are interested in finding host's tools, not SDK's tools.

v0.40.4

Toggle v0.40.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
circumvent bug in cmake <3.30.3 (#605)

Co-authored-by: Avus <[email protected]>

v0.40.3

Toggle v0.40.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add find_package overrides that also work in CONFIG mode (#498) (#604)

v0.40.2

Toggle v0.40.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Additional search path for patch.exe (#581)

* Additional search path for patch.exe

* Style

v0.40.1

Toggle v0.40.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
replace deprecated calls to FetchContent_Populate (#570)

* replace deprecated calls to FetchContent_Populate

The single argument signature for FetchContent_Populate is deprecated with CMake 3.30.
It was used, in order to call add_subdirectory manually with the EXCLUDE_FROM_ALL and SYSTEM flags.
These have been added to FetchContent_Declare with 3.25 and 3.28.
Calling FetchContent_MakeAvailable will internally call add_subdirectory with EXCLUDE_FROM_ALL and SYSTEM.
There is therefore no need to call this manually.

* fix: OPTIONS passed to CPMAddPackage not set

where previously parsed in cpm_add_subdirectory which is not called
on the new code path.

* refactor: remove an unnecessary else branch

* ci: include cmake 3.30 in test matrix

* fix: forward SOURCE_SUBDIR to FetchContent_Declare

For CMake version <3.28 this is done by calling add_subdirectory manually.
For newer version FetchContent_Declare/MakeAvailable handles this for us.

* fix: only set options if download_only is false

this replicates the old behaviour

* fix: DOWNLOAD_ONLY test

* refactor: always use *_Populate to reduce code paths

* Revert "refactor: always use *_Populate to reduce code paths"

This reverts commit 0e8ca2a.

---------

Co-authored-by: Avus <[email protected]>