From 3c3e1c0ae198c17a442b43789dda8b72e72171c7 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 May 2021 16:01:15 +0200 Subject: [PATCH] CMake: Don't use list(PREPEND) in qt.toolchain.cmake list(PREPEND) command was added in CMake 3.15+, but so far we claim support for CMake 3.14 in user projects. Use set command instead. This is not the only place where we use list PREPEND in public API, but it's the first immediate issue that comes up when using CMake 3.14. Amends 963017f58884dfd929249c5546aadbb0f74501e8 Change-Id: I7ba4507fc7da2dc550317848751502b8b46c298c Reviewed-by: Joerg Bornemann (cherry picked from commit c457e65bf40a8cccff283609924078b5ff985709) Reviewed-by: Qt Cherry-pick Bot --- cmake/qt.toolchain.cmake.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/qt.toolchain.cmake.in b/cmake/qt.toolchain.cmake.in index cdd2813f8bf..49553c9bbf4 100644 --- a/cmake/qt.toolchain.cmake.in +++ b/cmake/qt.toolchain.cmake.in @@ -63,8 +63,9 @@ get_filename_component(QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR "${CMAKE_CURRENT_LIST_ # Instead of collapsing the search prefix (which is the case when one is a subdir of the other), # it concatenates them creating an invalid path. Workaround it by setting the root path to the # Qt install prefix, and the prefix path to the lib/cmake subdir. -list(PREPEND CMAKE_PREFIX_PATH "${QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR}") -list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_TOOLCHAIN_RELOCATABLE_INSTALL_PREFIX}") +set(CMAKE_PREFIX_PATH "${QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR};${CMAKE_PREFIX_PATH}") +set(CMAKE_FIND_ROOT_PATH "${QT_TOOLCHAIN_RELOCATABLE_INSTALL_PREFIX};${CMAKE_FIND_ROOT_PATH}") + @init_qt_host_path_checks@ # Allow customization of the toolchain file by placing an additional file next to it.