@@ -111,10 +111,13 @@ macro(export_qmlplugin PLUGIN VERSION PATH)
111 set(qmlplugin_dir ${QMLPLUGIN_BINARY_DIR}/${PATH})
111 set(qmlplugin_dir ${QMLPLUGIN_BINARY_DIR}/${PATH})
113 # Find import path to point qmlplugindump at
113 # Find import path to point qmlplugindump at
114− string(REGEX REPLACE "${PATH}$" "" QMLPLUGIN_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
114+ string(REGEX REPLACE "/${PATH}$" "" QMLPLUGIN_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
115 set(qmlplugin_dir ${CMAKE_CURRENT_BINARY_DIR})
115 set(qmlplugin_dir ${CMAKE_CURRENT_BINARY_DIR})
118+ # Relative path for the module
119+ string(REPLACE "${CMAKE_BINARY_DIR}/" "" QMLPLUGIN_MODULE_DIR "${QMLPLUGIN_BINARY_DIR}")
118 # Find the last segment of the plugin name to use as qmltypes basename
121 # Find the last segment of the plugin name to use as qmltypes basename
119 string(REGEX MATCH "[^.]+$" plugin_suffix ${PLUGIN})
122 string(REGEX MATCH "[^.]+$" plugin_suffix ${PLUGIN})
120 set(target_prefix ${QMLPLUGIN_TARGET_PREFIX}${PLUGIN})
123 set(target_prefix ${QMLPLUGIN_TARGET_PREFIX}${PLUGIN})
@@ -122,7 +125,8 @@ macro(export_qmlplugin PLUGIN VERSION PATH)
123 add_custom_target(${target_prefix}-qmltypes
126 add_custom_target(${target_prefix}-qmltypes
124 COMMAND env ${QMLPLUGIN_ENVIRONMENT} ${qmlplugindump_executable} -notrelocatable
127 COMMAND env ${QMLPLUGIN_ENVIRONMENT} ${qmlplugindump_executable} -notrelocatable
125− ${PLUGIN} ${VERSION} ${QMLPLUGIN_BINARY_DIR} > ${qmltypes_path}
128+ ${PLUGIN} ${VERSION} ${QMLPLUGIN_MODULE_DIR} > ${qmltypes_path}
129+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
127 add_dependencies(${target_prefix}-qmltypes ${target_prefix}-qmlfiles ${QMLPLUGIN_TARGETS})
131 add_dependencies(${target_prefix}-qmltypes ${target_prefix}-qmlfiles ${QMLPLUGIN_TARGETS})
128 add_dependencies(qmltypes ${target_prefix}-qmltypes)
132 add_dependencies(qmltypes ${target_prefix}-qmltypes)