diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-03-28 21:00:57 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-03-28 21:00:57 (GMT) |
commit | 4a1f15c344bd4f014ac1275e2c81473aab7dc32f (patch) | |
tree | eadd88e1aa03748e893ef945318df487ad66f739 | |
parent | ba0b6d307897351682cfa9c8017c07d8bd0f5818 (diff) | |
download | CMake-4a1f15c344bd4f014ac1275e2c81473aab7dc32f.zip CMake-4a1f15c344bd4f014ac1275e2c81473aab7dc32f.tar.gz CMake-4a1f15c344bd4f014ac1275e2c81473aab7dc32f.tar.bz2 |
ENH: If configure file fails do not create directory
-rw-r--r-- | Source/cmConfigureFileCommand.cxx | 10 | ||||
-rw-r--r-- | Source/cmConfigureFileCommand.h | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 5 |
3 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index bd3b4d3..fa7d52d 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -56,7 +56,11 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args) // first pass (now). if(m_Immediate) { - this->ConfigureFile(); + if ( !this->ConfigureFile() ) + { + this->SetError("Problem configuring file"); + return false; + } } return true; @@ -70,9 +74,9 @@ void cmConfigureFileCommand::FinalPass() } } -void cmConfigureFileCommand::ConfigureFile() +int cmConfigureFileCommand::ConfigureFile() { - m_Makefile->ConfigureFile(m_InputFile.c_str(), + return m_Makefile->ConfigureFile(m_InputFile.c_str(), m_OuputFile.c_str(), m_CopyOnly, m_AtOnly, diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h index e9a01b3..2ae8040 100644 --- a/Source/cmConfigureFileCommand.h +++ b/Source/cmConfigureFileCommand.h @@ -76,7 +76,7 @@ public: virtual void FinalPass(); private: - void ConfigureFile(); + int ConfigureFile(); std::string m_InputFile; std::string m_OuputFile; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index cc1721c..f0e187f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2285,6 +2285,11 @@ void cmMakefile::ConfigureString(const std::string& input, int cmMakefile::ConfigureFile(const char* infile, const char* outfile, bool copyonly, bool atOnly, bool escapeQuotes) { + if ( !cmSystemTools::FileExists(infile) ) + { + cmSystemTools::Error("File ", infile, " does not exist."); + return 0; + } std::string soutfile = outfile; std::string sinfile = infile; this->AddCMakeDependFile(infile); |