[CMake] get the target name in add_custom_command

Juan Sanchez Juan.Sanchez at amd.com
Tue Oct 9 15:19:21 EDT 2007


In this example, the target name foo has a different OUTPUT_NAME.  How
do I tell ADD_CUSTOM_COMMAND to use the real name of the target when I
try to use the copy command within?

ADD_CUSTOM_COMMAND(TARGET foo POST_BUILD COMMAND ${CMAKE_COMMAND} -E
copy foo ${PROJECT_SOURCE_DIR}/${INSTALL_DIR})

Thanks,

Juan





More information about the CMake mailing list