aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-09-21 14:28:12 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-09-21 16:24:39 +0200
commit0169543d0bb220ec4c5f62e75fa18132f5797ad5 (patch)
tree553fb05c7aee96387f0f6a3c9d120fe9c24ba2f2 /src/qml/Qt6QmlMacros.cmake
parent7517c1b3ae9aa92f36b19d74a4b2de5e8531309b (diff)
Pass application directory as import path to qmlsc
The application directory is part of the default import path. Pick-to: 6.2 Change-Id: I95fe08833af467f07ff253d1d5811aabd4df980e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 16863fadc6..fac32a4715 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -1349,8 +1349,14 @@ function(qt6_target_qml_sources target)
_qt_internal_genex_getjoinedproperty(qrc_resource_args ${target}
_qt_generated_qrc_files "--resource$<SEMICOLON>" "$<SEMICOLON>"
)
+ get_target_property(target_type ${target} TYPE)
+ get_target_property(is_android_executable ${target} _qt_is_android_executable)
+ if(target_type STREQUAL "EXECUTABLE" OR is_android_executable)
+ # The application binary directory is part of the default import path.
+ list(APPEND import_paths -I "$<TARGET_PROPERTY:${target},BINARY_DIR>")
+ endif()
set(cachegen_args
- "$<${have_import_paths}:${import_paths}>"
+ ${import_paths}
"$<${have_types_file}:-i$<SEMICOLON>${types_file}>"
"$<${have_direct_calls}:--direct-calls>"
"$<${have_arguments}:${arguments}>"