# CMake Error: Policy CMP0057 is not set: IN_LIST operator is not supported in if() commands before CMake 3.3.

- **ID:** `cmake/policy-cmp0057-not-supported`
- **Domain:** cmake
- **Category:** config_error
- **Error Code:** `CMP0057`
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

IN_LIST operator in if() command requires CMake 3.3+ and policy CMP0057 set to NEW; running older CMake or policy not set causes error.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| CMake 3.2 | active | — | — |
| CMake 3.3 | active | — | — |
| CMake 3.10 | active | — | — |
| CMake 3.16 | active | — | — |

## Workarounds

1. **Set cmake_minimum_required(VERSION 3.3) or higher at top of CMakeLists.txt, or explicitly call cmake_policy(SET CMP0057 NEW) before using IN_LIST.** (95% success)
   ```
   Set cmake_minimum_required(VERSION 3.3) or higher at top of CMakeLists.txt, or explicitly call cmake_policy(SET CMP0057 NEW) before using IN_LIST.
   ```
2. **Replace IN_LIST with a macro that iterates manually for CMake <3.3 compatibility.** (85% success)
   ```
   Replace IN_LIST with a macro that iterates manually for CMake <3.3 compatibility.
   ```

## Dead Ends

- **Setting cmake_minimum_required(VERSION 3.1) to bypass** — Lower minimum version does not enable policy CMP0057; IN_LIST still fails. (80% fail)
- **Using if(DEFINED var IN_LIST list) syntax from older CMake** — DEFINED IN_LIST is not a valid syntax; CMake parses it incorrectly. (90% fail)
- **Removing IN_LIST and using foreach loop with manual check** — Code works but is inefficient; doesn't fix the underlying policy issue for other modules. (30% fail)
