I am working on CMake for generating the visual studio files. I would like to add the xyz.dll in the same folder where abc.exe is residing.
I had read somewhere that when i manually copy the xyz.dll
file into the same folder where abc.exe
is residing then the problem would be solved. But every time it is not possible.. I want to write the CMake command so that it will find the xyz.dll
file and copy into the same folder where the abc.exe
is residing..
Following mentioned are the paths where the .exe
and .dll
file is residing in my PC.
${MyWorkSpace_ROOT_DIR}/algoCommon/pthread/dll/xyz.dll
${MyWorkSpace_ROOT_DIR}/xml/addAlgo/.../cmakeOut.VS12/Debug/abc.exe
abc is my Project and i would like to confirm whether the following mentioned is wrong or not.
add_custom_command(TARGET abc PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${MyWorkSpace_ROOT_DIR}/algoCommon/pthread/dll"
$<{MyWorkSpace_ROOT_DIR}/xml/addAlgo/.../cmakeOut.VS12/Debug/:abc>)
If this is wrong kindly correct me.
If it is correct then I would like to ask few doubts..
will this command automatically copies the xyz.dll
files into the folder abc.exe
is residing or something else is happening here??