[CMake] Post Build Custom Copy Command

Brandon Van Every bvanevery at gmail.com
Thu Aug 9 16:21:09 EDT 2007


On 8/9/07, Prashanth Udupa <prashanth.udupa at gmail.com> wrote:
> Hi All,
>
> I am using a custom post build command.
>
> ADD_CUSTOM_COMMAND(
>     TARGET mylib
>     POST_BUILD
>     COMMAND copy ARGS
> ${MYLIBRARY_SOURCE_DIR}/lib/release/mylib.dll
> ${MYLIBRARY_SOURCE_DIR}/bin/release
>     COMMAND copy ARGS
> ${MYLIBRARY_SOURCE_DIR}/lib/release/mylib.lib
> ${MYLIBRARY_SOURCE_DIR}/lib
> )
>
> Since copy does not accept file names of the form
> D:/SomeFolder/SomOtherFolder/ and only of the form
> D:\SomeFolder\SomOtherFolder\,
> the copy command is failing. How can I make this post build command work?

As per the docs, FILE(TO_NATIVE_PATH path result) can help with that
sort of thing.  Granted, you'd have to read the docs many many times
before knowing details like that.

${CMAKE_COMMAND} -E copy
is also useful.

Finally, you don't need ARGS statements.  That's old style.


Cheers,
Brandon Van Every


More information about the CMake mailing list