Force absolute paths with qmake

When generating makefiles, by default qmake tries to use
relative paths if it can replace at most 4 subdirs with "../"
to reach the QTDIR from the project file location.
This maximum can be changed by defining QMAKE_PROJECT_DEPTH, and
setting it to zero forces qmake to always use absolute paths.

This is necessary because the paths for includes and libs are
generated by a temporary project file located in a temporary dir
not corresponding to the real source dir.
This commit is contained in:
Enrico Forestieri 2022-05-29 11:57:58 +02:00
parent 0d6e3bcdc3
commit d7662e5586

View File

@ -424,6 +424,7 @@ qtHaveModule(core5compat): QT += core5compat
percent.target = %
percent.commands = @echo -n "\$(\$(@))\ "
QMAKE_EXTRA_TARGETS += percent
QMAKE_PROJECT_DEPTH = 0
EOF1
$QT_QMAKE $lyx_test_qt_pro -o $lyx_test_qt_mak 1>/dev/null 2>&1
QT_CORE_INCLUDES=`cd $lyx_test_qt_dir; make -s -f $lyx_test_qt_mak INCPATH | sed 's/-I\. //g'`
@ -452,6 +453,7 @@ qtHaveModule(widgets): QT += widgets
percent.target = %
percent.commands = @echo -n "\$(\$(@))\ "
QMAKE_EXTRA_TARGETS += percent
QMAKE_PROJECT_DEPTH = 0
EOF2
$QT_QMAKE $lyx_test_qt_pro -o $lyx_test_qt_mak 1>/dev/null 2>&1
QT_INCLUDES=`cd $lyx_test_qt_dir; make -s -f $lyx_test_qt_mak INCPATH | sed 's/-I\. //g'`