[CMake] Copying files to runtime directory

Tyler Roscoe tyler at cryptio.net
Mon Sep 21 11:29:11 EDT 2009


On Mon, Sep 21, 2009 at 02:54:04PM +0200, Jeroen Dierckx wrote:
> In Windows, we need to copy a bunch of files (dlls and other runtime
> dependencies) to the runtime directory, mostly belonging to external
> dependencies. Those files are different for debug and release builds.
> So I created a function to do just that. I came across several
> problems or limitations in cmake while doing that. Here is how I did
> it, and some remarks for each step

I posted a thread last Thursday with similar questions.

The short version, I think, is that you really want to use install() for
these kinds of operations. install() already knows how to EXCLUDE, copy
files on a per-configuration basis, and update files when they are
out-of-date.

If you don't use install(), I think the types of hacks you mentioned
(copy all files, debug and release; manually handle exclusions) are the
only way to do what you want.

tyler


More information about the CMake mailing list