[CMake] Use of ADD_CUSTOM_COMMAND
Michael Wild
themiwi at gmail.com
Wed Apr 20 00:14:23 EDT 2011
On 04/20/2011 05:47 AM, Gib Bogle wrote:
> It worked! Brilliant! Thanks very much. I have a lot to learn ...
>
> Gib
>
> Quoting Fraser Hutchison <fraser.hutchison at googlemail.com>:
>
>> 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.
OTOH, do you really want to copy the executable, or do you want it to be
generated somewhere else in the first place? In that case, there is the
CMAKE_RUNTIME_OUTPUT_DIRECTORY variable and the RUNTIME_OUTPUT_DIRECTORY
target property. Also, there are configuration specific versions, e.g.
CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG.
HTH
Michael
More information about the CMake
mailing list