summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorAmir Masoud Abdol <amirmasoudabdol@icloud.com>2022-11-11 14:48:57 +0100
committerAmir Masoud Abdol <amirmasoudabdol@icloud.com>2022-12-01 02:23:51 +0100
commit60968090adfc7dca78b9d60a0fe79cab4e2e6937 (patch)
treee3a6406fa77d0cc45c74021786190ff8f6d6a237 /configure
parent4fb96669e33c9e1e3edc1cf2e472f921ddee6484 (diff)
Update -redo option such that it removes CMakeCache.txt and CMakeFiles/
In the case of re-doing, `configure` and `configure.bat` pass an extra parameter to the `QtProcessConfigureArgs.cmake`. As a result, CMake removes CMakeCache.txt and CMakeFiles/ before the reconfiguration. If the user is using CMake 3.24 or newer, this is achieved by passing the `--fresh` option to CMake call. In older CMake(s), CMakeCache.txt and CMakeFiles/ found in CMAKE_BINARY_DIR will be removed using a file(REMOVE_RECURSIVE call. [ChangeLog] The -redo option now additionally removes existing CMakeCache.txt file, and CMakeFiles/ directory, and recreates them from scratch. Task-number: QTBUG-108287 Change-Id: I11a5c8f9df1247d11eb7097552e6764463583346 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure6
1 files changed, 5 insertions, 1 deletions
diff --git a/configure b/configure
index 56999a984e..a2b67a1d46 100755
--- a/configure
+++ b/configure
@@ -221,6 +221,8 @@ checkTopLevelBuild "$@"
parseCommandline "$@"
handleHelp
determineOptFilePath "$@"
+
+fresh_requested_arg=
optfilename=config.opt
if [ -z "$optfile" ]; then # only write optfile if not currently redoing
optfilepath=${outpathPrefix}${optfilename}
@@ -231,6 +233,8 @@ if [ -z "$optfile" ]; then # only write optfile if not currently redoing
fi
echo $arg >> "$optfilepath"
done
+else
+ fresh_requested_arg=-DFRESH_REQUESTED=TRUE
fi
top_level_arg=
@@ -239,4 +243,4 @@ if [ -n "$CFG_TOPLEVEL" ]; then
cd ..
fi
-cmake "-DOPTFILE=$optfilename" $top_level_arg -P "$relpath/cmake/QtProcessConfigureArgs.cmake"
+cmake "-DOPTFILE=$optfilename" $top_level_arg $fresh_requested_arg -P "$relpath/cmake/QtProcessConfigureArgs.cmake"