<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 12, 2010, at 11:43 AM, James C. Sutherland wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I would like to execute a command like:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>getrates -n &lt; myFileName</div><div><br></div><div>I am trying to add this so it is processed after the target "getrates" is built</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">set( infile ${CMAKE_CURRENT_BINARY_DIR}/myFileName )<br>add_custom_command( TARGET getrates<br>&nbsp;&nbsp;POST_BUILD<br>&nbsp;&nbsp;COMMAND "${CMAKE_CURRENT_BINARY_DIR}/getrates" " -n &lt; ${infile}"<br>&nbsp;&nbsp;WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}<br>&nbsp;&nbsp;VERBATIM<br>&nbsp;&nbsp;)</blockquote><div><br></div>
This does not seem to work, however. &nbsp;CMake doesn't handle the "&lt;" properly. &nbsp;Any ideas about how to stream the contents of a file?<div><br></div><div>Thanks,</div><div><br></div><div>James</div></div></blockquote></div><br><div>Got it. &nbsp;It looks like removing the "" from the arguments does the job, i.e.</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></blockquote>add_custom_command( TARGET getrates<br><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></blockquote>&nbsp;&nbsp;POST_BUILD<br><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></blockquote>&nbsp;&nbsp;COMMAND ${CMAKE_CURRENT_BINARY_DIR}/getrates -n &lt; ${infile}<br><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></blockquote>&nbsp;&nbsp;WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}<br><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></blockquote>&nbsp;&nbsp;VERBATIM<br><div>&nbsp;&nbsp;)</div></div></blockquote></body></html>