@@ -1,3 +1,6 @@
1+# export_qmlplugin macro
1find_package(Qt5Core REQUIRED)
4find_package(Qt5Core REQUIRED)
2find_package(Qt5Quick REQUIRED)
5find_package(Qt5Quick REQUIRED)
3pkg_search_module(DEE dee-1.0 REQUIRED)
6pkg_search_module(DEE dee-1.0 REQUIRED)
@@ -35,30 +38,5 @@ target_link_libraries(HudClientQml
36qt5_use_modules(HudClientQml Qml)
39qt5_use_modules(HudClientQml Qml)
38−file(GLOB HudClient_QMLFILES
41+# export the qmldir and qmltypes files
42−# copy qmldir file into build directory for shadow builds
43−add_custom_target(HudClientQmlFiles ALL
44− COMMAND cp ${HudClient_QMLFILES} ${CMAKE_CURRENT_BINARY_DIR}
45− DEPENDS ${HudClient_QMLFILES}
48−# create the HudClient.qmltypes file
49−add_custom_target(HudClientQmlTypes ALL
50− COMMAND qmlplugindump -notrelocatable HudClient 0.1 ${CMAKE_BINARY_DIR}/plugins > ${CMAKE_CURRENT_BINARY_DIR}/HudClient.qmltypes
52−add_dependencies(HudClientQmlTypes HudClientQml HudClientQmlFiles)
54−install(TARGETS HudClientQml
42+export_qmlplugin(HudClient 0.1 plugins HudClient TARGETS HudClientQml)
55− DESTINATION ${SHELL_APP_DIR}/plugins/HudClient
58−install(FILES ${HudClient_QMLFILES}
59− DESTINATION ${SHELL_APP_DIR}/plugins/HudClient
62−install(FILES ${CMAKE_CURRENT_BINARY_DIR}/HudClient.qmltypes
63− DESTINATION ${SHELL_APP_DIR}/plugins/HudClient