# CMake Warning (dev): Policy CMP0077 is not set: option() honors normal variables. Run "cmake --help-policy CMP0077" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

- **ID:** `cmake/policy-cmp0077-not-set`
- **Domain:** cmake
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

CMake policy CMP0077 is not explicitly set, causing option() to behave inconsistently when a normal variable with the same name exists.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| CMake 3.13 | active | — | — |
| CMake 3.14 | active | — | — |
| CMake 3.20 | active | — | — |

## Workarounds

1. **Set the policy to NEW at the beginning of CMakeLists.txt: cmake_policy(SET CMP0077 NEW)** (95% success)
   ```
   Set the policy to NEW at the beginning of CMakeLists.txt: cmake_policy(SET CMP0077 NEW)
   ```
2. **If the old behavior is needed, set to OLD: cmake_policy(SET CMP0077 OLD), but this is not recommended for new projects.** (80% success)
   ```
   If the old behavior is needed, set to OLD: cmake_policy(SET CMP0077 OLD), but this is not recommended for new projects.
   ```

## Dead Ends

- **** — The warning may lead to subtle bugs where option() does not behave as expected, especially in cache variable scenarios. (40% fail)
- **** — OLD behavior may break modern CMake patterns and cause unexpected cache variable behavior. (50% fail)
