summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2015-12-09 14:59:43 (GMT)
committerBrad King <brad.king@kitware.com>2015-12-10 14:07:38 (GMT)
commit7984ac5e58722295e71f6c2418e2a54d6f1a0cc1 (patch)
treed94e938704d3314f1e24018235a524a26daeb5f9 /Source/cmcmd.cxx
parent4ce6fbc76b0ebaeef258695c2b876061b5b61073 (diff)
downloadCMake-7984ac5e58722295e71f6c2418e2a54d6f1a0cc1.zip
CMake-7984ac5e58722295e71f6c2418e2a54d6f1a0cc1.tar.gz
CMake-7984ac5e58722295e71f6c2418e2a54d6f1a0cc1.tar.bz2
cmake: Teach -E make_directory to support multiple input directories
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 6a4234f..fb7b1f5 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -68,7 +68,7 @@ void CMakeCommandUsage(const char* program)
<< " env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...\n"
<< " - run command in a modified environment\n"
<< " environment - display the current environment\n"
- << " make_directory dir - create a directory\n"
+ << " make_directory <dir>... - create parent and <dir> directories\n"
<< " md5sum <file>... - compute md5sum of files\n"
<< " remove [-f] <file>... - remove the file(s), use -f to force "
"it\n"
@@ -447,15 +447,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
}
#endif
- else if (args[1] == "make_directory" && args.size() == 3)
+ else if (args[1] == "make_directory" && args.size() > 2)
{
- if(!cmSystemTools::MakeDirectory(args[2].c_str()))
+ // If error occurs we want to continue copying next files.
+ bool return_value = 0;
+ for (std::string::size_type cc = 2; cc < args.size(); cc ++)
{
- std::cerr << "Error making directory \"" << args[2]
- << "\".\n";
- return 1;
+ if(!cmSystemTools::MakeDirectory(args[cc].c_str()))
+ {
+ std::cerr << "Error creating directory \""
+ << args[cc] << "\".\n";
+ return_value = 1;
+ }
}
- return 0;
+ return return_value;
}
else if (args[1] == "remove_directory" && args.size() == 3)