summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-27 11:25:34 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-10-27 12:49:39 +0100
commitd0bc2cefd2d37e18415c0aaebcb07597e3b54a72 (patch)
treef823f70757e544a055d91c079c0f5bb741edc172 /cmake
parent6d496a24216ef84ed7ff1f630028f339f2fe90e0 (diff)
CMake: Do not overrun the list end in qt_remove_args
Otherwise we get error messages from CMake. Change-Id: I374b87e38550062b841b7eacf5fbb6bb5ccbdbde Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtCMakeHelpers.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmake/QtCMakeHelpers.cmake b/cmake/QtCMakeHelpers.cmake
index 261e9cc457..6c62897d20 100644
--- a/cmake/QtCMakeHelpers.cmake
+++ b/cmake/QtCMakeHelpers.cmake
@@ -132,11 +132,13 @@ function(qt_remove_args out_var)
list(REMOVE_AT result ${find_result})
list(LENGTH result result_len)
list(GET result ${find_result} arg_current)
- # remove values until we hit another arg
+ # remove values until we hit another arg or the end of the list
while(NOT ${arg_current} IN_LIST arg_ALL_ARGS AND find_result LESS result_len)
list(REMOVE_AT result ${find_result})
- list(GET result ${find_result} arg_current)
list(LENGTH result result_len)
+ if (NOT find_result EQUAL result_len)
+ list(GET result ${find_result} arg_current)
+ endif()
endwhile()
endif()
endforeach()