Added export of CPM_LAST_PACKAGE_NAME (#403)

This commit is contained in:
Craig Hutchinson
2022-09-28 20:39:31 +01:00
committed by GitHub
parent f00ccd89c4
commit 03705fcce1
7 changed files with 18 additions and 0 deletions

View File

@@ -97,6 +97,7 @@ After calling `CPMAddPackage`, the following variables are defined in the local
- `<dependency>_SOURCE_DIR` is the path to the source of the dependency.
- `<dependency>_BINARY_DIR` is the path to the build directory of the dependency.
- `<dependency>_ADDED` is set to `YES` if the dependency has not been added before, otherwise it is set to `NO`.
- `CPM_LAST_PACKAGE_NAME` is set to the determined name of the last added dependency (equivalent to `<dependency>`).
For using CPM.cmake projects with external package managers, such as conan or vcpkg, setting the variable [`CPM_USE_LOCAL_PACKAGES`](#options) will make CPM.cmake try to add a package through `find_package` first, and add it from source if it doesn't succeed.