[CMake] Use of ADD_CUSTOM_COMMAND

Gib Bogle g.bogle at auckland.ac.nz
Tue Apr 19 22:31:05 EDT 2011


I'm a real cmake novice, and I find the cmake documentation hard to follow, 
because it assumes that you know what you're doing (and I obviously don't) and 
doesn't provide examples.  I simply want to add to CMakeLists.txt an instruction 
to copy the executable created to another directory.  I gather that I want to 
use ADD_CUSTOM_COMMAND, and naively I thought this might do it:

ADD_CUSTOM_COMMAND( TARGET fubar POST_BUILD COMMAND copy fubar.exe 
somepath/fubar.exe)

but although this doesn't trigger a cmake error, it doesn't do anything either, 
and doesn't even seem to change Makefile.  Can someone point me in the right 
direction?  I'm using MinGW tools on Windows.

Thanks
Gib


More information about the CMake mailing list