Your initial attempt looks reasonable... Did you try it without the "VERBATIM" argument to the ADD_CUSTOM_COMMAND?<br><br>This sort of copy command should work if invoked from Visual Studio, even with the $(OutDir) reference...<br>
<br><br>HTH,<br>David<br><br><br><div class="gmail_quote">On Sun, Jun 1, 2008 at 10:29 AM, Pečiva Jan <<a href="mailto:peciva@fit.vutbr.cz">peciva@fit.vutbr.cz</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dears cmakers,<br>
<br>
I am about to finish my "dual gui/console" behaviour for InventorTools utilities. Compilation of whole set of executables is perfectly handled by cmake, but final "installation" procedure does not work.<br>
<br>
Can cmake handle this situation?:<br>
<br>
1. cmake builds all the executables of the projects<br>
"Dual" behaviour requires .com suffix, so all *.com are placed in<br>
the build directories. On MSVC, it is usually at<br>
build/(project_name)/(debug|release)/*.com<br>
This works perfectly.<br>
<br>
2. The last project makes one .exe for "dual" behaviour. It is called<br>
autoconsole.exe. Before using cmake, I copied autoconsole.exe to all other<br>
build directories to reside together with their .com and renamed them to<br>
the same name as .com except with .exe suffix. This worked perfectly using<br>
post-build script, but how to make it with cmake?<br>
<br>
I unsuccessfully tried two options:<br>
<br>
- to make post-build step by<br>
<br>
add_custom_command (TARGET autoconsole<br>
POST_BUILD<br>
COMMAND ${CMAKE_COMMAND} -E copy<br>
${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/autoconsole.exe<br>
${ivview_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ivview.exe<br>
COMMENT "Copying executables..." VERBATIM)<br>
<br>
This does not work because ${CMAKE_CFG_INITDIR} is set to $(IntDir) on Visual Studio. So, the copy command fails because it expect regular path. (And $(IntDir) differs among different debug/release configurations).<br>
<br>
- to make it part of install process by<br>
<br>
install (TARGETS autoconsole<br>
RUNTIME<br>
DESTINATION bin<br>
RENAME ivview.exe)<br>
<br>
It copies the file, but RENAME does not work (It probably works only for PROGRAMS and FILES signatures). I was planning to use this command about ten times to get all the required .exe.<br>
<br>
<br>
Please, is there any way how to proceed, to get all of about ten .exe<br>
executables to their places, either with their .com counterparts (preferred), or to final install destination?<br>
<br>
Thanks,<br>
John<br>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br>