diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c4c73dd19..06370be3b 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -544,9 +544,10 @@ int cmake::AddCMakePaths(const char *arg0) if (!cmSystemTools::FileExists(modules.c_str())) { // couldn't find modules - cmSystemTools::Error("Could not find CMAKE_ROOT !!!\n", - "Modules directory not in directory:\n", - modules.c_str()); + cmSystemTools::Error("Could not find CMAKE_ROOT !!!\n" + "CMake has most likely not been installed correctly.\n" + "Modules directory not found in\n", + cMakeRoot.c_str()); return 0; } this->m_CacheManager->AddCacheEntry @@ -1058,6 +1059,10 @@ int cmake::Run(const std::vector& args, bool noconfigure) int cmake::Generate() { + if(!m_GlobalGenerator) + { + return -1; + } m_GlobalGenerator->Generate(); if(cmSystemTools::GetErrorOccuredFlag()) { diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 7a19d09ad..5833dd122 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -196,8 +196,7 @@ int do_cmake(int ac, char** av) if (wiz) { cmakewizard wizard; - wizard.RunWizard(args); - return 0; + return wizard.RunWizard(args); } cmake cm; cm.SetProgressCallback(updateProgress, 0); diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx index f31d54bfa..f1c4fabad 100644 --- a/Source/cmakewizard.cxx +++ b/Source/cmakewizard.cxx @@ -89,7 +89,7 @@ void cmakewizard::ShowMessage(const char* m) -void cmakewizard::RunWizard(std::vector const& args) +int cmakewizard::RunWizard(std::vector const& args) { m_ShowAdvanced = this->AskAdvanced(); cmSystemTools::DisableRunCommandOutput(); @@ -148,6 +148,10 @@ void cmakewizard::RunWizard(std::vector const& args) cachem->SaveCache(make.GetHomeOutputDirectory()); } while(asked); - make.Generate(); - this->ShowMessage("CMake complete, run make to build project.\n"); + if(make.Generate() == 0) + { + this->ShowMessage("CMake complete, run make to build project.\n"); + return 0; + } + return 1; } diff --git a/Source/cmakewizard.h b/Source/cmakewizard.h index 21521dad5..1a9baa6fa 100644 --- a/Source/cmakewizard.h +++ b/Source/cmakewizard.h @@ -38,7 +38,7 @@ public: * Run cmake in wizard mode. This will coninue to ask the user questions * until there are no more entries in the cache. */ - void RunWizard(std::vectorconst& args); + int RunWizard(std::vectorconst& args); private: bool m_ShowAdvanced;