Skip to content

Tags: cpm-cmake/CPM.cmake

Tags

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 <48911667 [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 <48911667 [email protected]>

v0.40.0

Toggle v0.40.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Adding PATCHES keyword. (#558)

* Adding PATCHES keyword.

* Formatting fix.

* Move cpm_add_patches() outside if/else scopes.

* cmake-format: add PATCHES to CPMAddPackage.

* Integration tests for PATCHES command.

* Use get_filename_component() in place of cmake_path() for use with all cmake versions 3.14 and above.

* Added an example and improved comment for cpm_add_patches.

v0.39.0

Toggle v0.39.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Custom cache directory name (#543)

* Custom cache directory name

Enable setting a custom directory name for cached packages.
Required if e.g. patch_command uses external variables or
just to set a human readable name.

* fixup! review comment CUSTOM_CACHE_DIR -> CUSTOM_CACHE_KEY

* run cmake-format

---------

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

v0.38.8

Toggle v0.38.8's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Use cpm_find_package to check if a package added (#552)

If I have a project, which has:

1. /CMakeLists.txt:

   ```cmake
   cmake_minimum_required(VERSION 3.29)
   project(test)
   include(./cmake/CPM.cmake)
   add_subdirectory(subdir)
   cpmfindpackage(
     NAME
     nlohmann_json
     VERSION
     3.11.2
     URL
     "https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz"
     EXCLUDE_FROM_ALL
     ON)

   if(NOT TARGET nlohmann_json::nlohmann_json)
     message(FATAL_ERROR "BUG")
   endif()
   ```
2. /subdir/CMakeLists.txt

   ```cmake
   cpmfindpackage(
     NAME
     nlohmann_json
     VERSION
     3.11.2
     URL
     "https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz"
     EXCLUDE_FROM_ALL
     ON)
   ```

When nlohmann_json is first founded by find_package,
CPM.cmake register this package and later call to CPMFindPackage will
not actually perform a find_package again, which leads to this buggy
behavior.

As CPM write a FindXXX.cmake file for packages added by CPM to pervert
find_package to get local package, I think directly use cpm_find_package
to check if a package is already added is good enough.

v0.38.7

Toggle v0.38.7's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Treat relative paths as relative to parent project's remote (#522)

* Treat relative paths as relative to parent project's remote

* replace unit test case with integration test

* run relative URL test only on supported CMake versions (3.27)

* omit cmake 2.25.x test runner as replaced by 2.27.x

---------

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

v0.38.6

Toggle v0.38.6's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Includes missing arguments in the `cpm_prettify_package_arguments` fu…

…nction (#511)