From edd29f76240a0c80fc2d615f3fa022e9701e18cd Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Wed, 13 Nov 2024 17:25:13 +0200 Subject: [PATCH] CMake:Android: pass absolute paths to add_jar() This would make paths in warning/error messages absolute also, being more clear which module it is from and another benefit is it being clickable from various IDEs in case the qt5 repo is opened as a project and not only single modules. Change-Id: Ic95cea0005f0675186ad700e197e217dad016876 Reviewed-by: Alexandru Croitor --- cmake/QtJavaHelpers.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/QtJavaHelpers.cmake b/cmake/QtJavaHelpers.cmake index b2ce2146751..cb96570a970 100644 --- a/cmake/QtJavaHelpers.cmake +++ b/cmake/QtJavaHelpers.cmake @@ -22,7 +22,14 @@ function(qt_internal_add_jar target) set(CMAKE_JAVA_COMPILE_FLAGS -source "${javac_source_version}" -target "${javac_target_version}" -Xlint:all -classpath "${QT_ANDROID_JAR}" ) - add_jar(${ARGV}) + + set(absolute_sources "") + foreach(path IN LISTS arg_SOURCES) + get_filename_component(absolute_path "${path}" ABSOLUTE) + list(APPEND absolute_sources "${absolute_path}") + endforeach() + + add_jar(${target} SOURCES ${absolute_sources} ${ARGV}) foreach(f IN LISTS arg_SOURCES) _qt_internal_expose_source_file_to_ide(${target} "${f}")