Dear List,

I've got a question on copying some files from one directory to another using CMake.

Let's say, I got some libraries collected in a special directory. I want CMake to copy these libs to the distribution directory of my project. Using add_custom_command, I managed to have CMake copy my .exe to the distribution directory, but when I try to do this for my libraries something goes terribly wrong.

add_custom_command( TARGET MagicRPG POST_BUILD
        COMMAND copy \"$(TargetPath)\" .\\dist\\bin )

is what I did to copy my exe. When I use this

add_custom_command( TARGET MagicRPG POST_BUILD
COMMAND copy \"$(TargetPath)\" \"${SDKS_BASE_DIR}/SDL/lib/SDL.dll\" .\\dist\\bin)

to get SDL.dll copied to dist/bin Visual Studio fails with message

Fehler 1 error MSB3073: Der Befehl "copy "D:\Projekte\cpp\games\Magic\bin\Debug\MagicRPG.exe" "D:/SDKs/SDL/lib/SDL.dll" .\dist\bin
if errorlevel 1 goto VCReportError
:VCEnd" wurde mit dem Code 1 beendet. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 113 6 MagicRPG

Can anybody please help me with the right syntax for copying multiple files at POST_BUILD?

Best

Michael

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to