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");
17 if (!status
.GetMakefile().CanIWriteThisFile(args
[0])) {
18 std::string e
= "attempted to create a directory: " + args
[0] +
19 " into a source directory.";
21 cmSystemTools::SetFatalErrorOccurred();
24 cmSystemTools::MakeDirectory(args
[0]);