{
  "id": "cmake/export-target-not-found",
  "signature": "CMake Error: install(EXPORT \"MyTargets\" ...) includes target \"mylib\" which is not in the export set.",
  "signature_zh": "CMake 错误：install(EXPORT \"MyTargets\" ...) 包含了目标 \"mylib\"，但该目标不在导出集中。",
  "regex": "CMake Error: install\\(EXPORT \".*\" \\.\\.\\.\\) includes target \".*\" which is not in the export set\\.",
  "domain": "cmake",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "A target listed in install(EXPORT ...) was not previously registered with install(TARGETS ...) for that export set.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 install(EXPORT ...) 中列出的目标未事先通过 install(TARGETS ...) 注册到该导出集。",
  "versions": [
    {
      "version": "CMake 3.14",
      "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.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.27",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding the target to the export set by adding it to install(EXPORT ...) without install(TARGETS ...)",
      "why_fails": "The target must be explicitly installed with install(TARGETS ...) first; just listing it in install(EXPORT ...) does not register it.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing the target from the export list, assuming it's not needed",
      "why_fails": "If the target is required by downstream projects, removing it breaks the export and causes missing dependencies.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using install(TARGETS ... EXPORT MyTargets) but misspelling the export set name",
      "why_fails": "Mismatched export set names cause the target to be registered under a different set, leading to the same error.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure every target in install(EXPORT ...) is also installed with install(TARGETS ... EXPORT ...) using the same export set name.",
      "success_rate": 0.9,
      "how": "Ensure every target in install(EXPORT ...) is also installed with install(TARGETS ... EXPORT ...) using the same export set name.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the target is header-only, use install(TARGETS mylib EXPORT MyTargets) with an INTERFACE library.",
      "success_rate": 0.85,
      "how": "If the target is header-only, use install(TARGETS mylib EXPORT MyTargets) with an INTERFACE library.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure every target in install(EXPORT ...) is also installed with install(TARGETS ... EXPORT ...) using the same export set name.",
    "If the target is header-only, use install(TARGETS mylib EXPORT MyTargets) with an INTERFACE library."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/command/install.html#exporting-targets",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.89,
  "resolvable": "true",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}