~bhdouglass/finger-painting/master

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Brian Douglass
  • Date: 2016-03-13 05:13:35 UTC
  • Revision ID: git-v1:eb50ad6aca040b02e8ff5c479290caeb22ec32a4
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
project(finger-painting C CXX)
 
2
cmake_minimum_required(VERSION 2.8.9)
 
3
 
 
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")
 
6
 
 
7
find_package(Qt5Core)
 
8
find_package(Qt5Qml)
 
9
find_package(Qt5Quick)
 
10
# Find_package(ubuntu-sdk-libs)
 
11
 
 
12
#automatically create moc files
 
13
set(CMAKE_AUTOMOC ON)
 
14
 
 
15
# Figure out the component install path
 
16
execute_process(
 
17
    COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
 
18
    OUTPUT_VARIABLE ARCH_TRIPLET
 
19
    OUTPUT_STRIP_TRAILING_WHITESPACE
 
20
)
 
21
 
 
22
set(CLICK_ARCH "all")
 
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
 
26
# execute_process(
 
27
#   COMMAND dpkg-architecture -qDEB_HOST_ARCH
 
28
#   OUTPUT_VARIABLE CLICK_ARCH
 
29
#   OUTPUT_STRIP_TRAILING_WHITESPACE
 
30
# )
 
31
 
 
32
set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")
 
33
 
 
34
option(INSTALL_TESTS "Install the tests on make install" on)
 
35
 
 
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")
 
41
 
 
42
# Set install paths
 
43
set(CMAKE_INSTALL_PREFIX /)
 
44
set(DATA_DIR /)
 
45
set(DESKTOP_DIR ${DATA_DIR})
 
46
set(DESKTOP_FILE_NAME "finger-painting.desktop")
 
47
 
 
48
# This sets the commandline that is executed on the device
 
49
set(EXEC "qmlscene %U ${FINGER-PAINTING_DIR}/${MAIN_QML}")
 
50
 
 
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})
 
57
 
 
58
install(DIRECTORY "app/graphics" DESTINATION ${DATA_DIR})
 
59
install(FILES "finger-painting.apparmor" DESTINATION ${DATA_DIR})
 
60
 
 
61
add_subdirectory(app)
 
62
add_subdirectory(po)
 
63
 
 
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)
 
67
 
 
68
add_custom_target("check" /usr/bin/qmltestrunner -input ${CMAKE_SOURCE_DIR}/app/tests/unit -import ${CMAKE_BINARY_DIR}/backend
 
69
                    WORKING_DIRECTORY ./app)
 
70
 
 
71
add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend  ${CMAKE_SOURCE_DIR}/app/finger-painting.qml
 
72
                    WORKING_DIRECTORY ./app)
 
73
 
 
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")
 
77