<div dir="ltr"><div><div><div><div><div>Hi all.<br><br></div>I need for my project use the Windows software tracing feature:<br><br><a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff556204%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/windows/hardware/ff556204%28v=vs.85%29.aspx</a><br>
<br></div>For this purpose need to call the "tracewpp.exe" utility with passing a list of project's source files (*.cpp) to them,<br></div>and then, the "tracewpp.exe" utility will create a set of the (*.tmh) header files.<br>
<br></div>So, I trying to create a custom QBS module "wpp/WppModule.qbs":<br><br><span style="color:rgb(128,128,0)">import</span><span style="color:rgb(192,192,192)"> </span>qbs<span style="color:rgb(192,192,192)"> </span>1.0
<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px">Module<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">property</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">string</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">wppTraceModuleHeadersDir</span>:<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">".tmh/"</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><a href="http://product.name">product.name</a></pre>

<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,0)">condition</span>:<span style="color:rgb(192,192,192)"> </span>qbs.hostOS.contains(<span style="color:rgb(0,128,0)">'windows'</span>)<span style="color:rgb(192,192,192)"> </span>&&<span style="color:rgb(192,192,192)"> </span>qbs.targetOS.contains(<span style="color:rgb(0,128,0)">'windows'</span>)<span style="color:rgb(192,192,192)"> </span>&&<span style="color:rgb(192,192,192)"> </span>qbs.toolchain.contains(<span style="color:rgb(0,128,0)">'msvc'</span>)</pre>

<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,0)">cpp.includePaths</span>:<span style="color:rgb(192,192,192)"> </span>product.buildDirectory<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">'/'</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">wppTraceModuleHeadersDir</span></pre>

<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span>Rule<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,0)">inputs</span>:<span style="color:rgb(192,192,192)"> </span>[<span style="color:rgb(0,128,0)">"cpp"</span>]</pre>

<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span>Artifact<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,0)">fileName</span>:<span style="color:rgb(192,192,192)"> </span>ModUtils.moduleProperty(product,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"wppTraceModuleHeadersDir"</span>)</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">                      </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">'/'</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>input.completeBaseName<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">".tmh"</span></pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,0)">fileTags</span>:<span style="color:rgb(192,192,192)"> </span>[<span style="color:rgb(0,128,0)">"tmh"</span>]</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span>}</pre>
<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,0)">prepare</span>:<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">var</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">wpp_exe</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"c:/Program</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Files/Windows</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Kits/8.0/bin/x86/tracewpp.exe"</span>;</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">var</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">wpp_cfg_dir</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"c:/Program</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Files/Windows</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Kits/8.0/bin/WppConfig/Rev1"</span>;</pre>

<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">var</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">args</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>input.fileName;</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="font-style:italic;color:rgb(41,133,199)">args</span>.push(<span style="color:rgb(0,128,0)">"-cfgdir:"</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">wpp_cfg_dir</span>);</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="font-style:italic;color:rgb(41,133,199)">args</span>.push(<span style="color:rgb(0,128,0)">"-odir:"</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>ModUtils.moduleProperty(product,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"wppTraceModuleHeadersDir"</span>));</pre>

<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">var</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">cmd</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">new</span><span style="color:rgb(192,192,192)"> </span>Command(<span style="font-style:italic;color:rgb(41,133,199)">wpp_exe</span>,<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">args</span>);</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="font-style:italic;color:rgb(41,133,199)">cmd</span>.description<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"generating</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">WPP</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span>output.fileName<span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">file"</span>;</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="font-style:italic;color:rgb(41,133,199)">cmd</span>.highlight<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"filegen"</span>;</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">cmd</span>;</pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span>}</pre>
<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span>}</pre>
<pre style="margin:0px;text-indent:0px">}</pre><br></div>and then in my project file I to do:<br><br><span style="color:rgb(128,128,0)">import</span><span style="color:rgb(192,192,192)"> </span>qbs.base<span style="color:rgb(192,192,192)"> </span>1.0

<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px">DynamicLibrary<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,0)">name</span>:<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"foo"</span></pre>

<pre style="margin:0px;text-indent:0px"><br></pre><pre style="margin:0px;text-indent:0px"></pre>        ...<br>        ...<br><pre style="margin:0px;text-indent:0px"><br></pre><pre style="margin:0px;text-indent:0px"></pre>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span>Depends<span style="color:rgb(192,192,192)"> </span>{<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">name</span>:<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"wpp"</span><span style="color:rgb(192,192,192)"> </span>}</pre>

<pre style="margin:0px;text-indent:0px"><br></pre>        ...<br>        ...<br><pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,0)">files</span>:<span style="color:rgb(192,192,192)"> </span>[</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,128,0)">"bar.cpp"</span>,</pre><pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span>]</pre>

<pre style="margin:0px;text-indent:0px">    <br></pre><pre style="margin:0px;text-indent:0px">}</pre><br><div>But in my case this does not work, the command do not called.. What I to do wrong?<br><br></div><div>Best regards,<br>
Denis<br></div><div><br><br></div></div>