Question

As a newbie to Qt I am writing a small project depending on another project, located in a parallel directory.

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.

Pro file:

LIBS += -L"../../OtherApp/OtherApp-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK__Debug/debug"
LIBS += http.obj some other obj files

"Target example":

 build_pass:CONFIG(debug, debug|release) {
 unix: TARGET = $$join(TARGET,,,_debug)
 else: TARGET = $$join(TARGET,,,d)
 }

Can I write LIBS += -L"......."$$(TARGET)"......" , especially if target may contain both debug and release?

[Edit 1] I have found a solution: https://stackoverflow.com/a/11612903/356726

Was it helpful?

Solution

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"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top