Priority: P2: Important
Affects Version/s: 5.12.3
Fix Version/s: 5.14.0 Alpha
Component/s: Build tools: qmake
QMake version 3.1
Using Qt version 5.12.3 in /usr/lib
GNU Make 4.2.1
g++ (GCC) 8.3.0
mylib/ # This dir should be irrelevant, but isn't!
mylib.cpp # This file is added to the build!
build/ # Doing my builds in here
From myapp.pro, I'm including mylib.pri:
From mylib.pri, I'm adding mylib's sources to the build:
SOURCES += $$PWD/mylib.cpp $$PWD/bar.cpp
Then I'm running qmake, inside myapp/build:
rm -rf build && mkdir build && (cd build && qmake ..)
Inspecting the generated Makefile reveals:
SOURCES = ../../mylib/mylib.cpp
That's one ../ too many for mylib.cpp! But bar.cpp, which exists only in myapp/mylib/ but not in the top-level copy of mylib/, is resolved correctly.
- message($$SOURCES) shows the correct absolute paths, so somehow these are turned into incorrect relative paths at some later stage.
- If I just put the SOURCES of mylib directly into myapp.pro rather than using include(), the problem goes away.
- If I rename the top-level mylib to something else, the problem goes away.
- If I put the build/ directory as a sibling to myapp/, the problem goes away.
- If I put the build/ directory as a sub-sub-directory like myapp/build/build, the problem goes away.