{
  "id": "cmake/policy-cmp0057-not-supported",
  "signature": "CMake Error: Policy CMP0057 is not set: IN_LIST operator is not supported in if() commands before CMake 3.3.",
  "signature_zh": "CMake 错误：未设置策略 CMP0057：在 CMake 3.3 之前的版本中，if() 命令不支持 IN_LIST 运算符。",
  "regex": "Policy CMP0057 is not set: IN_LIST operator is not supported",
  "domain": "cmake",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "IN_LIST operator in if() command requires CMake 3.3+ and policy CMP0057 set to NEW; running older CMake or policy not set causes error.",
  "root_cause_type": "generic",
  "root_cause_zh": "if() 命令中的 IN_LIST 运算符需要 CMake 3.3+ 并将策略 CMP0057 设为 NEW；运行较旧 CMake 或未设置策略会导致错误。",
  "versions": [
    {
      "version": "CMake 3.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.16",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting cmake_minimum_required(VERSION 3.1) to bypass",
      "why_fails": "Lower minimum version does not enable policy CMP0057; IN_LIST still fails.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using if(DEFINED var IN_LIST list) syntax from older CMake",
      "why_fails": "DEFINED IN_LIST is not a valid syntax; CMake parses it incorrectly.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing IN_LIST and using foreach loop with manual check",
      "why_fails": "Code works but is inefficient; doesn't fix the underlying policy issue for other modules.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set cmake_minimum_required(VERSION 3.3) or higher at top of CMakeLists.txt, or explicitly call cmake_policy(SET CMP0057 NEW) before using IN_LIST.",
      "success_rate": 0.95,
      "how": "Set cmake_minimum_required(VERSION 3.3) or higher at top of CMakeLists.txt, or explicitly call cmake_policy(SET CMP0057 NEW) before using IN_LIST.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Replace IN_LIST with a macro that iterates manually for CMake <3.3 compatibility.",
      "success_rate": 0.85,
      "how": "Replace IN_LIST with a macro that iterates manually for CMake <3.3 compatibility.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Set cmake_minimum_required(VERSION 3.3) or higher at top of CMakeLists.txt, or explicitly call cmake_policy(SET CMP0057 NEW) before using IN_LIST.",
    "Replace IN_LIST with a macro that iterates manually for CMake <3.3 compatibility."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/policy/CMP0057.html",
  "official_doc_section": null,
  "error_code": "CMP0057",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2023-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}