Skip to content

Preparing projects for CPM.cmake

Lars Melchior edited this page Apr 18, 2020 · 5 revisions

CPM differs from conventional package managers as it supports adding any type of project from any source without any modifications to the original code base. However, this means that all information required to download and configure the project must be provided by project users, as illustrated in the examples. To make this as convenient as possible, please see the following guidelines:

  1. Use CMake to build your project.
  2. Use modern CMake features like targets and properties. See here and here.
  3. Understand semantic versioning here and here.
  4. Tag your releases with the version prefixed by a v.
  5. Use the same version for the installed target for compatibility between local and global installations.
  6. Don't include tests or other projects from the main CMakeLists.

For a minimal example, see the ModernCppStarter.

Clone this wiki locally