@@ -1,3 +1,9 @@
1+find_program(qmlplugindump_exe qmlplugindump)
3+if(NOT qmlplugindump_exe)
4+ msg(FATAL_ERROR "Could not locate qmlplugindump.")
1# Creates target for copying and installing qmlfiles
7# Creates target for copying and installing qmlfiles
3# export_qmlfiles(plugin sub_path)
9# export_qmlfiles(plugin sub_path)
@@ -40,16 +46,19 @@ macro(export_qmlplugin PLUGIN VERSION PLUGIN_SUBPATH)
40 set(multi_value_keywords TARGETS)
46 set(multi_value_keywords TARGETS)
41 cmake_parse_arguments(qmlplugin "" "" "${multi_value_keywords}" ${ARGN})
47 cmake_parse_arguments(qmlplugin "" "" "${multi_value_keywords}" ${ARGN})
49+ # Only try to generate .qmltypes if not cross compiling
50+ if(NOT CMAKE_CROSSCOMPILING)
43− # create the plugin.qmltypes file
51+ # create the plugin.qmltypes file
44− add_custom_target(${PLUGIN}-qmltypes ALL
52+ add_custom_target(${PLUGIN}-qmltypes ALL
45− COMMAND qmlplugindump -notrelocatable ${PLUGIN} ${VERSION} ${CMAKE_BINARY_DIR}/plugins > ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_SUBPATH}/plugin.qmltypes
53+ COMMAND ${qmlplugindump_exe} -notrelocatable ${PLUGIN} ${VERSION} ${CMAKE_BINARY_DIR}/plugins > ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_SUBPATH}/plugin.qmltypes
47− add_dependencies(${PLUGIN}-qmltypes ${PLUGIN}-qmlfiles ${qmlplugin_TARGETS})
55+ add_dependencies(${PLUGIN}-qmltypes ${PLUGIN}-qmlfiles ${qmlplugin_TARGETS})
49− # install the qmltypes file.
57+ # install the qmltypes file.
50− install(FILES ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_SUBPATH}/plugin.qmltypes
58+ install(FILES ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_SUBPATH}/plugin.qmltypes
51− DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/${PLUGIN_SUBPATH}
59+ DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/${PLUGIN_SUBPATH}
54 # install the additional targets
63 # install the additional targets
55 install(TARGETS ${qmlplugin_TARGETS}
64 install(TARGETS ${qmlplugin_TARGETS}