QTCreator .pro文件:根据DEBUG设置LIBS路径/ RELEASE [英] QTCreator .pro file: Setting LIBS path depending on DEBUG / RELEASE
问题描述
作为新手的Qt我写一个小项目取决于另一个项目,位于并列目录。
As a newbie to Qt I am writing a small project depending on another project, located in a parallel directory.
在我的的.pro
file中一些 .OBJ
文件包括如下(工作)。但是,在创建释放时,我想使用其他项目的释放,而不是它的调试路径。我已经检查了的Qt变量,并发现了目标示例 。但是,我没有将它应用到我的 LIBS
以来,特别是构建可为 debug_and_release
,我没有知道如何写的 LIBS
路径即可。
In my .pro
file some .obj
files are includes as below (which works). However, when creating a release I'd like to use the other project's release and not its debug path. I have checked the Qt variables and found the "TARGET example". But I failed to apply it to my LIBS
, especially since the build can be for both debug_and_release
, and I have no idea how to write the LIBS
path then.
临文件:
LIBS += -L"../../OtherApp/OtherApp-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK__Debug/debug"
LIBS += http.obj some other obj files
目标的例子:
build_pass:CONFIG(debug, debug|release) {
unix: TARGET = $$join(TARGET,,,_debug)
else: TARGET = $$join(TARGET,,,d)
}
我可以写 LIBS + = -L......$$(TARGET)......
,尤其是当目标可能包含调试和发布?
Can I write LIBS += -L"......."$$(TARGET)"......"
, especially if target may contain both debug and release?
我已经找到了解决办法: http://stackoverflow.com/a/11612903/356726
推荐答案
使用向导(inlucde内部库)我得到了下面的code创建。这是最有可能的解决方案:
By using the wizard (inlucde internal library) I got the following "code" created. This is most likely the solution:
win32:CONFIG(release, debug|release): LIBS += -LLIBS += -L"../../MyApp/current/MyApp-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK__Release/release"
else:win32:CONFIG(debug, debug|release): LIBS += -L"../../MyApp/current/MyApp-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK__Debug/debug"
这篇关于QTCreator .pro文件:根据DEBUG设置LIBS路径/ RELEASE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!