[cmake-developers] [PATCH] Extend copy and copy_if_different commands with support multiple files

Bartosz Kosiorek Bartosz.Kosiorek at tomtom.com
Thu Dec 3 11:05:52 EST 2015


Hi.

I would like to create following tests for copy and copy_if_different commands:

cmake -E copy test_copy_command_dir/file1.txt test_copy_command_dir/target_directory1
Result: success
  E_copy-one-source-directory-target-is-directory-result.txt
  E_copy-one-source-directory-target-is-directory-stderr.txt

cmake -E copy test_copy_command_dir/directory1/file4.txt
Result: error
    E_copy-one-source-file-result.txt
    E_copy-one-source-file-stderr.txt

cmake -E copy test_copy_command_dir/file1.txt test_copy_command_dir/file2.txt  test_copy_command_dir/file3.txt test_copy_command_dir/target_directory2
Result: Success
   E_copy-three-source-files-target-is-directory-result.txt
   E_copy-three-source-files-target-is-directory-stderr.txt

cmake -E copy test_copy_command_dir/file1.txt test_copy_command_dir/file2.txt  test_copy_command_dir/file3.txt test_copy_command_dir/target_directory1/file4.txt
Result: Error
   E_copy-three-source-files-target-is-file-result.txt 
   E_copy-three-source-files-target-is-file-stderr.txt

cmake -E copy test_copy_command_dir/file1.txt not_existing_file.bad test_copy_command_dir/file2.txt   test_copy_command_dir/target_directory3
Result: Error. The correct files are copied successfuly
   E_copy-two-good-and-one-bad-source-files-target-is-directory-result.txt
   E_copy-two-good-and-one-bad-source-files-target-is-directory-stderr.txt

cmake -E copy test_copy_command_dir/*.txt test_copy_command_dir/target_directory4
Result: Success
   E_copy-wildcard-source-files-target-is-directory-result.txt
   E_copy-wildcard-source-files-target-is-directory-stderr.txt

cmake -E copy test_copy_command_dir/* test_copy_command_dir/directory1/file4.txt
Result: Error
   E_copy-wildcard-source-files-target-is-file-result.txt
   E_copy-wildcard-source-files-target-is-file-stderr.txt

The resource directory will be:
test_copy_command_dir
├── directory1
│   ├── file4.txt
│   └── file5.txt
├── directory2
├── file1.txt
├── file2.txt
├── file3.txt
├── target_directory1
├── target_directory2
├── target_directory3
└── target_directory4

What do you think about that?
After every step I will need to clean it up .
________________________________________
From: cmake-developers <cmake-developers-bounces at cmake.org> on behalf of Brad King <brad.king at kitware.com>
Sent: Thursday, December 3, 2015 2:45 PM
To: cmake-developers at cmake.org
Subject: Re: [cmake-developers] [PATCH] Extend copy and copy_if_different commands with support multiple files

On 12/02/2015 07:05 PM, Bartosz Kosiorek wrote:
> This patch allows to use multiple files in commands "copy" and "copy_if_different".

Good, thanks.  Please also extend the Tests/RunCMake/CommandLine test to
cover this these operations.

Thanks,
-Brad

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


More information about the cmake-developers mailing list