summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-11-02 20:45:01 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-11-03 13:06:14 +0100
commit9a50d62039179346b2d7f6de2756c912c1fd1dec (patch)
tree6e444a1f83ff00e7d10850712b62bcfb75144397 /cmake
parent72aab8b4875dc3b14ef4a72a881047f4ef619f3d (diff)
CMake: Fix Windows top-level configure.bat
We must write config.opt in the same directory we're reading it from. We must not write the -top-level argument to config.opt. This amends commit 2a29426e39. Change-Id: I96da9094579fec29c290411677d6b538878399f4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtWriteArgsFile.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/QtWriteArgsFile.cmake b/cmake/QtWriteArgsFile.cmake
index b4fa833f79..ddb390a146 100644
--- a/cmake/QtWriteArgsFile.cmake
+++ b/cmake/QtWriteArgsFile.cmake
@@ -5,6 +5,9 @@
# This script takes the following arguments:
# OUT_FILE: The output file.
# SKIP_ARGS: Number of arguments to skip from the front of the arguments list.
+# IGNORE_ARGS: List of arguments to be ignored, i.e. that are not written.
+
+cmake_minimum_required(VERSION 3.3)
# Look for the -P argument to determine the start of the actual script arguments
math(EXPR stop "${CMAKE_ARGC} - 1")
@@ -25,7 +28,10 @@ endif()
set(content "")
if(start LESS_EQUAL stop)
foreach(i RANGE ${start} ${stop})
- string(APPEND content "${CMAKE_ARGV${i}}\n")
+ set(arg ${CMAKE_ARGV${i}})
+ if(NOT arg IN_LIST IGNORE_ARGS)
+ string(APPEND content "${arg}\n")
+ endif()
endforeach()
endif()
file(WRITE "${OUT_FILE}" "${content}")