diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-22 19:40:36 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-22 19:40:36 (GMT) |
commit | ee1975570e60e472e467733a840c30c583fb95cc (patch) | |
tree | 1f066070f5314a7f4cc9d1e7977d1b464ad4b999 /Source/cmConfigureFileCommand.cxx | |
parent | 10efe3b079caf5237e01d31b09f7947c77c7458f (diff) | |
download | CMake-ee1975570e60e472e467733a840c30c583fb95cc.zip CMake-ee1975570e60e472e467733a840c30c583fb95cc.tar.gz CMake-ee1975570e60e472e467733a840c30c583fb95cc.tar.bz2 |
ENH: Allow blocking of writing into the source tree
Diffstat (limited to 'Source/cmConfigureFileCommand.cxx')
-rw-r--r-- | Source/cmConfigureFileCommand.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index a3cf1dd..b382f86 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -28,6 +28,13 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args) } this->InputFile = args[0]; this->OuputFile = args[1]; + if ( !this->Makefile->CanIWriteThisFile(this->OuputFile.c_str()) ) + { + std::string e = "attempted to configure a file: " + this->OuputFile + " into a source directory."; + this->SetError(e.c_str()); + cmSystemTools::SetFatalErrorOccured(); + return false; + } this->CopyOnly = false; this->EscapeQuotes = false; |