{
  "id": "cmake/install-target-destination-not-set",
  "signature": "CMake Error: install TARGETS given no DESTINATION and no RUNTIME, ARCHIVE, LIBRARY, or BUNDLE component.",
  "signature_zh": "CMake 错误：install TARGETS 未指定 DESTINATION，也未指定 RUNTIME、ARCHIVE、LIBRARY 或 BUNDLE 组件。",
  "regex": "install TARGETS given no DESTINATION",
  "domain": "cmake",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The install(TARGETS) command must specify a destination or component for each target type; otherwise, CMake does not know where to place the installed files.",
  "root_cause_type": "generic",
  "root_cause_zh": "install(TARGETS) 命令必须为每种目标类型指定目标路径或组件；否则 CMake 不知道将安装文件放在哪里。",
  "versions": [
    {
      "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"
    },
    {
      "version": "CMake 3.25",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If a target produces both a runtime and a library, both must have destinations; specifying only one leaves the other undefined.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "CMAKE_INSTALL_PREFIX sets the root, but install(TARGETS) needs explicit DESTINATION relative to that root.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add DESTINATION for each target type: install(TARGETS mylib RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib/static). Example: install(TARGETS myapp RUNTIME DESTINATION bin).",
      "success_rate": 0.95,
      "how": "Add DESTINATION for each target type: install(TARGETS mylib RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib/static). Example: install(TARGETS myapp RUNTIME DESTINATION bin).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a single DESTINATION for all components: install(TARGETS mylib DESTINATION lib). This works for simple libraries that don't separate runtime/archive.",
      "success_rate": 0.9,
      "how": "Use a single DESTINATION for all components: install(TARGETS mylib DESTINATION lib). This works for simple libraries that don't separate runtime/archive.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "为每种目标类型添加 DESTINATION：install(TARGETS mylib RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib/static)。示例：install(TARGETS myapp RUNTIME DESTINATION bin)。",
    "为所有组件使用单一 DESTINATION：install(TARGETS mylib DESTINATION lib)。这适用于不分离运行时/存档的简单库。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/command/install.html#install-targets",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.93,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}