resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmMakeDirectoryCommand.cxx
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"
4
5 #include "cmExecutionStatus.h"
6 #include "cmMakefile.h"
7 #include "cmSystemTools.h"
8
9 // cmMakeDirectoryCommand
10 bool cmMakeDirectoryCommand(std::vector<std::string> const& args,
11                             cmExecutionStatus& status)
12 {
13   if (args.size() != 1) {
14     status.SetError("called with incorrect number of arguments");
15     return false;
16   }
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;
23   }
24   cmSystemTools::MakeDirectory(args[0]);
25   return true;
26 }