diff options
Diffstat (limited to 'Source/cmMakeDirectoryCommand.cxx')
-rw-r--r-- | Source/cmMakeDirectoryCommand.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmMakeDirectoryCommand.cxx b/Source/cmMakeDirectoryCommand.cxx new file mode 100644 index 0000000..aff4ca6 --- /dev/null +++ b/Source/cmMakeDirectoryCommand.cxx @@ -0,0 +1,27 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmMakeDirectoryCommand.h" + +#include "cmMakefile.h" +#include "cmSystemTools.h" + +class cmExecutionStatus; + +// cmMakeDirectoryCommand +bool cmMakeDirectoryCommand::InitialPass(std::vector<std::string> const& args, + cmExecutionStatus&) +{ + if (args.size() != 1) { + this->SetError("called with incorrect number of arguments"); + return false; + } + if (!this->Makefile->CanIWriteThisFile(args[0])) { + std::string e = "attempted to create a directory: " + args[0] + + " into a source directory."; + this->SetError(e); + cmSystemTools::SetFatalErrorOccured(); + return false; + } + cmSystemTools::MakeDirectory(args[0]); + return true; +} |