Add missing QT_INSTALL_DIR paths to qml files and test data
Make sure that paths passed to qt_copy_or_install are prefixed with QT_INSTALL_DIR so that they behave correctly with prefix and non-prefix builds. Make sure that plugin.qmltypes and qmldir are also copied to binary dir when doing prefix builds to match qmake's behavior. Change-Id: I6f87ed478e797c9f66dbf85264904ad29a60ad95 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
This commit is contained in:
parent
96bdec394c
commit
1072a8f579
@ -1831,19 +1831,35 @@ function(add_qml_module target)
|
|||||||
IMPORT_NAME "${arg_IMPORT_NAME}"
|
IMPORT_NAME "${arg_IMPORT_NAME}"
|
||||||
QML_PLUGINDUMP_DEPENDENCIES "${arg_QML_PLUGINDUMP_DEPENDENCIES}")
|
QML_PLUGINDUMP_DEPENDENCIES "${arg_QML_PLUGINDUMP_DEPENDENCIES}")
|
||||||
|
|
||||||
|
qt_path_join(qml_module_install_dir ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/${target_path}")
|
||||||
set(plugin_types "${CMAKE_CURRENT_SOURCE_DIR}/plugins.qmltypes")
|
set(plugin_types "${CMAKE_CURRENT_SOURCE_DIR}/plugins.qmltypes")
|
||||||
if (EXISTS ${plugin_types})
|
if (EXISTS ${plugin_types})
|
||||||
qt_copy_or_install(FILES ${plugin_types}
|
qt_copy_or_install(FILES ${plugin_types}
|
||||||
DESTINATION "${INSTALL_QMLDIR}/${target_path}"
|
DESTINATION "${qml_module_install_dir}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(QT_WILL_INSTALL)
|
||||||
|
# plugin.qmltypes when present should also be copied to the
|
||||||
|
# cmake binary dir when doing prefix builds
|
||||||
|
file(COPY ${plugin_types}
|
||||||
|
DESTINATION "${QT_BUILD_DIR}/${INSTALL_QMLDIR}/${target_path}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_copy_or_install(
|
qt_copy_or_install(
|
||||||
FILES
|
FILES
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
|
"${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
|
||||||
DESTINATION
|
DESTINATION
|
||||||
"${INSTALL_QMLDIR}/${target_path}"
|
"${qml_module_install_dir}"
|
||||||
)
|
)
|
||||||
|
if(QT_WILL_INSTALL)
|
||||||
|
# qmldir should also be copied to the cmake binary dir when doing
|
||||||
|
# prefix builds
|
||||||
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
|
||||||
|
DESTINATION "${QT_BUILD_DIR}/${INSTALL_QMLDIR}/${target_path}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT QT_BUILD_SHARED_LIBS)
|
if(NOT QT_BUILD_SHARED_LIBS)
|
||||||
string(REPLACE "/" "." uri ${arg_TARGET_PATH})
|
string(REPLACE "/" "." uri ${arg_TARGET_PATH})
|
||||||
@ -1854,7 +1870,7 @@ function(add_qml_module target)
|
|||||||
else()
|
else()
|
||||||
if(arg_QML_FILES)
|
if(arg_QML_FILES)
|
||||||
qt_copy_or_install(FILES ${arg_QML_FILES}
|
qt_copy_or_install(FILES ${arg_QML_FILES}
|
||||||
DESTINATION "${INSTALL_QMLDIR}/${target_path}"
|
DESTINATION "${qml_module_install_dir}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -1994,16 +2010,17 @@ function(add_qt_test name)
|
|||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
# Install test data
|
# Install test data
|
||||||
|
qt_path_join(testdata_install_dir ${QT_INSTALL_DIR} "${INSTALL_TESTDIR}/${name}")
|
||||||
foreach(testdata IN LISTS arg_TESTDATA)
|
foreach(testdata IN LISTS arg_TESTDATA)
|
||||||
set(testdata "${CMAKE_CURRENT_SOURCE_DIR}/${testdata}")
|
set(testdata "${CMAKE_CURRENT_SOURCE_DIR}/${testdata}")
|
||||||
if (IS_DIRECTORY "${testdata}")
|
if (IS_DIRECTORY "${testdata}")
|
||||||
qt_copy_or_install(
|
qt_copy_or_install(
|
||||||
DIRECTORY "${testdata}"
|
DIRECTORY "${testdata}"
|
||||||
DESTINATION "${INSTALL_TESTSDIR}/${name}")
|
DESTINATION "${testdata_install_dir}")
|
||||||
else()
|
else()
|
||||||
qt_copy_or_install(
|
qt_copy_or_install(
|
||||||
FILES "${testdata}"
|
FILES "${testdata}"
|
||||||
DESTINATION "${INSTALL_TESTSDIR}/${name}")
|
DESTINATION "${testdata_install_dir}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user