Hi Gib,

Try the following:

GET_TARGET_PROPERTY(FUBAR_EXE fubar LOCATION)
ADD_CUSTOM_COMMAND(TARGET fubar POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FUBAR_EXE} somepath)

Cheers,

Fraser.



On 20/04/2011 03:31, Gib Bogle wrote:
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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to