<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">i have <code>QT += quick</code> in one of my qmake project files. Because I build several projects within my subdirs project, I want certain target environments to compile only the stuff that does not depend on graphical stuff because the targets are headless.</p>
<p dir="auto">So I decided to entirely skip the build of the gui dependent pro files via</p>
<pre><code>qtHaveModule(quick){
DEFINES += \
	BLABLA_UI_LIBRARY
QT += quick

[...]
}
else
{
message("QtQuick not available, skipping building the blabla-ui lib")
}
</code></pre>
<p dir="auto">However those headless systems fail to run qmake. They successfully print the error message that <code>quick</code> is not available and afterwards fail nonetheless:</p>
<pre><code>Project MESSAGE: QtQuick not available, skipping building the blabla ui lib
Project ERROR: Unknown module(s) in QT: gui
</code></pre>
<p dir="auto">Any ideas what to do further? Thanks in advance.</p>
<p dir="auto">The full log, starting with the skip is here:</p>
<p dir="auto"><a href="https://gist.github.com/darkmattercoder/e82b62638ec76597fb7365e1cf404275" target="_blank" rel="noopener noreferrer nofollow ugc">https://gist.github.com/darkmattercoder/e82b62638ec76597fb7365e1cf404275</a></p>
]]></description><link>https://forum.qt.io/topic/110605/despite-skipping-a-pro-file-via-qthavemodule-quick-qmake-fails-due-to-missing-gui-module</link><generator>RSS for Node</generator><lastBuildDate>Mon, 28 Sep 2026 03:08:40 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/110605.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Jan 2020 09:53:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module on Mon, 13 Jan 2020 13:22:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/devjb">@<bdi>devjb</bdi></a> said in <a href="/post/572115">Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module</a>:</p>
<blockquote>
<p dir="auto">this is was I was looking for and gives me the correct results that I am expecting.</p>
</blockquote>
<p dir="auto">Sorry, I have readed too fast your post! Yes, using <code>requires()</code> is the right way to do what you want!</p>
]]></description><link>https://forum.qt.io/post/572116</link><guid isPermaLink="true">https://forum.qt.io/post/572116</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Mon, 13 Jan 2020 13:22:01 GMT</pubDate></item><item><title><![CDATA[Reply to Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module on Mon, 13 Jan 2020 13:10:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> thanks for the clarification</p>
<p dir="auto">Well, my approach was even wrong in the first place.<br />
What I wanted to achieve is done  via one line in the <code>*.pro</code> file:</p>
<pre><code>requires(qtHaveModule(quick))
</code></pre>
<p dir="auto">this is was I was looking for and gives me the correct results that I am expecting.</p>
]]></description><link>https://forum.qt.io/post/572115</link><guid isPermaLink="true">https://forum.qt.io/post/572115</guid><dc:creator><![CDATA[devjb]]></dc:creator><pubDate>Mon, 13 Jan 2020 13:10:37 GMT</pubDate></item><item><title><![CDATA[Reply to Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module on Mon, 13 Jan 2020 11:11:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/devjb">@<bdi>devjb</bdi></a> said in <a href="/post/572085">Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module</a>:</p>
<blockquote>
<p dir="auto">I simply want to get at least a kind of understanding of what goes on here.</p>
</blockquote>
<p dir="auto">As describe here ==&gt; <a href="https://doc.qt.io/qt-5/qtgui-index.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qtgui-index.html</a><br />
GUI module is included by default and must be removed if not required/used</p>
]]></description><link>https://forum.qt.io/post/572089</link><guid isPermaLink="true">https://forum.qt.io/post/572089</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Mon, 13 Jan 2020 11:11:44 GMT</pubDate></item><item><title><![CDATA[Reply to Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module on Mon, 13 Jan 2020 10:37:43 GMT]]></title><description><![CDATA[<p dir="auto">Well, that was a quick and obvious fix... worked</p>
<p dir="auto">However, I do not understand why the error appears in the first place. Because qmake should not process the file at all.<br />
I have several other project files, some of them contain <code>QT-=gui</code> and some of them don't, however they all build successfully, even those where I did not put that in.</p>
<p dir="auto">Furthermore, the project file in question is practically empty beside the <code>qthavemodule</code> check, so why tries qmake to do something else afterwards.</p>
<p dir="auto">I simply want to get at least a kind of understanding of what goes on here.</p>
]]></description><link>https://forum.qt.io/post/572085</link><guid isPermaLink="true">https://forum.qt.io/post/572085</guid><dc:creator><![CDATA[devjb]]></dc:creator><pubDate>Mon, 13 Jan 2020 10:37:43 GMT</pubDate></item><item><title><![CDATA[Reply to Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module on Mon, 13 Jan 2020 10:23:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/devjb">@<bdi>devjb</bdi></a> said in <a href="/post/572076">Despite skipping a *.pro file via qtHaveModule(quick), qmake fails due to missing gui module</a>:</p>
<blockquote>
<p dir="auto">Project ERROR: Unknown module(s) in QT: gui</p>
</blockquote>
<p dir="auto">If you don't you <code>gui</code>, you should insert in your PRO file <code>QT -= gui</code></p>
<pre><code>qtHaveModule(quick){
DEFINES += \
	BLABLA_UI_LIBRARY
QT += quick

[...]
}
else
{
    message("QtQuick not available, skipping building the blabla-ui lib")
    QT -= gui
}
</code></pre>
]]></description><link>https://forum.qt.io/post/572082</link><guid isPermaLink="true">https://forum.qt.io/post/572082</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Mon, 13 Jan 2020 10:23:46 GMT</pubDate></item></channel></rss>