[CMake] Simple file copy

Brandon J. Van Every bvanevery at gmail.com
Wed Nov 22 12:59:21 EST 2006


Martin Lütken wrote:
> Thanks a lot!
> But the name CONFIGURE_FILE suggest it happens before the build.
> Is that so? I need to copy lib files after build!
>   


I didn't really understand the rest of the post; perhaps some context 
got snipped.  Going by the subject line, I think what you want is an 
ADD_CUSTOM_COMMAND or ADD_CUSTOM_TARGET containing:

COMMAND ${CMAKE_COMMAND} -E copy myfile mydestination

or perhaps

COMMAND ${CMAKE_COMMAND -E copy_if_different in-file out-file

You can type "cmake -E" on the command line to learn what all the -E 
options are.  The -E option is in the documentation, but the things you 
can do with -E are not.  I filed this as bug #3778; it has been assigned 
to someone, but nothing has happened on it yet.  I'll ping the bug since 
this came up on the list.

It's also possible that what you really want are INSTALL commands, 
depending on what you want to do.  Read the docs for those.


Cheers,
Brandon Van Every



More information about the CMake mailing list