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.
Policy CMP0 is not setCMake Warning (dev) Policycmake --help-policyCompatibility with CMake < 3.5 has been removed 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_requiredtoo old or missing- Third-party subproject using an old minimum
- CMake upgraded since the project was written
- Policy removed in CMake 4
⚡ Quick fix
- Raise
cmake_minimum_required(VERSION 3.20)to a modern version - Set the policy explicitly with
cmake_policy(SET CMP0xxx NEW) - For old dependencies pass
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
Detailed fix by platform
CMake
cmake_minimum_required(VERSION 3.20)at the top of the root CMakeLists.txt
How to diagnose
- Minimum — Declared version?
- Policy — Which CMP number?
- 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:
Similar errors
- channel 2: open failed: administratively prohibited: open failed channel 2: open failed: administratively prohibited: open failed
- 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"
- CMakeCache.txt directory is different CMake Error: The current CMakeCache.txt directory is different than the directory where CMakeCache.txt was created
Most viewed in C/C++
- Bus error C/C++: Bus error (core dumped) — SIGBUS from misaligned access or a bad memory-mapped file
- AddressSanitizer: heap-buffer-overflow C/C++: ==ERROR: AddressSanitizer: heap-buffer-overflow on address — READ/WRITE of size N
- AddressSanitizer: heap-use-after-free C/C++: ==ERROR: AddressSanitizer: heap-use-after-free on address — memory used after delete/free
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 2 Dec 2026