# CMake错误：导入的目标'Boost::filesystem'包含不存在的路径'/usr/local/include/boost_1_82'

- **ID:** `cmake/imported-target-missing-interface-include-dirs`
- **领域:** cmake
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

导入目标的INTERFACE_INCLUDE_DIRECTORIES属性引用了不再存在的目录，通常是由于Boost安装被移动或删除。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| CMake 3.26 | active | — | — |
| CMake 3.27 | active | — | — |
| Boost 1.82 | active | — | — |
| Boost 1.84 | active | — | — |

## 解决方案

1. ```
   Delete CMakeCache.txt and rebuild from scratch to refresh imported target properties
   ```
2. ```
   Set the missing path to an existing dummy directory using target_include_directories on the imported target
   ```
3. ```
   Reinstall Boost to the original location or symlink the missing directory
   ```

## 无效尝试

- **Manually delete the Boost CMake config files and reinstall** — The config files may be cached; deletion without clearing CMake cache leads to stale references. (40% 失败率)
- **Set BOOST_ROOT to a new path without updating the imported target** — BOOST_ROOT only affects find_package; the imported target's properties are cached after first configuration. (60% 失败率)
- **Use add_definitions(-DBOOST_ALL_NO_LIB) to bypass library checks** — This only disables auto-linking, not the include directory validation. (80% 失败率)
