CMake Warning (dev): Policy CMP0xxx is not set: ... Run "cmake --help-policy CMP0xxx" for policy details

CMake is warning that a behaviour changed between versions and your project has not said which behaviour it wants.

Exact message you may see Policy CMP0 is not setCMake Warning (dev) Policycmake --help-policyCompatibility with CMake < 3.5 has been removed
Seen on: CMake

Meaning

Policies keep old projects working. If cmake_minimum_required is too low or missing, CMake warns about every policy introduced since. Some become errors in newer CMake versions.

Common causes

  • cmake_minimum_required too old or missing
  • Third-party subproject using an old minimum
  • CMake upgraded since the project was written
  • Policy removed in CMake 4

⚡ Quick fix

  1. Raise cmake_minimum_required(VERSION 3.20) to a modern version
  2. Set the policy explicitly with cmake_policy(SET CMP0xxx NEW)
  3. For old dependencies pass -DCMAKE_POLICY_VERSION_MINIMUM=3.5

Detailed fix by platform

CMake

  1. cmake_minimum_required(VERSION 3.20) at the top of the root CMakeLists.txt

How to diagnose

  1. Minimum — Declared version?
  2. Policy — Which CMP number?
  3. Source — Own code or dependency?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

channel 2: open failed: administratively prohibited: open failed — channel 2: open failed: administratively prohibited: open failed (Linux)channel 2: open faile…CMake Error: CMAKE_C_COMPILER not set / No CMAKE_CXX_COMPILER could be found — CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles" (macOS)CMake Error: CMAKE_C_…CMakeCache.txt directory is different — CMake Error: The current CMakeCache.txt directory is different than the directory where CMakeCache.txt was created (C/C++)CMakeCache.txt direct…Could not find a package configuration file — CMake Error: Could not find a package configuration file provided by "Foo" (requested version 1.2) (C/C++)Could not find a pack…does not appear to contain CMakeLists.txt — CMake Error: The source directory does not appear to contain CMakeLists.txt (C/C++)does not appear to co…install DESTINATION — CMake Error: install TARGETS given no RUNTIME DESTINATION / file INSTALL cannot copy file (C/C++)install DESTINATIONNo CMAKE_CXX_COMPILER could be found — CMake Error: No CMAKE_CXX_COMPILER could be found (C/C++)No CMAKE_CXX_COMPILER…Qt6Config.cmake — CMake Error: Could not find a package configuration file provided by "Qt6" (Qt6Config.cmake) (C/C++)Qt6Config.cmakeCMP0

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.