<?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 does QMake process .prl files?]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I need to pass certain #define from library to main application. As far as I understand, it can be achieved with .prl files.<br />
I've created simple subdirs project to test it:</p>
<p dir="auto">This is main project file:</p>
<pre><code>TEMPLATE = subdirs

SUBDIRS += \
    app \
    lib

app.depends = lib
</code></pre>
<p dir="auto">This is library project file:</p>
<pre><code>QT       -= gui

TARGET = lib
TEMPLATE = lib
# Added create_prl option
CONFIG += staticlib create_prl
# This is the define I want to pass to main application
PRL_EXPORT_DEFINES += TEST_PRL_DEFINE

SOURCES += lib.cpp

HEADERS += lib.h
</code></pre>
<p dir="auto">This is main application file:</p>
<pre><code>QT += core
QT -= gui

CONFIG += c++11

TARGET = app
# Added link_prl option
CONFIG += console link_prl
CONFIG -= app_bundle

TEMPLATE = app

SOURCES += main.cpp

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/release/ -llib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/debug/ -llib
else:unix: LIBS += -L$$OUT_PWD/../lib/ -llib

INCLUDEPATH += $$PWD/../lib
DEPENDPATH += $$PWD/../lib

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../lib/release/liblib.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../lib/debug/liblib.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../lib/release/lib.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../lib/debug/lib.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../lib/liblib.a
</code></pre>
<p dir="auto">However, when I build the project (in Qt Creator, if that matters), no #define seems to be passed to main application except the standard ones:</p>
<pre><code>cd lib\ &amp;&amp; ( if not exist Makefile C:\Qt\5.4\mingw491_32\bin\qmake.exe C:\Qt\projects\test_prl\lib\lib.pro -spec win32-g++ CONFIG+=debug CONFIG+=qml_debug -o Makefile ) &amp;&amp; C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile 
mingw32-make[1]: Entering directory 'C:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/lib'
C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[2]: Entering directory 'C:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/lib'
# Here you can see that TEST_PRL_DEFINE is added to defines of library project
g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DTEST_PRL_DEFINE -DUNICODE -DQT_QML_DEBUG -DQT_CORE_LIB -I"..\..\test_prl\lib" -I"." -I"..\..\..\5.4\mingw491_32\include" -I"..\..\..\5.4\mingw491_32\include\QtCore" -I"debug" -I"..\..\..\5.4\mingw491_32\mkspecs\win32-g++"  -o debug\lib.o ..\..\test_prl\lib\lib.cpp
ar -ru debug\liblib.a debug/lib.o 
ar: creating debug\liblib.a
mingw32-make[2]: Leaving directory 'C:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/lib'
mingw32-make[1]: Leaving directory 'C:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/lib'
cd app\ &amp;&amp; ( if not exist Makefile C:\Qt\5.4\mingw491_32\bin\qmake.exe C:\Qt\projects\test_prl\app\app.pro -spec win32-g++ CONFIG+=debug CONFIG+=qml_debug -o Makefile ) &amp;&amp; C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile 
mingw32-make[1]: Entering directory 'C:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/app'
C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[2]: Entering directory 'C:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/app'
# Here no TEST_PRL_DEFINE is added to #defines of main application project
g++ -c -pipe -fno-keep-inline-dllexport -g -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_CORE_LIB -I"..\..\test_prl\app" -I"." -I"..\..\test_prl\lib" -I"..\..\..\5.4\mingw491_32\include" -I"..\..\..\5.4\mingw491_32\include\QtCore" -I"debug" -I"..\..\..\5.4\mingw491_32\mkspecs\win32-g++"  -o debug\main.o ..\..\test_prl\app\main.cpp
g++ -Wl,-subsystem,console -mthreads -o debug\app.exe debug/main.o  -LC:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/app/../lib/debug/ -llib -LC:/Qt/5.4/mingw491_32/lib -lQt5Cored 
mingw32-make[2]: Leaving directory 'C:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/app'
mingw32-make[1]: Leaving directory 'C:/Qt/projects/build-test_prl-Desktop_Qt_5_4_2_MinGW_32bit-Debug/app'
</code></pre>
<p dir="auto">How should I use create_prl/link_prl options?</p>
]]></description><link>https://forum.qt.io/topic/71539/how-does-qmake-process-prl-files</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 20:18:35 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/71539.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Sep 2016 11:40:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How does QMake process .prl files? on Sun, 02 Oct 2016 00:01:48 GMT]]></title><description><![CDATA[<p dir="auto">Not sure, but I'd suggest some parenthesis.  For example, where you have:</p>
<pre><code>win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/release/ -llib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/debug/ -llib
else:unix: LIBS += -L$$OUT_PWD/../lib/ -llib
</code></pre>
<p dir="auto">That <em>might</em> be interpreted by qmake like:</p>
<pre><code>win32 {
    CONFIG(release, debug|release) {
        LIBS += -L$$OUT_PWD/../lib/release/ -llib
    } else {
        win32 {
            CONFIG(debug, debug|release) {
                LIBS += -L$$OUT_PWD/../lib/debug/ -llib
            } else {
                unix {
                    LIBS += -L$$OUT_PWD/../lib/ -llib
                }
            }
        }
    }
}
</code></pre>
<p dir="auto">Which is probably not what you're expecting.  You probably mean something more like:</p>
<pre><code>win32 {
    CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/release/ -llib
    CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/debug/ -llib
}
unix: LIBS += -L$$OUT_PWD/../lib/ -llib
</code></pre>
<p dir="auto">Cheers.</p>
]]></description><link>https://forum.qt.io/post/351370</link><guid isPermaLink="true">https://forum.qt.io/post/351370</guid><dc:creator><![CDATA[Paul Colby]]></dc:creator><pubDate>Sun, 02 Oct 2016 00:01:48 GMT</pubDate></item><item><title><![CDATA[Reply to How does QMake process .prl files? on Sat, 01 Oct 2016 21:56:56 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Sounds surprising indeed. You should take a look at the <a href="http://bugreports.qt.io" target="_blank" rel="noopener noreferrer nofollow ugc">bug report system</a> to see if it something known. It not please consider opening a report providing a minimal compilable example showing that behavior.</p>
]]></description><link>https://forum.qt.io/post/351360</link><guid isPermaLink="true">https://forum.qt.io/post/351360</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 01 Oct 2016 21:56:56 GMT</pubDate></item></channel></rss>