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

Brad King brad.king at kitware.com
Fri Dec 4 13:21:37 EST 2015


On 12/04/2015 11:15 AM, Bartosz Kosiorek wrote:
> we cannot use file(GLOB), because it is executed during generate step,
> and we would like to copy files which is created during Build step.

The custom commands always execute inside a shell that can do
glob expansion.

Alternatively, use a "cmake -P myscript.cmake" to script the copy
with e.g. file(COPY) optionally with file(GLOB).

Generally we don't recommend globbing because it can accidentally
get stale files.  If you are creating files during the build step,
don't you know what files are being created?

-Brad



More information about the cmake-developers mailing list