# CMake Error: Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables. Run "cmake --help-policy CMP0074" for policy details.

- **ID:** `cmake/policy-cmp0074-not-set-find-package`
- **Domain:** cmake
- **Category:** config_error
- **Error Code:** `CMP0074`
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

CMake 3.12+ has a new policy CMP0074 that controls whether find_package honors <PackageName>_ROOT environment variables. If the policy is not set explicitly, CMake issues an error to force the developer to decide.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| cmake 3.12 | active | — | — |
| cmake 3.15 | active | — | — |
| cmake 3.20 | active | — | — |
| cmake 3.25 | active | — | — |

## Workarounds

1. **Add before any find_package call: cmake_policy(SET CMP0074 NEW) to enable the new behavior.** (95% success)
   ```
   Add before any find_package call: cmake_policy(SET CMP0074 NEW) to enable the new behavior.
   ```
2. **Add cmake_policy(SET CMP0074 OLD) to use legacy behavior (ignore <PackageName>_ROOT).** (90% success)
   ```
   Add cmake_policy(SET CMP0074 OLD) to use legacy behavior (ignore <PackageName>_ROOT).
   ```
3. **Set cmake_minimum_required(VERSION 3.11) to avoid the policy entirely, but this may not be ideal for modern projects.** (85% success)
   ```
   Set cmake_minimum_required(VERSION 3.11) to avoid the policy entirely, but this may not be ideal for modern projects.
   ```

## Dead Ends

- **** — CMAKE_POLICY_DEFAULT_CMP0074 is a variable, not a policy command. Must use cmake_policy(SET CMP0074 NEW) explicitly. (70% fail)
- **** — Without policy set, CMake will still error out. The policy must be set before find_package. (95% fail)
- **** — Policy CMP0074 exists in 3.12+; using an older version may suppress the error but also lose new features. Not a proper fix. (50% fail)
