Qt5 version is overriden by kdoctools one when compiling other application
I have KDocTools installed on my computer (one of the latest version). It depends on Qt 5.15. Not sure if it is expected or not, but when I try to compile GCompris with a Qt 5.12.5, the QtCore is being overriden to use Qt 5.15 (the system one) and I have errors at compilation:
AutoMoc subprocess error
------------------------
The moc process failed to compile
"SRC:/src/core/ActivityInfo.h"
into
"SRC:/build/src/core/gcompris-qt_autogen/EWIEGA46WW/moc_ActivityInfo.cpp"
...
/home/jazeix/Qt/5.12.5/gcc_64/bin/moc -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SENSORS_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -I/home/jazeix/Desktop/travail/tmp/gcompris_android/build/src/core -I/home/jazeix/Desktop/travail/tmp/gcompris_android/src/core -I/home/jazeix/Qt/5.12.5/gcc_64/include -I/home/jazeix/Qt/5.12.5/gcc_64/include/QtQml ... --output-dep-file -o /home/jazeix/Desktop/travail/tmp/gcompris_android/build/src/core/gcompris-qt_autogen/EWIEGA46WW/moc_ActivityInfoTree.cpp /home/jazeix/Desktop/travail/tmp/gcompris_android/src/core/ActivityInfoTree.h
...
Output
------
Unknown option 'output-dep-file'.
In the CMakeCache.txt, I have:
Qt5Core_DIR:PATH=/usr/lib64/cmake/Qt5Core
Qt5Gui_DIR:PATH=/home/jazeix/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui
The Qt5Core_DIR is the system one, not the Qt5.12.5 one I specified.
Removing the dependency on KDocTools fixes the issue but it's not what we want :).
Any suggestion?