From ca679e98deda2739aee6963d3e7029430d71cada Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 15 Dec 2025 13:21:56 +0100 Subject: [PATCH] init-repository: Fix passing no --alternates option Commit d6918d7ac516ff6cb72a99197a58cc182375916a broke init-repository if you did not pass an --alternates option. Pick-to: 6.8 Task-number: QTBUG-142712 Fixes: QTBUG-142744 Change-Id: Ia727b420a34a46e52f0f05e549aabe2c975c6d7e Reviewed-by: Alexandru Croitor (cherry picked from commit 6bd3b23b6c48e6210f3af3a1808529ad97429a29) (cherry picked from commit f1d54f955c074aad96de4aa6d4ac994adc5facf1) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtIRCommandLineHelpers.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/QtIRCommandLineHelpers.cmake b/cmake/QtIRCommandLineHelpers.cmake index b932fcdf..8856e980 100644 --- a/cmake/QtIRCommandLineHelpers.cmake +++ b/cmake/QtIRCommandLineHelpers.cmake @@ -427,11 +427,13 @@ endfunction() # Convert to absolute path if necessary. function(qt_ir_get_option_as_existing_absolute_path name value) qt_ir_get_option_value("${name}" path) - if(NOT EXISTS "${abspath}") - qt_ir_add_error("The path '${path}' passed with -${name} does not exist.") - endif() - if(NOT IS_ABSOLUTE "${path}") - get_filename_component(path "${path}" ABSOLUTE) + if(NOT "${path}" STREQUAL "") + if(NOT EXISTS "${path}") + qt_ir_add_error("The path '${path}' passed with -${name} does not exist.") + endif() + if(NOT IS_ABSOLUTE "${path}") + get_filename_component(path "${path}" ABSOLUTE) + endif() endif() set("${value}" "${path}" PARENT_SCOPE) endfunction()