Freetype and libPNG detection in QT5
Summary
Bring back a patch that has been removed in 3597436e. The patch has been adapted to be compatible with QT 5.14.1
pkg-config is used in priority when trying to find the system QT5, which fails to find the superbuild version and use the system one instead.
Don't merge this right now. There might be other things to fix for the QT5 superbuild.
Copyright
The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.
Check before merging:
- All discussions are resolved
- At least 2
votes from core developers, no vote. - The feature branch is (reasonably) up-to-date with the base branch
- Dashboard is green
- Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
- Optionally, run
git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i
on latest changes and commit
Merge request reports
Activity
changed milestone to %7.2.0
added bug label
mentioned in issue #2081 (closed)
This MR doesn't solve issue #2081 (closed). I think it could be interesting to wait until we find the solution for #2081 (closed), so we could add it to this MR.
On my computer (Ubuntu 18.04), I've checked out this branch, and cleaned the build (make clean in QT5/build directory and in my build root directory). At first it seemed to work fine :) but it finally failed with the same error while building QT5/stamp (undefined reference to png_*)
Edited by Yannick TANGUYadded 1 commit
- 0301abdb - BUG: force usage of the ld gold linker for linux QT5 build in the Superbuild...
The proposed patch should be added.
However this is not the only problem with QT5 compilation.
QT5 used to force the usage of the ld gold linker on linux builds. This is not the case anymore, the default linker (probably ld bsd) is used if no linker is specified in configure options.
This results in link errors, like the one reported on this bug : https://bugreports.qt.io/browse/QTBUG-76196 (I have a similar error when compiling on my ubuntu 16.04).
Another error is the one reported above by @ytanguy and in #2081 (closed) (I also reproduced this bug in a 18.04 ubuntu docker), where there is a link error with libpng when compiling the qttools module (oddly QTGui from the qtbase module also uses png but has no link error). Similar errors has already been reported on QT forums and stack overflow, e.g. https://stackoverflow.com/questions/20365850/qvfb-compilation-error-undefined-reference-to-png-create-write-struct.
Manually add
-lpng
to build commands fixes the problem. I tried to add it automatically in QMake projects files (in qttools/src/src.pro) by addingLIBS += -lpng
but it didn't work.Another solution (that I pushed on this branch) is to force the usage of the gold linker in unix builds. This solves both link issues.
Another solution (that I pushed on this branch) is to force the usage of the gold linker in unix builds. This solves both link issues.
This fixed issue #2081 (closed) for me.
added 6 commits
-
0301abdb...87e74857 - 4 commits from branch
develop
- c834ef03 - BUG: patch for png and freetype detection
- 9df40e7f - BUG: force usage of the ld gold linker for linux QT5 build in the Superbuild...
-
0301abdb...87e74857 - 4 commits from branch
added 1 commit
- 3f0eb9bd - Revert "BUG: use the new DEMHandler API in Ice"
mentioned in commit 00148a16