{
  "id": "cmake/missing-cmake-policies-package",
  "signature": "CMake Error: CMake Error in CMakeLists.txt: Unknown CMake command \"cmake_policy\".",
  "signature_zh": "CMake 错误：CMakeLists.txt 中的 CMake 错误：未知的 CMake 命令 \"cmake_policy\"。",
  "regex": "Unknown CMake command \"cmake_policy\"",
  "domain": "cmake",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The cmake_policy command is used incorrectly (e.g., misspelled, wrong case, or called before cmake_minimum_required) or CMake version is too old to support it.",
  "root_cause_type": "generic",
  "root_cause_zh": "cmake_policy 命令使用不正确（例如拼写错误、大小写错误或在 cmake_minimum_required 之前调用），或者 CMake 版本太旧不支持它。",
  "versions": [
    {
      "version": "CMake 2.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "cmake_policy was introduced in CMake 2.6; if cmake_minimum_required is set to a lower version, the command may be unrecognized.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "cmake_policy is a built-in command, not a variable; using set() with it creates a variable that does nothing.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure cmake_minimum_required(VERSION 3.0) is placed before any cmake_policy calls. Example: cmake_minimum_required(VERSION 3.0) then cmake_policy(SET CMP0000 NEW).",
      "success_rate": 0.95,
      "how": "Ensure cmake_minimum_required(VERSION 3.0) is placed before any cmake_policy calls. Example: cmake_minimum_required(VERSION 3.0) then cmake_policy(SET CMP0000 NEW).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check for typos: use cmake_policy (lowercase, underscore) not cmakepolicy or CMakePolicy. Correct syntax: cmake_policy(VERSION 3.0).",
      "success_rate": 0.9,
      "how": "Check for typos: use cmake_policy (lowercase, underscore) not cmakepolicy or CMakePolicy. Correct syntax: cmake_policy(VERSION 3.0).",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using an old CMake version, upgrade to at least 3.0, or use conditional code: if(CMAKE_VERSION VERSION_GREATER 2.6) cmake_policy(...) endif().",
      "success_rate": 0.85,
      "how": "If using an old CMake version, upgrade to at least 3.0, or use conditional code: if(CMAKE_VERSION VERSION_GREATER 2.6) cmake_policy(...) endif().",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "确保 cmake_minimum_required(VERSION 3.0) 放在任何 cmake_policy 调用之前。示例：cmake_minimum_required(VERSION 3.0) 然后 cmake_policy(SET CMP0000 NEW)。",
    "检查拼写错误：使用 cmake_policy（小写，下划线），而不是 cmakepolicy 或 CMakePolicy。正确语法：cmake_policy(VERSION 3.0)。",
    "如果使用旧版 CMake，升级到至少 3.0，或使用条件代码：if(CMAKE_VERSION VERSION_GREATER 2.6) cmake_policy(...) endif()。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/command/cmake_policy.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.87,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}