I have a CMake project and I need to copy files from one folder to another and do some additional renaming with the following pattern:
"xy-1" will be "abcd1", "xy-2" will be "abcd2", ..., "xy-123" will be "abcd123"
Currently I´m trying this with add_custom_command() and in general it works for a simpler pattern like
"xy-1" will be "abc1", "xy-2" will be "abc2", ..., "xy-123" will be "abc123",
I´m doing it with
COMMAND copy "${path_to_source_folder}xy-*.txt" "${path_to_destination_folder}abc*.txt"
In the working pattern the number of characters before the asterisk are the same for the source- and the destination-name.
But in the not working pattern, there are 3 characters in the source-name and four characters in the destination-name before the asterisk:
COMMAND copy "${path_to_source_folder}xy-*.txt" "${path_to_destination_folder}abcd*.txt"
This not working. There is no error coming from cmake, but it will not copy all files (only the first 99) and the names are not created properly.
A quick fix would be to list all (400+) files explicitly, but I´d like to avoid this ;-)
How to do this with add_custom_command() or if this is not possible, how to do it in another way?
Many thanks for your help!
Cheers Daniel
Upate: Thanks for the hints in the comments! I´m running on Windows 10 and using powershell for running cmake.