I am creating large project in Qt. I created sub projects there. My problem is build destination. I will simplify my problem like this:
I have to build library and binary file. My library has following Qt project settings:
TARGET = MyLib
CONFIG(debug, debug|release) {
TARGET.path = $$OUT_PWD/MyProject/debug
} else {
TARGET.path = $$OUT_PWD/MyProject/release
}
INSTALLS += TARGET
#DESTDIR += TARGET
TEMPLATE = lib
My executable binary has following Qt project settings:
TARGET = MyExecutable
CONFIG(debug, debug|release) {
TARGET.path = $$OUT_PWD/MyProject/debug
} else {
TARGET.path = $$OUT_PWD/MyProject/release
}
INSTALLS += TARGET
#DESTDIR += TARGET
TEMPLATE = app
LIBS += -L$$OUT_PWD/MyProject/... -lMyLib (row is different, but it is not important now)
Compiler VS2017 with these settings creates output in:
$$OUT_PWD/MyLib/debug/MyLib.dll
$$OUT_PWD/MyLib/release/MyLib.dll
$$OUT_PWD/MyExecutable/debug/MyExecutable.exe
$$OUT_PWD/MyExecutable/release/MyExecutable.exe
I want to have output like:
$$OUT_PWD/MyProject/debug/MyLib.dll
$$OUT_PWD/MyProject/release/MyLib.dll
$$OUT_PWD/MyProject/debug/MyExecutable.exe
$$OUT_PWD/MyProject/release/MyExecutable.exe
The reason why I want to have output like that, I want to debug library jumping from executable file. MyExecutable.exe cannot be executed now, because it does not have MyLib.dll in proper path. If I will put to both projects:
DESTDIR += TARGET
Folders named "TARGET" will be created like:
$$OUT_PWD/MyExecutable/TARGET/MyExecutable.exe
$$OUT_PWD/MyLib/TARGET/MyLib.dll
I am doing testing solution for Windows now, but in the future the project supposed to be multi platform. I think I am too old for computer programming...