Skip to content
Lars Melchior edited this page May 27, 2020 · 6 revisions

The package lock makes it easier to override transitive dependencies. When using a package lock file, dependencies can be updated without modifying the main project's CMakeLists.txt. Remember to add the package lock file to version control.

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 target cpm-update-package-lock. Note that it should be added to version control.

Example

The following lines should be in the main CMakeLists.txt.

include(cmake/CPM.cmake)
CPMUsePackageLock(package-lock.cmake)

[...]
Clone this wiki locally