View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015703CMakeCMakepublic2015-08-18 07:252016-05-02 08:30
ReporterBartosz 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformallOSOSXOS Version10.10
Product VersionCMake 3.2.3 
Target VersionCMake 3.5Fixed in VersionCMake 3.5 
Summary0015703: "cmake -E copy" support for multiple files
DescriptionThe copy operation is not support wildcart (star "*") when the full path is specified. But it is working correctly with "remove.
"cmake -E remove" is not consistent with "cmake -E copy".

With using cmake shell comamnd you could add star to whole path:
   cmake -E remove /Users/warsaw/cos/*.h

But it is not possible to make similar operation with "-E copy":
   cmake -E copy /Users/warsaw/cos/*.h ..
displays "CMakre Error"

But:
   cmake -E copy *.h ..
or:
   cmake -E copy /Users/warsaw/cos/file.h ..

is working correctly.


Steps To Reproduce1. mkdir /Users/warsaw/cos/
2. cd /Users/warsaw/cos/
3. touch file.h
4. cmake -E copy /Users/warsaw/cos/*.h ..

displays "CMakre Error"



Working correctly:
   cmake -E copy *.h ..
   cmake -E copy /Users/warsaw/cos/file.h ..
TagsNo tags attached.
Attached Files

 Relationships
related to 0015870closedKitware Robot "cmake -E copy" command do not display error if source is directory 

  Notes
(0039296)
Brad King (manager)
2015-08-18 09:20

According to the documentation:

 http://www.cmake.org/cmake/help/v3.3/manual/cmake.1.html#command-line-tool-mode [^]

The two relevant "cmake -E" signatures are:

 copy <file> <destination>

and:

 remove [-f] [<file>...]

The "remove" signature documents support for multiple files but "copy" does not. In your example the wildcard is expanded by the shell so CMake sees many arguments.
(0039300)
Bartosz (reporter)
2015-08-18 15:02

Thanks Brad.

If wildcard is expanded by shell, then why command:
   cmake -E copy *.h ..

is working correctly.
Is should also not working, as it will be expanded by shell into multiple arguments.
(0039301)
Brad King (manager)
2015-08-18 15:16

Re 0015703:0039300: If there is only one .h file then the shell wildcard will expand to just that one value as if it had been spelled out explicitly.
(0039939)
Bartosz (reporter)
2015-12-02 15:53

Additional notes:

At Source/cmcmd.cxx there is implementation of "cmake -E" commands.
In this case the wildcard is expected to be expanded by the shell,
so what we really want is for the copy command to support multiple
inputs and a single (directory) output. The semantics should match
the UNIX "cp" command as much as possible.
(0039953)
Brad King (manager)
2015-12-04 10:35

Corresponding mailing list thread:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/15139/focus=15154 [^]
(0039954)
Brad King (manager)
2015-12-04 10:36

Patches from mailing list applied:

 cmake: Improve '-E' help message formatting
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0be5020b [^]

 cmake: Teach -E copy[_if_different] to support multiple files
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=384ae551 [^]
(0040978)
Robert Maynard (manager)
2016-05-02 08:30

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-08-18 07:25 Bartosz New Issue
2015-08-18 09:20 Brad King Note Added: 0039296
2015-08-18 09:20 Brad King Severity minor => feature
2015-08-18 09:20 Brad King Summary "cmake -E copy" is not working with wildcart, when full path is specified => "cmake -E copy" support for multiple files
2015-08-18 15:02 Bartosz Note Added: 0039300
2015-08-18 15:16 Brad King Note Added: 0039301
2015-12-02 15:53 Bartosz Note Added: 0039939
2015-12-03 08:41 Brad King Relationship added related to 0015870
2015-12-04 10:35 Brad King Note Added: 0039953
2015-12-04 10:36 Brad King Note Added: 0039954
2015-12-04 10:37 Brad King Status new => resolved
2015-12-04 10:37 Brad King Resolution open => fixed
2015-12-04 10:37 Brad King Fixed in Version => CMake 3.5
2015-12-04 10:37 Brad King Target Version => CMake 3.5
2016-05-02 08:30 Robert Maynard Note Added: 0040978
2016-05-02 08:30 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team