[CMake] Copying directories as post build events without losing parent directory

Robert Dailey rcdailey.lists at gmail.com
Mon Dec 7 16:53:02 EST 2015


I have a custom target which runs a command similar to this:

$ cmake -E copy_directory foo bar

The problem is that the contents of "foo" are copied inside of "bar",
instead of it creating a directory "bar/foo" and putting the contents
in there.

Is there a way to make copy_directory behave like this? If not, I
guess my only option is to create a little CMake script that runs
file(INSTALL) to copy the directories like I want.


More information about the CMake mailing list