title: How do I set a property to the output of a command in msbuild/xbuild
body: <p>In msbuild/xbuild I'd like to have a "libPath" property which can be ovveridden on the commandline using <code>/p:libpath="/path/to/all/libs"</code>. But when this property is undefined I want to call <code>pkg-config --retrieve-Path somePackage</code> to get the current systems path.</p>
  
  <p>I thought like <a href="https://stackoverflow.com/questions/1487887/setting-ant-property-with-bash-command-result">here</a> I need the output of a command to be stored in a Property.<br>
  The command always returns one line of output.</p>
  
  <p>I have tryied something like </p>
  
  <pre><code>&lt;PropertyGroup&gt;
    &lt;LibPath /&gt;
  &lt;/PropertyGroup&gt;
  
  &lt;Task ....&gt;
    &lt;Exec Command="pkg-config --retrieve-Path somePackage"
          Condition="$(LibPath)' == ''"&gt;
     &lt;OutputTaskParameter="output"
            PropertyName="LibPath" /&gt;
    &lt;/Exec&gt;
  &lt;/Task&gt;
  </code></pre>
  
  <p>But that didn't work.</p>