CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmMakeDirectoryCommand.cxx
blobec8b826b05fe1fea976f32e64a1e20e649f20a98
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #include "cmMakeDirectoryCommand.h"
5 #include "cmExecutionStatus.h"
6 #include "cmMakefile.h"
7 #include "cmSystemTools.h"
9 // cmMakeDirectoryCommand
10 bool cmMakeDirectoryCommand(std::vector<std::string> const& args,
11 cmExecutionStatus& status)
13 if (args.size() != 1) {
14 status.SetError("called with incorrect number of arguments");
15 return false;
17 if (!status.GetMakefile().CanIWriteThisFile(args[0])) {
18 std::string e = "attempted to create a directory: " + args[0] +
19 " into a source directory.";
20 status.SetError(e);
21 cmSystemTools::SetFatalErrorOccurred();
22 return false;
24 cmSystemTools::MakeDirectory(args[0]);
25 return true;