CMake was pointed at a directory that has no CMakeLists.txt. The source path is wrong, the checkout is incomplete, or the build was invoked from the wrong working directory.
What this error means
Configure aborts immediately stating the source directory does not contain a CMakeLists.txt. Nothing is configured - CMake never found a project to read.
CMake output
CMake Error: The source directory "/home/runner/work/app/app/src" does not
appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Diagnose it: configure step, not the build step
Most CMake failures in CI happen during configure, where a package or compiler feature is not found, and then surface later as a confusing compile or link error.
Terminal
cmake --version && cc --version
cmake -S . -B build --debug-find 2>&1 | grep -i "not found" | head -20
cmake -S . -B build -LAH | head -40 # cache variables actually in effect
Common causes
Wrong source directory passed to -S
The -S path (or the positional source arg) points at a directory one level off from where CMakeLists.txt actually lives.
Incomplete checkout or submodule not cloned
A shallow or partial checkout, or an uninitialized submodule, means the expected CMakeLists.txt is simply not on disk in CI.
How to fix it
Configure with explicit source and build dirs
Point -S at the directory that actually contains the top-level CMakeLists.txt.
Terminal
ls CMakeLists.txt # confirm it exists here
cmake -S . -B build
Fetch submodules in CI
If the project vendors dependencies as submodules, check them out before configuring.
Use cmake -S <src> -B <build> so the source path is explicit and reviewable.
Check out submodules (submodules: recursive) when the project needs them.
Assert CMakeLists.txt exists in an early step to fail fast on a bad path.
Frequently asked questions
What causes CMake "does not appear to contain CMakeLists.txt"?
There are 2 common causes: wrong source directory passed to -s and incomplete checkout or submodule not cloned. The -S path (or the positional source arg) points at a directory one level off from where CMakeLists.txt actually lives.
How do I fix CMake "does not appear to contain CMakeLists.txt"?
There are 2 fixes depending on which cause you have: configure with explicit source and build dirs and fetch submodules in ci. Work through them in order, since the first is the most common.
What does CMake "does not appear to contain CMakeLists.txt" actually mean?
Configure aborts immediately stating the source directory does not contain a CMakeLists.txt.
How do I stop CMake "does not appear to contain CMakeLists.txt" happening again?
Use cmake -S <src> -B <build> so the source path is explicit and reviewable. The prevention section lists 3 changes that keep it from recurring.