1
project(finger-painting C CXX)
2
cmake_minimum_required(VERSION 2.8.9)
4
# Do not remove this line, its required for the correct functionality of the Ubuntu-SDK
5
set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file")
10
# Find_package(ubuntu-sdk-libs)
12
#automatically create moc files
15
# Figure out the component install path
17
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
18
OUTPUT_VARIABLE ARCH_TRIPLET
19
OUTPUT_STRIP_TRAILING_WHITESPACE
23
# If you want to add native code to your project, replace the set CLICK_ARCH command
24
# with the following part.
25
# This command figures out the target architecture for use in the manifest file
27
# COMMAND dpkg-architecture -qDEB_HOST_ARCH
28
# OUTPUT_VARIABLE CLICK_ARCH
29
# OUTPUT_STRIP_TRAILING_WHITESPACE
32
set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")
34
option(INSTALL_TESTS "Install the tests on make install" on)
36
set(APP_NAME finger-painting)
37
set(APP_ID "finger-painting.bhdouglass")
38
set(FINGER-PAINTING_DIR "share/qml/finger-painting")
39
set(MAIN_QML "Main.qml")
40
set(ICON "graphics/finger-painting.png")
43
set(CMAKE_INSTALL_PREFIX /)
45
set(DESKTOP_DIR ${DATA_DIR})
46
set(DESKTOP_FILE_NAME "finger-painting.desktop")
48
# This sets the commandline that is executed on the device
49
set(EXEC "qmlscene %U ${FINGER-PAINTING_DIR}/${MAIN_QML}")
51
# Configures the manifest file. The manifest file describes the click package
52
# to the target system. All cmake variables that are defined at this point
53
# can be used in the manifest file and will be automatically replaced by cmake
54
configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
55
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json
56
DESTINATION ${CMAKE_INSTALL_PREFIX})
58
install(DIRECTORY "app/graphics" DESTINATION ${DATA_DIR})
59
install(FILES "finger-painting.apparmor" DESTINATION ${DATA_DIR})
64
add_custom_target("autopilot" chmod +x ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run
65
COMMAND ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run
66
WORKING_DIRECTORY ./app)
68
add_custom_target("check" /usr/bin/qmltestrunner -input ${CMAKE_SOURCE_DIR}/app/tests/unit -import ${CMAKE_BINARY_DIR}/backend
69
WORKING_DIRECTORY ./app)
71
add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend ${CMAKE_SOURCE_DIR}/app/finger-painting.qml
72
WORKING_DIRECTORY ./app)
74
# Normally QtCreator would only show files that are part of a target, but we need it to show also files
75
# that are not compiled. Therefore we add a custom target that just does nothing but list the files
76
add_custom_target("finger-painting_ClickFiles" ALL SOURCES "finger-painting.apparmor" "manifest.json.in")