# CMake Error: install TARGETS given no DESTINATION and no RUNTIME, ARCHIVE, LIBRARY, or BUNDLE component.

- **ID:** `cmake/install-target-destination-not-set`
- **Domain:** cmake
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 93%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| CMake 3.10 | active | — | — |
| CMake 3.16 | active | — | — |
| CMake 3.25 | active | — | — |

## Workarounds

1. **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).** (95% success)
   ```
   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).
   ```
2. **Use a single DESTINATION for all components: install(TARGETS mylib DESTINATION lib). This works for simple libraries that don't separate runtime/archive.** (90% success)
   ```
   Use a single DESTINATION for all components: install(TARGETS mylib DESTINATION lib). This works for simple libraries that don't separate runtime/archive.
   ```

## Dead Ends

- **** — If a target produces both a runtime and a library, both must have destinations; specifying only one leaves the other undefined. (80% fail)
- **** — CMAKE_INSTALL_PREFIX sets the root, but install(TARGETS) needs explicit DESTINATION relative to that root. (95% fail)
