Releases: cpm-cmake/CPM.cmake
Add NO_CACHE option
Allows overriding the CPM_SOURCE_CACHE
per package. This is useful for packages that modify their source directory.
Prevent overriding declarations
Fixes an issue where a dependency's package lock could override outer declarations.
Add FORCE parameter
Adds an optional FORCE
parameter used internally to override any external package origin settings.
Allows package lock / declarations to be used with local overrides.
Add option for local package override
Adds the option to override a dependency per-build through a CMake argument.
Library developers are often in the situation where they work on a locally checked out dependency at the same time as on a consumer. It is now possible to override the consumer's dependency version with the local one by supplying the CMake option CPM_<dependency name>_SOURCE
to the build. For example, to use the local version of Dep at the absolute path /path/to/dep, the consumer can be built with cmake -H. -Bbuild -DCPM_Dep_SOURCE=/path/to/dep
.
Omit unversioned and local dependencies in package lock
This patch prevents local paths leaking into the package lock and omits dependencies without version information.
Add Package Lock
The package lock makes it easier to manage and override transitive dependencies. When using a package lock file, dependencies can be updated without modifying the main or other project's CMakeLists.txt
.
Usage
After including CPM.cmake, call CPMUsePackageLock(package-lock.cmake)
to include package-lock.cmake
, if it exists. This file can be created and updated using the new target cpm-update-package-lock
. Note that it should be added to version control.
More info can be found in the wiki.
Fix regex path check and download only option in CPMFindPackage
CPMFindPackage fix
- CPMFindPackage no longer overwrites version info if the package has already been added before.
Fix DOWNLOAD_ONLY
Packages with the DOWNLOAD_ONLY flag set no longer error when the source directory is already populated.
Create CMake modules for CPM packages
This allows find_package()
to find previously added CPM.cmake modules.