summaryrefslogtreecommitdiff
path: root/examples/demos/samegame/CMakeLists.txt
blob: 79dd0684ccd998493c51a7be9a257a6c6043c9a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

cmake_minimum_required(VERSION 3.16)
project(samegame LANGUAGES CXX)

set(CMAKE_AUTOMOC ON)

if(NOT DEFINED INSTALL_EXAMPLESDIR)
    set(INSTALL_EXAMPLESDIR "examples")
endif()

set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/samegame")

find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Sql)

qt_add_executable(samegame
    main.cpp
)

set_target_properties(samegame PROPERTIES
    WIN32_EXECUTABLE TRUE
    MACOSX_BUNDLE TRUE
)

target_link_libraries(samegame PUBLIC
    Qt6::Core
    Qt6::Gui
    Qt6::Qml
    Qt6::Quick
    Qt6::Sql
)

# Resources:
set(samegame_resource_files
    "content/Block.qml"
    "content/BlockEmitter.qml"
    "content/Button.qml"
    "content/GameArea.qml"
    "content/LogoAnimation.qml"
    "content/MenuEmitter.qml"
    "content/PaintEmitter.qml"
    "content/PrimaryPack.qml"
    "content/PuzzleBlock.qml"
    "content/SamegameText.qml"
    "content/Settings.qml"
    "content/SimpleBlock.qml"
    "content/SmokeText.qml"
    "content/gfx/background-puzzle.png"
    "content/gfx/background.png"
    "content/gfx/bar.png"
    "content/gfx/blue-puzzle.png"
    "content/gfx/blue.png"
    "content/gfx/bubble-highscore.png"
    "content/gfx/bubble-puzzle.png"
    "content/gfx/but-game-1.png"
    "content/gfx/but-game-2.png"
    "content/gfx/but-game-3.png"
    "content/gfx/but-game-4.png"
    "content/gfx/but-game-new.png"
    "content/gfx/but-menu.png"
    "content/gfx/but-puzzle-next.png"
    "content/gfx/but-quit.png"
    "content/gfx/green-puzzle.png"
    "content/gfx/green.png"
    "content/gfx/icon-fail.png"
    "content/gfx/icon-ok.png"
    "content/gfx/icon-time.png"
    "content/gfx/logo-a.png"
    "content/gfx/logo-e.png"
    "content/gfx/logo-g.png"
    "content/gfx/logo-m.png"
    "content/gfx/logo-s.png"
    "content/gfx/logo.png"
    "content/gfx/particle-brick.png"
    "content/gfx/particle-paint.png"
    "content/gfx/particle-smoke.png"
    "content/gfx/red-puzzle.png"
    "content/gfx/red.png"
    "content/gfx/text-highscore-new.png"
    "content/gfx/text-highscore.png"
    "content/gfx/text-no-winner.png"
    "content/gfx/text-p1-go.png"
    "content/gfx/text-p1-won.png"
    "content/gfx/text-p1.png"
    "content/gfx/text-p2-go.png"
    "content/gfx/text-p2-won.png"
    "content/gfx/text-p2.png"
    "content/gfx/yellow-puzzle.png"
    "content/gfx/yellow.png"
    "content/levels/TemplateBase.qml"
    "content/levels/level0.qml"
    "content/levels/level1.qml"
    "content/levels/level2.qml"
    "content/levels/level3.qml"
    "content/levels/level4.qml"
    "content/levels/level5.qml"
    "content/levels/level6.qml"
    "content/levels/level7.qml"
    "content/levels/level8.qml"
    "content/levels/level9.qml"
    "content/qmldir"
    "content/samegame.js"
    "samegame.qml"
)

qt6_add_resources(samegame "samegame"
    PREFIX
        "/demos/samegame"
    FILES
        ${samegame_resource_files}
)

install(TARGETS samegame
    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)