don't give up the build directory search too early

The current code works great if you have a simple project. When it grows into several subdirectories like src/client/ui, the early check for a CMakeLists.txt stops us from finding the correct build directory.