{
  "id": "cmake/export-duplicate-target",
  "signature": "CMake Error: install(EXPORT \"MyTargets\" ...) includes target \"mylib\" more than once in the export set.",
  "signature_zh": "CMake 错误：install(EXPORT \"MyTargets\" ...) 在导出集中多次包含了目标 \"mylib\"。",
  "regex": "includes target .* more than once in the export set",
  "domain": "cmake",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The same target is listed in multiple install(TARGETS ...) commands that write to the same export set, or a target is added to the same export set via both install and export() calls.",
  "root_cause_type": "generic",
  "root_cause_zh": "同一个目标被多次列在写入同一导出集的 install(TARGETS ...) 命令中，或者通过 install 和 export() 调用将目标添加到了同一导出集。",
  "versions": [
    {
      "version": "CMake 3.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.26",
      "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": "Remove one of the install(TARGETS) lines entirely",
      "why_fails": "If that target needs to be installed for both runtime and development, removing one line might break the install step.",
      "fail_rate": 0.35,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use different export names for each install(TARGETS) call",
      "why_fails": "This creates separate export sets, which may not be what the downstream project expects (they'd need to include both).",
      "fail_rate": 0.25,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Consolidate all install(TARGETS) for the same export set into a single install(TARGETS ... EXPORT MyTargets) call listing all targets.",
      "success_rate": 0.9,
      "how": "Consolidate all install(TARGETS) for the same export set into a single install(TARGETS ... EXPORT MyTargets) call listing all targets.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the NAMESPACE and install(EXPORT) with COMPONENT to split, but ensure each target appears only once per export set.",
      "success_rate": 0.8,
      "how": "Use the NAMESPACE and install(EXPORT) with COMPONENT to split, but ensure each target appears only once per export set.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将所有针对同一导出集的 install(TARGETS) 合并为单个 install(TARGETS ... EXPORT MyTargets) 调用，列出所有目标。",
    "使用 NAMESPACE 和带有 COMPONENT 的 install(EXPORT) 进行拆分，但确保每个目标在每个导出集中只出现一次。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}