Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[qmake] Link to a static library using shadow builds

$
0
0
Hi, I just created a new project and I am having trouble with qmake variables. Neither the documentation, nor the undocumented qmake [qtcentre.org], nor even the mighty Google seems to have the answer I’m looking for. My project is organized like that: MyProject/     - MyProject.pro # subdirs project template     Main/         - Main.pro # this is the app project that depends on MyLib     MyLib/         - MyLib.pro # this is a custom MyProject-specific static library How am I supposed to refer to the MyLib library in the Main.pro project file, to notify the linker to use the generated binary? The best I could come up with was: # in Main.pro: LIBS += $${OUT_PWD}/../MyLib/debug/MyLib.lib I know this would have to be customized to handle both release and debug builds and that the target name will change on other platforms but that’s not really an issue, I just wanted it to work for now (and it does). But I thought that there may be another solution, more clever or better to use. I tried using $$DESTDIR but it doesn’t seem to be defined. I’m trying to use shadow builds to avoid doing all the rubbish I usually do, ie setting DESTDIR, OBJECTS_DIR, MOC_DIR, etc. that is a pain to setup (if I don’t copy/paste an existing project) but at least with this method I can control where the binaries will go, therefore I’m able to link to them reliably. Maybe this is the correct way to use qmake and it’s not that hacky after all, but creating a post here will hopefully get the attention of guys more clever than I am :)

Viewing all articles
Browse latest Browse all 13965

Latest Images

Trending Articles



Latest Images