@@ -201,22 +201,37 @@ namespace vix::cli::errors::build
201201
202202 bool handleMissingCMakeLists (std::string_view log)
203203 {
204- if (!contains (log, " CMakeLists.txt" ) ||
205- (!contains (log, " does not exist" ) &&
206- !contains (log, " not found" ) &&
207- !contains (log, " Cannot find" )))
204+ const bool missingSourceDirCMakeLists =
205+ contains (log, " The source directory" ) &&
206+ contains (log, " does not appear to contain CMakeLists.txt" );
207+
208+ const bool missingExplicitCMakeLists =
209+ contains (log, " CMake Error: The source directory" ) &&
210+ contains (log, " CMakeLists.txt" );
211+
212+ const bool missingPathCMakeLists =
213+ contains (log, " Source directory" ) &&
214+ contains (log, " does not exist" ) &&
215+ contains (log, " CMakeLists.txt" );
216+
217+ if (!missingSourceDirCMakeLists &&
218+ !missingExplicitCMakeLists &&
219+ !missingPathCMakeLists)
208220 {
209221 return false ;
210222 }
211223
212224 const std::string path = extract (
213225 log,
214- std::regex (R"re( source directory\s+"([^"]+)")re" ));
226+ std::regex (R"re( (?:The source directory|Source directory) \s+"([^"]+)")re" ));
215227
216228 error (" CMake configure failed: CMakeLists.txt not found." );
217- printField (" directory: " , path);
218- hint (" Make sure you are running cmake from the correct directory." );
219- hint (" Expected a CMakeLists.txt at the root of the project." );
229+
230+ if (!path.empty ())
231+ printField (" directory: " , path);
232+
233+ hint (" Check the source directory passed to CMake." );
234+ hint (" Run with --verbose to inspect the full configure command." );
220235 return true ;
221236 }
222237
0 commit comments