<?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[How to create multiple build configurations in .pro]]></title><description><![CDATA[<p dir="auto">I am trying to create four different buid configurations and use my .pro to set up configuration differences between them. I put the full details in a stackoverflow question (<a href="https://stackoverflow.com/questions/63082818/how-to-create-multiple-build-configurations-in-qt" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/63082818/how-to-create-multiple-build-configurations-in-qt</a>).</p>
<p dir="auto">The problem is that I am not getting different builds. I have a debug and a release, but I cannot get it to create the non-GUI version of debug and release. This is what I expected to work.</p>
<pre><code>build_pass:CONFIG(Debug) {
message("this is a debug build")
TARGET = "Project_D"
message($${TARGET})
DESTDIR = $$HOME/debug
}

build_pass:CONFIG(DebugHeadless) {
message("this is a debug build")
TARGET = "Project_HEADLESS_D"
message($${TARGET})
DESTDIR = $$HOME/debug
}

build_pass:CONFIG(Release) {
message("this is a release build")
TARGET = "Project"
message($${TARGET})
DESTDIR = $$HOME/release
}

build_pass:CONFIG(ReleaseHeadless) {
message("this is a release build")
TARGET = "Project_HEADLESS"
message($${TARGET})
DESTDIR = $$HOME/release
}
</code></pre>
<p dir="auto">But the messages indicate it is not working.</p>
<pre><code>Project MESSAGE: this is a release build
Project MESSAGE: Project
Project MESSAGE: this is a debug build
Project MESSAGE: Project_D
</code></pre>
<p dir="auto">What is the right .pro syntax to create four distinct builds in different configurations?<br />
What is the right command line syntax to force of of the four builds (I think I'm already getting all)?</p>
]]></description><link>https://forum.qt.io/topic/117401/how-to-create-multiple-build-configurations-in-pro</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 09:31:10 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/117401.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Jul 2020 16:37:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to create multiple build configurations in .pro on Thu, 30 Jul 2020 17:06:21 GMT]]></title><description><![CDATA[<p dir="auto">@J-Hilk Okay. That at least got me in the right area. My inherited code used buildpass, but you were right that the CONFIG function was the key. You really should get the credit on stackoverflow.</p>
<p dir="auto">My final solution has CONFIG both to determine if it is build/release and to determine if it is GUI/NoGUI.</p>
<pre><code>CONFIG(GUI)}
  ... add GUI-related details
  CONFIG(release, debug|release){
    message("Project")
    ... add release details
  }
  CONFIG(debug, debug|release){
    message("ProjectD")
    ... add debug details
  }
}

CONFIG(NoGUI)}
  ... exclude GUI-related details
  CONFIG(release, debug|release){
    message("Project_HEADLESS")
    ... add release details
  }
  CONFIG(debug, debug|release){
    message("Project_HEADLESS_D")
    ... add debug details
  }
}
</code></pre>
]]></description><link>https://forum.qt.io/post/609730</link><guid isPermaLink="true">https://forum.qt.io/post/609730</guid><dc:creator><![CDATA[bsdillon]]></dc:creator><pubDate>Thu, 30 Jul 2020 17:06:21 GMT</pubDate></item><item><title><![CDATA[Reply to How to create multiple build configurations in .pro on Fri, 31 Jul 2020 04:48:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bsdillon">@<bdi>bsdillon</bdi></a> Gerate, that you managed to make it work! (Correctly) Setting up a pro file is no easy task and often very frustrating.</p>
<p dir="auto">Sometimes I wonder, if I shouldn't just make the change to cmake, eventually it's going to happen.</p>
<blockquote>
<p dir="auto">You really should get the credit on stackoverflow.</p>
</blockquote>
<p dir="auto">I do have a stackoverflow, account, I made it years ago to thank someone for a solution and to make an upvote. No idea if it's still valid :D</p>
]]></description><link>https://forum.qt.io/post/609785</link><guid isPermaLink="true">https://forum.qt.io/post/609785</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Fri, 31 Jul 2020 04:48:23 GMT</pubDate></item><item><title><![CDATA[Reply to How to create multiple build configurations in .pro on Thu, 30 Jul 2020 17:06:21 GMT]]></title><description><![CDATA[<p dir="auto">@J-Hilk Okay. That at least got me in the right area. My inherited code used buildpass, but you were right that the CONFIG function was the key. You really should get the credit on stackoverflow.</p>
<p dir="auto">My final solution has CONFIG both to determine if it is build/release and to determine if it is GUI/NoGUI.</p>
<pre><code>CONFIG(GUI)}
  ... add GUI-related details
  CONFIG(release, debug|release){
    message("Project")
    ... add release details
  }
  CONFIG(debug, debug|release){
    message("ProjectD")
    ... add debug details
  }
}

CONFIG(NoGUI)}
  ... exclude GUI-related details
  CONFIG(release, debug|release){
    message("Project_HEADLESS")
    ... add release details
  }
  CONFIG(debug, debug|release){
    message("Project_HEADLESS_D")
    ... add debug details
  }
}
</code></pre>
]]></description><link>https://forum.qt.io/post/609730</link><guid isPermaLink="true">https://forum.qt.io/post/609730</guid><dc:creator><![CDATA[bsdillon]]></dc:creator><pubDate>Thu, 30 Jul 2020 17:06:21 GMT</pubDate></item><item><title><![CDATA[Reply to How to create multiple build configurations in .pro on Tue, 28 Jul 2020 04:49:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> I defined two additional build configurations in the Project tab. DebugHeadless and Headless are the names of those configurations.</p>
<p dir="auto">@J-Hilk Okay, that makes a little more sense. I saw that in other documentation, but I believed you could select which build you wanted at that point. Alright. I'm away from my computer (at 12:48am local time), but I will try that as soon as I get back. If you have a stackoverflow account, you might as well get the credit for a good answer there.</p>
]]></description><link>https://forum.qt.io/post/609142</link><guid isPermaLink="true">https://forum.qt.io/post/609142</guid><dc:creator><![CDATA[bsdillon]]></dc:creator><pubDate>Tue, 28 Jul 2020 04:49:15 GMT</pubDate></item><item><title><![CDATA[Reply to How to create multiple build configurations in .pro on Tue, 28 Jul 2020 05:07:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bsdillon">@<bdi>bsdillon</bdi></a> you're in luck, I've been fighting with qmake and *pro files for the last couple of days, and should be able do help here :D</p>
<p dir="auto">First of,  you're supposed to check for debug or release build in this way:</p>
<pre><code>CONFIG(release, debug|release)  {
#Release build
}

CONFIG(debug, debug|release) {
#Debug build
}
</code></pre>
<p dir="auto">and you can use the <code>requires</code> check, to check for your own CONFIG += DebugHeadless</p>
<pre><code>requires(DebugHeadless) {
 #Debug headless build
}
</code></pre>
<p dir="auto">That's how I'm using it, and how its finally working for me :D</p>
]]></description><link>https://forum.qt.io/post/609102</link><guid isPermaLink="true">https://forum.qt.io/post/609102</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Tue, 28 Jul 2020 05:07:51 GMT</pubDate></item><item><title><![CDATA[Reply to How to create multiple build configurations in .pro on Mon, 27 Jul 2020 18:02:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Where is DebugHeadless coming from ?</p>
]]></description><link>https://forum.qt.io/post/609072</link><guid isPermaLink="true">https://forum.qt.io/post/609072</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 27 Jul 2020 18:02:14 GMT</pubDate></item></channel></rss>