# cpm-cmake/cpm.cmake

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/cpm-cmake-cpm-cmake).**

3,910 stars · 214 forks · CMake · mit

## Links

- GitHub: https://github.com/cpm-cmake/CPM.cmake
- awesome-repositories: https://awesome-repositories.com/repository/cpm-cmake-cpm-cmake.md

## Topics

`builds` `c` `c-plus-plus` `cmake` `cpp` `cross-platform` `dependencies` `dependency` `dependency-manager` `git` `package-manager` `reproducible` `reproducible-builds` `svn` `update` `version-manager` `versions`

## Description

CPM.cmake is a dependency manager and package resolver for C and C++ projects that integrates directly into the CMake build system. It automates the process of fetching, configuring, and managing external libraries by resolving dependencies through system-wide package managers or by downloading source code from remote repositories.

The system ensures reproducible builds by locking transitive dependency versions and verifying the authenticity of downloaded source archives using cryptographic hash checksums. It allows for development flexibility through local filesystem overrides, which redirect remote dependencies to local paths, and sequential source patching to modify dependency behavior without altering the original codebase.

Broad capabilities include version resolution via semantic tags or commit hashes, local caching of dependency sources to reduce network overhead, and the application of custom build flags and options during the configuration of third-party projects.

## Tags

### Development Tools & Productivity

- [Remote Dependency Integration](https://awesome-repositories.com/f/development-tools-productivity/source-code-management/remote-dependency-integration.md) — Automates the downloading and integration of external libraries from remote repositories into the build system. ([source](https://cdn.jsdelivr.net/gh/cpm-cmake/cpm.cmake@master/README.md))
- [Dependency Lock Managers](https://awesome-repositories.com/f/development-tools-productivity/dependency-lock-managers.md) — Generates lock files to fix versions of all transitive dependencies for reproducible builds. ([source](https://cdn.jsdelivr.net/gh/cpm-cmake/cpm.cmake@master/README.md))
- [Dependency Resolvers](https://awesome-repositories.com/f/development-tools-productivity/dependency-resolvers.md) — Implements logic for calculating and fetching dependency graphs to resolve transitive library versions.
- [Remote Version Resolution](https://awesome-repositories.com/f/development-tools-productivity/git-versioning-managers/remote-version-resolution.md) — Resolves specific library versions by fetching tags or commit hashes directly from remote Git repositories.
- [Package Dependency Managers](https://awesome-repositories.com/f/development-tools-productivity/package-dependency-managers.md) — Resolves third-party dependencies by checking system-wide package managers before falling back to automated source downloads.
- [Reproducible Build Environments](https://awesome-repositories.com/f/development-tools-productivity/reproducible-build-environments.md) — Ensures consistent builds across environments by locking transitive dependency versions and verifying source integrity.
- [Third-Party Source Integration](https://awesome-repositories.com/f/development-tools-productivity/third-party-source-integration.md) — Downloads and configures third-party projects from any source without requiring modifications to the original codebase. ([source](https://github.com/cpm-cmake/CPM.cmake/wiki/Preparing-projects-for-CPM.cmake))
- [Dependency Build Options](https://awesome-repositories.com/f/development-tools-productivity/build-tooling/build-orchestration-logic/build-orchestration-configuration/build-automation-systems/build-systems/compilation-flags/compiler-flag-customization/feature-flag-configurations/dependency-build-options.md) — Passes build settings and flags to a dependency during configuration to toggle features or disable components. ([source](https://github.com/cpm-cmake/CPM.cmake/wiki/More-Snippets))
- [Dependency Caches](https://awesome-repositories.com/f/development-tools-productivity/dependency-caches.md) — Stores downloaded packages in a local directory to speed up build times and ensure consistent environments. ([source](https://cdn.jsdelivr.net/gh/cpm-cmake/cpm.cmake@master/README.md))
- [Post-Download Patching](https://awesome-repositories.com/f/development-tools-productivity/dependency-patching-utilities/post-download-patching.md) — Executes a sequence of patch files against dependency source code immediately after downloading to modify behavior. ([source](https://cdn.jsdelivr.net/gh/cpm-cmake/cpm.cmake@master/README.md))
- [Local Dependency Caching](https://awesome-repositories.com/f/development-tools-productivity/local-dependency-caching.md) — Implements local caching of downloaded dependencies to reduce network overhead and ensure build consistency.
- [Local Dependency Linkers](https://awesome-repositories.com/f/development-tools-productivity/package-managers/dependency/local-dependency-linkers.md) — Redirects dependencies to absolute local paths to test changes without updating remote sources. ([source](https://cdn.jsdelivr.net/gh/cpm-cmake/cpm.cmake@master/README.md))
- [Local Source Overrides](https://awesome-repositories.com/f/development-tools-productivity/remote-file-synchronization/local-remote-configurations/local-source-overrides.md) — Allows redirecting remote dependency resolution to a local filesystem path for iterative development.

### Software Engineering & Architecture

- [CMake-Based Managers](https://awesome-repositories.com/f/software-engineering-architecture/library-compatibility-managers/library-dependency-managers/cmake-based-managers.md) — Acts as a comprehensive dependency manager and package resolver integrated directly into the CMake build system.
- [Fallback Resolution Strategies](https://awesome-repositories.com/f/software-engineering-architecture/dependency-graph-resolution/concurrent-dependency-resolution/multi-source-dependency-resolution/fallback-resolution-strategies.md) — Attempts to find packages via system-wide managers before falling back to automated source downloads.
- [Package Dependency Resolution](https://awesome-repositories.com/f/software-engineering-architecture/dependency-graph-resolution/package-dependency-resolution.md) — Locates required packages by checking for global installations before falling back to automated fetching. ([source](https://github.com/cpm-cmake/CPM.cmake/wiki/Preparing-projects-for-CPM.cmake))
- [Patch Application](https://awesome-repositories.com/f/software-engineering-architecture/code-patching-engines/patch-generators/patch-application.md) — Applies a series of external patch files to downloaded source code before configuration.

### DevOps & Infrastructure

- [CMake Integrations](https://awesome-repositories.com/f/devops-infrastructure/cicd-pipeline-automation/core-build-engines/build-systems/cmake-integrations.md) — Provides a CMake script that automates the retrieval and inclusion of external project source code.
- [Dependency Management](https://awesome-repositories.com/f/devops-infrastructure/cicd-pipeline-automation/core-build-engines/build-systems/cmake-integrations/dependency-management.md) — Provides an automated system for fetching and configuring external C++ libraries directly through CMake.
- [Semantic Versioning Systems](https://awesome-repositories.com/f/devops-infrastructure/dependency-management/version-compatibility-management/semantic-versioning-systems.md) — Uses semantic versioning and release tags to integrate libraries and ensure deterministic builds. ([source](https://github.com/cpm-cmake/CPM.cmake/wiki/Preparing-projects-for-CPM.cmake))
- [System Package Manager Integrations](https://awesome-repositories.com/f/devops-infrastructure/system-package-manager-integrations.md) — Locates dependencies via system-wide package managers before falling back to downloading from source. ([source](https://cdn.jsdelivr.net/gh/cpm-cmake/cpm.cmake@master/README.md))

### Programming Languages & Runtimes

- [C++ Package Orchestration](https://awesome-repositories.com/f/programming-languages-runtimes/c-package-orchestration.md) — Manages the lifecycle of third party C++ dependencies by checking system installations before downloading from source.
- [External Library Installers](https://awesome-repositories.com/f/programming-languages-runtimes/external-library-installers.md) — Downloads and configures external source code from remote repositories using specific version tags or commit hashes. ([source](https://github.com/cpm-cmake/CPM.cmake/wiki/More-Snippets))

### Security & Cryptography

- [Download Integrity Verification](https://awesome-repositories.com/f/security-cryptography/download-integrity-verification.md) — Validates the authenticity of downloaded source archives by comparing file hashes against trusted checksums.
- [Post-Download Integrity Checks](https://awesome-repositories.com/f/security-cryptography/security/cryptography-and-secrets/cryptographic-primitives-management/cryptographic-hash-computations/data-integrity-identifiers/integrity-verifications/post-download-integrity-checks.md) — Validates the authenticity of downloaded source archives using cryptographic hash checksums to ensure supply chain security. ([source](https://cdn.jsdelivr.net/gh/cpm-cmake/cpm.cmake@master/README.md))
