<div dir="ltr">Hello,<div><br></div><div>Yesterday i finally decided to start porting my project to qbs. I really like ideas behind qbs and feel that it worth time i'll spend on porting.</div><div><br></div><div>Can someone help me with my first problem? In qmake i write:</div><div>
<pre style="margin-top:0px;margin-bottom:0px">!minQtVersion(5,<span style="color:rgb(192,192,192)"> </span>0,<span style="color:rgb(192,192,192)"> </span>0)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">message</span>("Cannot<span style="color:rgb(192,192,192)"> </span>build<span style="color:rgb(192,192,192)"> </span>Valentina<span style="color:rgb(192,192,192)"> </span>with<span style="color:rgb(192,192,192)"> </span>Qt<span style="color:rgb(192,192,192)"> </span>version<span style="color:rgb(192,192,192)"> </span>$${<span style="color:rgb(128,0,128)">QT_VERSION</span>}.")</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">error</span>("Use<span style="color:rgb(192,192,192)"> </span>at<span style="color:rgb(192,192,192)"> </span>least<span style="color:rgb(192,192,192)"> </span>Qt<span style="color:rgb(192,192,192)"> </span>5.0.0.")</pre>
<pre style="margin-top:0px;margin-bottom:0px">}</pre></div><div><br></div><div>Code for the function:</div><div>
<pre style="margin-top:0px;margin-bottom:0px">defineTest(minQtVersion)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>maj<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>$$1</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>min<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>$$2</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>patch<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>$$3</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>isEqual(<span style="color:rgb(128,0,128)">QT_MAJOR_VERSION</span>,<span style="color:rgb(192,192,192)"> </span>$$maj)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>isEqual(<span style="color:rgb(128,0,128)">QT_MINOR_VERSION</span>,<span style="color:rgb(192,192,192)"> </span>$$min)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>isEqual(<span style="color:rgb(128,0,128)">QT_PATCH_VERSION</span>,<span style="color:rgb(192,192,192)"> </span>$$patch)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span>return(true)</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>greaterThan(<span style="color:rgb(128,0,128)">QT_PATCH_VERSION</span>,<span style="color:rgb(192,192,192)"> </span>$$patch)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span>return(true)</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>greaterThan(<span style="color:rgb(128,0,128)">QT_MINOR_VERSION</span>,<span style="color:rgb(192,192,192)"> </span>$$min)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>return(true)</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>greaterThan(<span style="color:rgb(128,0,128)">QT_MAJOR_VERSION</span>,<span style="color:rgb(192,192,192)"> </span>$$maj)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>return(true)</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>return(false)</pre>
<pre style="margin-top:0px;margin-bottom:0px">}</pre></div><div><br></div><div>How can i repeat the same with qbs?</div><div><br></div><div>Of course, i can skip this part and go further, but i rather not if i can.</div><div><br></div><div>Best regards,</div><div>RomanĀ </div></div>