1
project(ubuntu-calculator-app 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 ubuntu-calculator-app)
37
set(UBUNTU-CALCULATOR-APP_DIR "share/qml/ubuntu-calculator-app")
38
set(MAIN_QML "ubuntu-calculator-app.qml")
39
set(ICON "graphics/ubuntu-calculator-app.png")
42
set(CMAKE_INSTALL_PREFIX /)
44
set(DESKTOP_DIR ${DATA_DIR})
45
set(DESKTOP_FILE_NAME "ubuntu-calculator-app.desktop")
47
# This sets the commandline that is executed on the device
48
set(EXEC "qmlscene $@ ${UBUNTU-CALCULATOR-APP_DIR}/${MAIN_QML}")
50
# Configures the manifest file. The manifest file describes the click package
51
# to the target system. All cmake variables that are defined at this point
52
# can be used in the manifest file and will be automatically replaced by cmake
53
configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
54
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json
55
DESTINATION ${CMAKE_INSTALL_PREFIX})
57
install(DIRECTORY "app/graphics" DESTINATION ${DATA_DIR})
58
install(FILES "ubuntu-calculator-app.apparmor" DESTINATION ${DATA_DIR})
63
add_custom_target("autopilot" chmod +x ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run
64
COMMAND ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run
65
WORKING_DIRECTORY ./app)
67
add_custom_target("check" /usr/bin/qmltestrunner -input ${CMAKE_SOURCE_DIR}/app/tests/unit -import ${CMAKE_BINARY_DIR}/backend
68
WORKING_DIRECTORY ./app)
70
add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend ${CMAKE_SOURCE_DIR}/app/ubuntu-calculator-app.qml
71
WORKING_DIRECTORY ./app)
73
# Normally QtCreator would only show files that are part of a target, but we need it to show also files
74
# that are not compiled. Therefore we add a custom target that just does nothing but list the files
75
add_custom_target("ubuntu-calculator-app_ClickFiles" ALL SOURCES "ubuntu-calculator-app.apparmor" "manifest.json.in")