[CMake] cmake copy command problem

Juan Sanchez Juan.Sanchez at amd.com
Tue Oct 9 15:33:52 EDT 2007


Since I must copy a target after it's built, I synthesize a compile time
install command.

Unfortunately, the copy command obliterates the destination directory
with a copy of the file being created.

This seems to be contrary to the "cmake -E help" documentation:
copy file destination   - copy file to destination (either file or
directory)

Am I somehow using the make_directory and copy commands incorrectly?  My
code is below.

Thanks,

Juan

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





More information about the CMake mailing list