summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-03-09 10:52:43 -0500
committerBrad King <brad.king@kitware.com>2001-03-09 10:52:43 -0500
commit60507258c786eb7b04f9248825659b47dc617c63 (patch)
treee21c56472a0e0581cb97e3ff6e2efcf5d8bc8b04 /Source
parent93a17629b6c8ff3a72c92c1f4e7b223621e73d90 (diff)
downloadcmake-60507258c786eb7b04f9248825659b47dc617c63.tar.gz
ERR: Added automatic creation of directory for cable_config.xml file and corresponding error reporting.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCableCommand.cxx11
-rw-r--r--Source/cmCableData.cxx4
2 files changed, 13 insertions, 2 deletions
diff --git a/Source/cmCableCommand.cxx b/Source/cmCableCommand.cxx
index df6b6e323e..3f4be4efe7 100644
--- a/Source/cmCableCommand.cxx
+++ b/Source/cmCableCommand.cxx
@@ -64,11 +64,18 @@ void cmCableCommand::SetupCableData()
if(m_CableData)
{ return; }
}
-
+
+ // We must make sure the output directory exists so that the CABLE
+ // configuration file can be opened by the cmCableData.
+ std::string pathName = m_Makefile->GetStartOutputDirectory();
+ if(!cmSystemTools::MakeDirectory(pathName.c_str()))
+ {
+ cmSystemTools::Error("Unable to make directory ", pathName.c_str());
+ }
+
// We didn't find another cmCableCommand with a valid cmCableData.
// We must allocate the new cmCableData ourselves, and with this
// command as its owner.
- std::string pathName = m_Makefile->GetStartOutputDirectory();
pathName += "/cable_config.xml";
m_CableData = new cmCableData(this, pathName);
}
diff --git a/Source/cmCableData.cxx b/Source/cmCableData.cxx
index 7fadb41a44..618a708911 100644
--- a/Source/cmCableData.cxx
+++ b/Source/cmCableData.cxx
@@ -59,6 +59,10 @@ void cmCableData::OpenOutputFile(const std::string& name)
{
this->WriteConfigurationHeader();
}
+ else
+ {
+ cmSystemTools::Error("Unable to open CABLE config file: ", name.c_str());
+ }
}