<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Consolas" size="2"><span style="font-size:10.5pt;">
<div>Hi David,</div>
<div> </div>
<div>We are executing the following POST_BUILD commands using add_custom_command() call in cmake.</div>
<div> </div>
<div>add_custom_command(</div>
<div>        TARGET ${TARGETNAME}</div>
<div>        POST_BUILD COMMAND ${TBIN}/VerCheck.exe \"$(TargetPath)\"</div>
<div>        POST_BUILD COMMAND copy \"$(TargetPath)\" \"$(TargetPath).vercheck_dummy_target\"</div>
<div>        COMMENT "Checking if $(TargetPath) has version info...")</div>
<div> </div>
<div>The issue we are facing is with the execution of the post-build command ${TBIN}/VerCheck.exe \"$(TargetPath)\". It gives the following error:</div>
<div> </div>
<div>  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(134,5): <span style="background-color:yellow;"><b>error MSB3073</b></span>: The command "setlocal\r [E:\RaviRaman\Project\Auto</div>
<div>Desk\Source\AutoDesk_Project\autodesk_project\XoriantRepo\components\global\src\objectdbx\build\x64\versioninfo\GenVerInfo.vcxproj]</div>
<div>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(134,5): <span style="background-color:yellow;"><b>error MSB3073</b></span>: ..\..\..\..\..\..\..\develop\tools\bin\VerCheck.exe</div>
<div>"E:\RaviRaman\Project\AutoDesk\Source\AutoDesk_Project\autodesk_project\XoriantRepo\components\global\src\objectdbx\build\x64\versioninfo\Debug\GenVerInfo_d.exe"\r [E:\RaviRaman\Project\AutoDesk\Source\AutoDesk_Project\autodesk_project\XoriantRepo\components\global\src\objectdbx\build\x64\versioninfo\GenVerInfo.vcxproj]</div>
<div> </div>
<div>Also, note the following:</div>
<div>1. The execution is successful and there is no error when I keep only the copy command and comment out the command ${TBIN}/VerCheck.exe \"$(TargetPath)\"</div>
<div>2. VerCheck.exe is a project specific executable which checks the version of the specified target</div>
<div>3. All the variables above in ${...} are getting correctly replaced. So, that is not an issue.</div>
<div>4. We are able to execute both the commands ${TBIN}/VerCheck.exe and copy successfully from the DOS command line.</div>
<div> </div>
<div> </div>
<div>Thanks & Regards</div>
<div> </div>
<div>Ravi Raman </div>
<div>Xoriant Solutions Pvt. Ltd</div>
<div>4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA. </div>
<div>Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip Extn:1178| Fax: +91 22 30511111 </div>
<div>ravi.raman@xoriant.com| <a href="http://www.xoriant.com">http://www.xoriant.com</a></div>
<div> </div>
<div> </div>
<div>-----Original Message-----<br>

From: Ravi Raman <br>

Sent: Thursday, July 31, 2014 5:07 PM<br>

To: 'David Cole'<br>

Cc: cmake@cmake.org<br>

Subject: RE: [CMake] Cmake issue regarding conversion of existing Visual Studio .targets files to cmake</div>
<div> </div>
<div>Hi David,</div>
<div> </div>
<div>Thanks for the reply. Understood. </div>
<div>Will use the cmake function add_custom_command() with POST_BUILD option in case of after build and PRE_BUILD option in case of before build.</div>
<div> </div>
<div>Thanks & Regards</div>
<div> </div>
<div>Ravi Raman </div>
<div>Xoriant Solutions Pvt. Ltd</div>
<div>4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA. </div>
<div>Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip Extn:1178| Fax: +91 22 30511111 </div>
<div>ravi.raman@xoriant.com| <a href="http://www.xoriant.com">http://www.xoriant.com</a></div>
<div> </div>
<div> </div>
<div>-----Original Message-----</div>
<div>From: David Cole [<a href="mailto:dlrdave@aol.com">mailto:dlrdave@aol.com</a>] </div>
<div>Sent: Thursday, July 31, 2014 4:55 PM</div>
<div>To: Ravi Raman</div>
<div>Cc: cmake@cmake.org</div>
<div>Subject: Re: [CMake] Cmake issue regarding conversion of existing Visual Studio .targets files to cmake</div>
<div> </div>
<div>So from the example you've sent, it seems like the stuff in your </div>
<div>targets file is just a bunch of custom commands that you'd need to run. </div>
<div>There are plenty of examples of projects using add_custom_command and </div>
<div>add_custom_target out there, and if you have specific questions about </div>
<div>how those commands work, do send more emails and ask those questions.</div>
<div> </div>
<div>I don't think there's anything out there that will help you automate </div>
<div>this task.... but if there is, hopefully somebody who can point you to </div>
<div>them will show up here.</div>
<div> </div>
<div>Otherwise, it's just "roll up your sleeves" time, and do the work </div>
<div>manually to convert targets files into CMakeLists that use </div>
<div>add_custom_command.</div>
<div> </div>
<div> </div>
<div>Cheers,</div>
<div>David C.</div>
<div> </div>
<div> </div>
</span></font>
</body>
</html>