CMake: Fix configure -redo on Unix

One can now place a config.opt file in an otherwise empty build
directory and call 'configure -redo'. If config.opt contains the
-cmake argument, Qt will be built with CMake as expected.

To achieve that, configure must peek into config.opt and look for the
-cmake argument.

Fixes: QTBUG-86097
Change-Id: I35f76caca862e5a59c2fb850e0aeb6529c826149
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-08-18 11:43:37 +02:00
parent c4d3e5d7d3
commit 45d3c75ab6

9
configure vendored
View File

@ -558,6 +558,13 @@ while [ "$#" -gt 0 ]; do
cmake)
BUILD_WITH_CMAKE=yes
;;
redo)
if [ -f config.opt ]; then
if grep -e ^-cmake <config.opt; then
BUILD_WITH_CMAKE=yes
fi
fi
;;
*)
;;
esac
@ -915,8 +922,8 @@ handleHelp
if [ "$BUILD_WITH_CMAKE" = "yes" ]; then
checkTopLevelBuild "$@"
getOptAndQMakeCmdLines "$@"
optfilename=config.opt
if [ -z "$optfile" ]; then # only write optfile if not currently redoing
optfilename=config.opt
optfilepath=${outpathPrefix}${optfilename}
if [ -f "$optfilepath" ]; then rm "$optfilepath"; fi
for arg in "$@"; do