{
  "id": "cmake/unknown-cmake-command",
  "signature": "CMake Error: CMake Error in CMakeLists.txt: Unknown CMake command \"my_custom_function\".",
  "signature_zh": "CMake错误：CMakeLists.txt中：未知的CMake命令\"my_custom_function\"。",
  "regex": "CMake Error: CMake Error in CMakeLists\\.txt: Unknown CMake command \"([^\"]+)\"",
  "domain": "cmake",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A CMakeLists.txt calls a function or macro that is not defined, due to a missing include, typo, or unsupported module.",
  "root_cause_type": "generic",
  "root_cause_zh": "CMakeLists.txt调用了一个未定义的函数或宏，原因是缺少include、拼写错误或不支持的模块。",
  "versions": [
    {
      "version": "cmake 2.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "cmake 3.0",
      "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"
    },
    {
      "version": "cmake 3.28",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Typing the command name in a different case (e.g., 'My_Function' vs 'my_function')",
      "why_fails": "CMake commands are case-insensitive but must match exactly; case issues rarely cause this error.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding the command as a comment to suppress the error",
      "why_fails": "Comments are ignored; the command must be defined or removed.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Installing a third-party module without including it",
      "why_fails": "The module must be included with include() or find_package() before use.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check for typos: ensure the command is spelled correctly (e.g., 'target_link_libraries' not 'target_link_library').",
      "success_rate": 0.95,
      "how": "Check for typos: ensure the command is spelled correctly (e.g., 'target_link_libraries' not 'target_link_library').",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the command is from a custom module, add include(MyModule) before the call, or use include(path/to/module.cmake).",
      "success_rate": 0.9,
      "how": "If the command is from a custom module, add include(MyModule) before the call, or use include(path/to/module.cmake).",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the command is from an older CMake version, upgrade CMake or use a compatibility wrapper: cmake_minimum_required(VERSION 3.10).",
      "success_rate": 0.8,
      "how": "If the command is from an older CMake version, upgrade CMake or use a compatibility wrapper: cmake_minimum_required(VERSION 3.10).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "检查拼写错误：确保命令拼写正确（例如'target_link_libraries'而不是'target_link_library'）。",
    "如果命令来自自定义模块，在调用前添加include(MyModule)，或使用include(path/to/module.cmake)。",
    "如果命令来自旧版CMake，升级CMake或使用兼容性包装：cmake_minimum_required(VERSION 3.10)。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#command-invocations",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}