<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 < 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> POST_BUILD<br> COMMAND "${CMAKE_CURRENT_BINARY_DIR}/getrates" " -n < ${infile}"<br> WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}<br> VERBATIM<br> )</blockquote><div><br></div>
This does not seem to work, however. CMake doesn't handle the "<" properly. 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. 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> 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> COMMAND ${CMAKE_CURRENT_BINARY_DIR}/getrates -n < ${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> 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> VERBATIM<br><div> )</div></div></blockquote></body></html>