# CMake Error: Could NOT find GLFW3 (missing: GLFW3_DIR)

- **ID:** `cmake/glfw3-not-found-missing-config`
- **Domain:** cmake
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

CMake's find_package(GLFW3) cannot locate the GLFW3Config.cmake or glfw3-config.cmake file, typically because GLFW3 is not installed or the install prefix is not in CMake's search path.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| GLFW 3.3 | active | — | — |
| GLFW 3.4 | active | — | — |
| CMake 3.16 | active | — | — |
| CMake 3.20 | active | — | — |

## Workarounds

1. **Install the development package: On Ubuntu/Debian: sudo apt-get install libglfw3-dev. On Fedora: sudo dnf install glfw-devel. On macOS: brew install glfw.** (90% success)
   ```
   Install the development package: On Ubuntu/Debian: sudo apt-get install libglfw3-dev. On Fedora: sudo dnf install glfw-devel. On macOS: brew install glfw.
   ```
2. **If building GLFW3 from source, run cmake with -DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=ON and then sudo make install. Then set GLFW3_DIR to the install prefix (e.g., /usr/local/lib/cmake/glfw3).** (85% success)
   ```
   If building GLFW3 from source, run cmake with -DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=ON and then sudo make install. Then set GLFW3_DIR to the install prefix (e.g., /usr/local/lib/cmake/glfw3).
   ```
3. **Provide GLFW3_DIR manually on command line: cmake .. -DGLFW3_DIR=/path/to/glfw3/lib/cmake/glfw3** (80% success)
   ```
   Provide GLFW3_DIR manually on command line: cmake .. -DGLFW3_DIR=/path/to/glfw3/lib/cmake/glfw3
   ```

## Dead Ends

- **** — Some system packages (e.g., libglfw3 on Ubuntu) install only the shared library and headers, not the CMake config file. The config file is in a separate -dev package. (70% fail)
- **** — GLFW3_DIR must point to the directory containing GLFW3Config.cmake, typically the build or install directory, not the source root. (85% fail)
- **** — Without REQUIRED, CMake continues but variables like GLFW3_FOUND are FALSE, leading to undefined symbols at link time. (60% fail)
