on xenial help sign in
Fix card creator installation
commit3d5fc02da36575e2b8d4934a9475ce37739f596c authorMichael Terry <michael.terry@canonical.com> dateWed 27 Apr 2016, 12:42 (11 years ago) parent6ab47fb
2 files changed+15−7
cmake/modules/QmlTest.cmake+8−4 tests/plugins/Dash/CMakeLists.txt+7−3
cmake/modules/QmlTest.cmake+8−4
@@ -63,8 +63,9 @@ endfunction()
6363# ${path}.
6464
6565function(add_qml_test_data PATH COMPONENT_NAME)
66+ cmake_parse_arguments(TEST "" "DESTINATION" "" ${ARGN})
67+
6668 set(filename "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/${COMPONENT_NAME}")
67− file(RELATIVE_PATH relcurpath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
6869
6970 if (IS_DIRECTORY "${filename}")
7071 # As a convenience, allow specifying a directory and we will install
@@ -92,9 +93,12 @@ function(add_qml_test_data PATH COMPONENT_NAME)
9293 file(WRITE "${filename}" "${contents}")
9394 endif()
9495
95− install(FILES "${filename}"
96− DESTINATION "${SHELL_APP_DIR}/${relcurpath}/${PATH}"
97− )
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+
101+ install(FILES "${filename}" DESTINATION "${DESTINATION}")
98102endfunction()
99103
100104
tests/plugins/Dash/CMakeLists.txt+7−3
@@ -73,8 +73,10 @@ add_dashview_try_test(horizontaljournal HorizontalJournal)
7373add_dashview_try_test(organicgrid OrganicGrid)
7474
7575# Install data files needed for tests
76−file(GLOB qml_files *.qml)
77−install(FILES ${qml_files} DESTINATION "${SHELL_APP_DIR}/tests/plugins/Dash")
76+file(GLOB qml_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.qml)
77+foreach(qml_file ${qml_files})
78+ add_qml_test_data(. "${qml_file}")
79+endforeach()
7880
7981# CardCreator test
8082add_executable(CardCreatorTestExec cardcreatortest.cpp)
@@ -88,7 +90,9 @@ install(DIRECTORY cardcreator DESTINATION "${SHELL_APP_DIR}/tests/plugins/Dash")
8890
8991# This one qml file imports a file in an arch-specific directory, so to make its
9092# import line relative, we install it into an arch-specific directory too.
91−install(FILES cardcreatortest.qml DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash")
93+add_qml_test_data(. cardcreatortest.qml
94+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/plugins/Dash"
95+)
9296
9397# plain qml test
9498foreach(dash_test ScopeStyle ListViewWithPageHeaderQML CardAttributes CroppedImageMinimumSourceSize)