on xenial help sign in
Fix card creator installation
3d5fc02Michael Terry
cmake/modules/QmlTest.cmake+8−4
@@ -63,8 +63,9 @@ endfunction()
63# ${path}.
63# ${path}.
64
64
65function(add_qml_test_data PATH COMPONENT_NAME)
65function(add_qml_test_data PATH COMPONENT_NAME)
66+ cmake_parse_arguments(TEST "" "DESTINATION" "" ${ARGN})
67+
66 set(filename "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/${COMPONENT_NAME}")
68 set(filename "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/${COMPONENT_NAME}")
67− file(RELATIVE_PATH relcurpath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
68
69
69 if (IS_DIRECTORY "${filename}")
70 if (IS_DIRECTORY "${filename}")
70 # As a convenience, allow specifying a directory and we will install
71 # As a convenience, allow specifying a directory and we will install
@@ -92,9 +93,12 @@ function(add_qml_test_data PATH COMPONENT_NAME)
92 file(WRITE "${filename}" "${contents}")
93 file(WRITE "${filename}" "${contents}")
93 endif()
94 endif()
94
95
96+ if (NOT DESTINATION)
97+ file(RELATIVE_PATH relcurpath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
98+ set(DESTINATION "${SHELL_APP_DIR}/${relcurpath}/${PATH}")
99+ endif()
100+
95− install(FILES "${filename}"
101+ install(FILES "${filename}" DESTINATION "${DESTINATION}")
96− DESTINATION "${SHELL_APP_DIR}/${relcurpath}/${PATH}"
97− )
98endfunction()
102endfunction()
99
103
100
104
tests/plugins/Dash/CMakeLists.txt+7−3
@@ -73,8 +73,10 @@ add_dashview_try_test(horizontaljournal HorizontalJournal)
73add_dashview_try_test(organicgrid OrganicGrid)
73add_dashview_try_test(organicgrid OrganicGrid)
74
74
75# Install data files needed for tests
75# Install data files needed for tests
76−file(GLOB qml_files *.qml)
76+file(GLOB qml_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.qml)
77−install(FILES ${qml_files} DESTINATION "${SHELL_APP_DIR}/tests/plugins/Dash")
77+foreach(qml_file ${qml_files})
78+ add_qml_test_data(. "${qml_file}")
79+endforeach()
78
80
79# CardCreator test
81# CardCreator test
80add_executable(CardCreatorTestExec cardcreatortest.cpp)
82add_executable(CardCreatorTestExec cardcreatortest.cpp)
@@ -88,7 +90,9 @@ install(DIRECTORY cardcreator DESTINATION "${SHELL_APP_DIR}/tests/plugins/Dash")
88
90
89# This one qml file imports a file in an arch-specific directory, so to make its
91# This one qml file imports a file in an arch-specific directory, so to make its
90# import line relative, we install it into an arch-specific directory too.
92# import line relative, we install it into an arch-specific directory too.
93+add_qml_test_data(. cardcreatortest.qml
91−install(FILES cardcreatortest.qml DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash")
94+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
95+)
92
96
93# plain qml test
97# plain qml test
94foreach(dash_test ScopeStyle ListViewWithPageHeaderQML CardAttributes CroppedImageMinimumSourceSize)
98foreach(dash_test ScopeStyle ListViewWithPageHeaderQML CardAttributes CroppedImageMinimumSourceSize)