Copy target file to another location in a post build step in CMake
I have a dynamic library that gets a different name depending on configuration, specified in the CMake scripts by: set_target_properties(${name} PROPERTIES OUTPUT_NAME ${outputName}64) set_target_properties(${name} PROPERTIES DEBUG_OUTPUT_NAME ${outputName}64_d) The end result is that I get a different name on release and debug builds. I would like to copy the resulting library to a different directory as a post-build step, but the gift(?) of CMake-Fu did not smile upon yours truly. I have tried doing this: GET_TARGET_PROPERTY(origfile mylibrary LOCATION) STRING(REGEX REPLACE "/" "\\\\"