1
project(ubuntu-html5-container)
3
# setup install location
5
COMMAND qmake -query QT_INSTALL_QML
6
OUTPUT_VARIABLE QT_INSTALL_QML
7
OUTPUT_STRIP_TRAILING_WHITESPACE
9
set(HTML5_CONTAINER_IMPORTS_DIR "${QT_INSTALL_QML}/Ubuntu/WebApps")
11
# setup install for local component files
12
file(GLOB QML_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qml qmldir)
13
install(FILES ${QML_FILES} DESTINATION ${HTML5_CONTAINER_IMPORTS_DIR})
15
# make sure that we have all the files in the right place if we test locally
16
# & have a specific build dir
17
if(NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
18
foreach(_qmlfile ${QML_FILES})
19
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_qmlfile}
20
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_qmlfile}
21
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${_qmlfile} ${CMAKE_CURRENT_BINARY_DIR}/${_qmlfile})
23
add_custom_target(copy_to_build_dir DEPENDS ${QML_FILES})