From 11b68dea51e8cb8fa243bc91f489a308fc71d45c Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 25 Apr 2001 18:53:33 -0400 Subject: [PATCH] ENH: add error checking for empty build dir --- Source/MFCDialog/CMakeSetupDialog.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index 030337577..67800b978 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -315,6 +315,22 @@ void CMakeSetupDialog::LoadFromRegistry() void CMakeSetupDialog::OnBuildProjects() { + if(!cmSystemTools::FileExists(m_WhereBuild)) + { + std::string message = + "Build directory does not exist, should I create it?\n\n" + "Directory: "; + message += (const char*)m_WhereBuild; + if(MessageBox(message.c_str(), "Create Directory", MB_OKCANCEL) == IDOK) + { + cmSystemTools::MakeDirectory(m_WhereBuild); + } + else + { + MessageBox("Build Project aborted, nothing done."); + return; + } + } ::SetCursor(LoadCursor(NULL, IDC_WAIT)); // get all the info from the screen this->UpdateData();