[CMake] Copying a cmake generated VisualStudio project file to another directory
Antje Kühn
antje.kuehn at online.de
Wed May 9 10:12:05 EDT 2012
Hi,
I'm using CMake 2.8.7 to generate VC++ 2010 project files on Windows 7.
At my CMakeLists.txt files I defined the following:
add_executable(VSData ${SRC} ${INC})
Target_link_libraries(VSData ${SOME_LIBS})
Now I start cmake from my build directory with:
>cmake -G "Visual Studio 10" ..
This works and I get the *.vcxproj files in build/VSData.
Now I want to copy the generated project files to another place at my file
system.
For this I added the following command at the end to my CMakeLists.txt:
add_custom_command(TARGET VSData
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${CMAKE_BINARY_DIR}/VSData/VSData.vcxproj ${destDir}
VERBATIM)
I also tried this:
add_custom_command(TARGET VSData.vcxproj
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy $<TARGET_FILE: VSData.vcxproj> ${destDir} VERBATIM)
But nothing happens! No error message, no warnings and the file will not be
copied!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120509/c43523ca/attachment.htm>
More information about the CMake
mailing list