[Cmake-commits] CMake branch, next, updated. v3.4.1-1640-g270a1ae
Brad King
brad.king at kitware.com
Mon Dec 7 10:52:55 EST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 270a1aef1c938e7683fb338075c6db432c50bc0e (commit)
via bc35087da3eb9039dad8fb5d27c1fab60b43f776 (commit)
via 98be140fc0dc0bab8955c4fea9274ea52ac8cd9c (commit)
via 93cc80aee59cfb328d541ba527d40239ab8348b1 (commit)
via 0903812b0b8c325913d766b793bbf9438ad6b423 (commit)
from 279b421bf8e42a41b5afee9a05916fe08e278f70 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=270a1aef1c938e7683fb338075c6db432c50bc0e
commit 270a1aef1c938e7683fb338075c6db432c50bc0e
Merge: 279b421 bc35087
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Dec 7 10:52:54 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Dec 7 10:52:54 2015 -0500
Merge topic 'cmake-E-copy-multiple-inputs' into next
bc35087d cmake: Teach -E copy_directory to support multiple input directories
98be140f cmake: Refine -E copy[_if_different] documentation
93cc80ae cmake: Refine -E copy_if_different implementation indentation
0903812b cmake: Refine -E chdir documentation
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc35087da3eb9039dad8fb5d27c1fab60b43f776
commit bc35087da3eb9039dad8fb5d27c1fab60b43f776
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Sun Dec 6 20:30:44 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Dec 7 10:51:27 2015 -0500
cmake: Teach -E copy_directory to support multiple input directories
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index d5e8505..4cbe976 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -174,8 +174,9 @@ Available commands are:
If multiple files are specified, the ``<destination>`` must be
directory and it must exist.
-``copy_directory <source> <destination>``
- Copy directory 'source' content to directory 'destination'.
+``copy_directory <dir>... <destination>``
+ Copy directories to ``<destination>`` directory.
+ If ``<destination>`` directory does not exist it will be created.
``copy_if_different <file>... <destination>``
Copy files to ``<destination>`` (either file or directory) if
diff --git a/Help/release/dev/cmake-E-copy-multiple-inputs.rst b/Help/release/dev/cmake-E-copy-multiple-inputs.rst
index 798af53..eeb1fab 100644
--- a/Help/release/dev/cmake-E-copy-multiple-inputs.rst
+++ b/Help/release/dev/cmake-E-copy-multiple-inputs.rst
@@ -3,3 +3,6 @@ cmake-E-copy-multiple-inputs
* The :manual:`cmake(1)` ``-E copy`` and ``-E copy_if_different`` command-line
tools learned to support copying multiple input files to a directory.
+
+* The :manual:`cmake(1)` ``-E copy_directory`` command-line
+ tool learned to support copying multiple input directories to a directory.
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index c823201..6a4234f 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -58,8 +58,8 @@ void CMakeCommandUsage(const char* program)
<< " compare_files file1 file2 - check if file1 is same as file2\n"
<< " copy <file>... destination - copy files to destination "
"(either file or directory)\n"
- << " copy_directory source destination - copy directory 'source' "
- "content to directory 'destination'\n"
+ << " copy_directory <dir>... destination - copy content of <dir>... "
+ "directories to 'destination' directory\n"
<< " copy_if_different <file>... destination - copy files if it has "
"changed\n"
<< " echo [<string>...] - displays arguments as text\n"
@@ -206,16 +206,22 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
}
// Copy directory content
- if (args[1] == "copy_directory" && args.size() == 4)
+ if (args[1] == "copy_directory" && args.size() > 3)
{
- if(!cmSystemTools::CopyADirectory(args[2], args[3]))
+ // If error occurs we want to continue copying next files.
+ bool return_value = 0;
+ for (std::string::size_type cc = 2; cc < args.size() - 1; cc ++)
{
- std::cerr << "Error copying directory from \""
- << args[2] << "\" to \"" << args[3]
- << "\".\n";
- return 1;
+ if(!cmSystemTools::CopyADirectory(args[cc].c_str(),
+ args[args.size() - 1].c_str()))
+ {
+ std::cerr << "Error copying directory from \""
+ << args[cc] << "\" to \"" << args[args.size() - 1]
+ << "\".\n";
+ return_value = 1;
+ }
}
- return 0;
+ return return_value;
}
// Rename a file or directory
diff --git a/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-directory-result.txt b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-directory-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-directory-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-directory-stderr.txt
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-file-result.txt b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-file-stderr.txt b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-file-stderr.txt
new file mode 100644
index 0000000..6ca3677
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-file-stderr.txt
@@ -0,0 +1,3 @@
+^Error copying directory from .* to .*file_for_test.txt\".*
+Error copying directory from .* to .*file_for_test.txt\".*
+Error copying directory from .* to .*file_for_test.txt\".$
diff --git a/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-not-exist-result.txt b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-not-exist-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-not-exist-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-not-exist-stderr.txt b/Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-not-exist-stderr.txt
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index dbc235d..57036ba 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -124,6 +124,23 @@ run_cmake_command(E_copy_if_different-three-source-files-target-is-file
unset(in)
unset(out)
+set(in ${RunCMake_SOURCE_DIR}/copy_input)
+set(out ${RunCMake_BINARY_DIR}/copy_directory_output)
+set(outfile ${out}/file_for_test.txt)
+file(REMOVE_RECURSE "${out}")
+file(MAKE_DIRECTORY ${out})
+file(WRITE ${outfile} "")
+run_cmake_command(E_copy_directory-three-source-files-target-is-directory
+ ${CMAKE_COMMAND} -E copy_directory ${in}/d1 ${in}/d2 ${in}/d3 ${out})
+run_cmake_command(E_copy_directory-three-source-files-target-is-file
+ ${CMAKE_COMMAND} -E copy_directory ${in}/d1 ${in}/d2 ${in}/d3 ${outfile})
+run_cmake_command(E_copy_directory-three-source-files-target-is-not-exist
+ ${CMAKE_COMMAND} -E copy_directory ${in}/d1 ${in}/d2 ${in}/d3 ${out}/not_existing_directory)
+unset(in)
+unset(out)
+unset(outfile)
+
+
run_cmake_command(E_env-no-command0 ${CMAKE_COMMAND} -E env)
run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1)
run_cmake_command(E_env-bad-arg1 ${CMAKE_COMMAND} -E env -bad-arg1)
diff --git a/Tests/RunCMake/CommandLine/copy_input/d1/d1.txt b/Tests/RunCMake/CommandLine/copy_input/d1/d1.txt
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/RunCMake/CommandLine/copy_input/d2/d2.txt b/Tests/RunCMake/CommandLine/copy_input/d2/d2.txt
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/RunCMake/CommandLine/copy_input/d3/d3.txt b/Tests/RunCMake/CommandLine/copy_input/d3/d3.txt
new file mode 100644
index 0000000..e69de29
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98be140fc0dc0bab8955c4fea9274ea52ac8cd9c
commit 98be140fc0dc0bab8955c4fea9274ea52ac8cd9c
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Sun Dec 6 20:30:44 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Dec 7 10:51:27 2015 -0500
cmake: Refine -E copy[_if_different] documentation
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 086f259..d5e8505 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -170,13 +170,18 @@ Available commands are:
Check if file1 is same as file2.
``copy <file>... <destination>``
- Copy files to 'destination' (either file or directory).
+ Copy files to ``<destination>`` (either file or directory).
+ If multiple files are specified, the ``<destination>`` must be
+ directory and it must exist.
``copy_directory <source> <destination>``
Copy directory 'source' content to directory 'destination'.
``copy_if_different <file>... <destination>``
- Copy files if input has changed. Destination could be file or directory.
+ Copy files to ``<destination>`` (either file or directory) if
+ they have changed.
+ If multiple files are specified, the ``<destination>`` must be
+ directory and it must exist.
``echo [<string>...]``
Displays arguments as text.
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93cc80aee59cfb328d541ba527d40239ab8348b1
commit 93cc80aee59cfb328d541ba527d40239ab8348b1
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Sun Dec 6 20:30:44 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Dec 7 10:51:14 2015 -0500
cmake: Refine -E copy_if_different implementation indentation
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 33700a1..c823201 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -197,8 +197,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
args[args.size() - 1].c_str()))
{
std::cerr << "Error copying file (if different) from \""
- << args[cc] << "\" to \"" << args[args.size() - 1]
- << "\".\n";
+ << args[cc] << "\" to \"" << args[args.size() - 1]
+ << "\".\n";
return_value = 1;
}
}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0903812b0b8c325913d766b793bbf9438ad6b423
commit 0903812b0b8c325913d766b793bbf9438ad6b423
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Sun Dec 6 20:30:44 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Dec 7 10:50:42 2015 -0500
cmake: Refine -E chdir documentation
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 0dc5a9a..33700a1 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -54,7 +54,7 @@ void CMakeCommandUsage(const char* program)
errorStream
<< "Usage: " << program << " -E <command> [arguments...]\n"
<< "Available commands: \n"
- << " chdir dir cmd [args]... - run command in a given directory\n"
+ << " chdir dir cmd [args...] - run command in a given directory\n"
<< " compare_files file1 file2 - check if file1 is same as file2\n"
<< " copy <file>... destination - copy files to destination "
"(either file or directory)\n"
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake.1.rst | 14 ++++++---
Help/release/dev/cmake-E-copy-multiple-inputs.rst | 3 ++
Source/cmcmd.cxx | 30 ++++++++++++--------
...ee-source-files-target-is-directory-result.txt} | 0
...ree-source-files-target-is-directory-stderr.txt | 0
...y-three-source-files-target-is-file-result.txt} | 0
...ry-three-source-files-target-is-file-stderr.txt | 3 ++
...ee-source-files-target-is-not-exist-result.txt} | 0
...ree-source-files-target-is-not-exist-stderr.txt | 0
Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 17 +++++++++++
.../RunCMake/CommandLine/copy_input/d1/d1.txt | 0
.../RunCMake/CommandLine/copy_input/d2/d2.txt | 0
.../RunCMake/CommandLine/copy_input/d3/d3.txt | 0
13 files changed, 51 insertions(+), 16 deletions(-)
copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CommandLine/E_copy_directory-three-source-files-target-is-directory-result.txt} (100%)
copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-directory-stderr.txt (100%)
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_copy_directory-three-source-files-target-is-file-result.txt} (100%)
create mode 100644 Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-file-stderr.txt
copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CommandLine/E_copy_directory-three-source-files-target-is-not-exist-result.txt} (100%)
copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/E_copy_directory-three-source-files-target-is-not-exist-stderr.txt (100%)
copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/copy_input/d1/d1.txt (100%)
copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/copy_input/d2/d2.txt (100%)
copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/copy_input/d3/d3.txt (100%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list