File: CMakeLists.txt

package info (click to toggle)
stopmotion 0.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 9,512 kB
  • sloc: cpp: 16,111; makefile: 17; sh: 1
file content (213 lines) | stat: -rw-r--r-- 6,152 bytes parent folder | download
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
###
# general project setup
###
cmake_minimum_required(VERSION 3.22)

project(stopmotion
  LANGUAGES CXX)
set(PROJECT_VERSION 0.9.0)

# set project options required by Qt
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

option(BUILD_TESTING "Build the tests" OFF)

###
# find external dependencies
###

# Qt
find_package(Qt6 6.5
  COMPONENTS Widgets Multimedia LinguistTools
  REQUIRED)

# LibXml2
find_package(LibXml2
  REQUIRED)

# libarchive
find_package(LibArchive
  REQUIRED)

# libVorbisFile
find_file(VORBISFILE_INCLUDE_PATH
  NAMES "vorbis/vorbisfile.h"
  REQUIRED)
find_library(VORBISFILE_LIBRARY_PATH
  NAMES vorbisfile
  REQUIRED)

if(BUILD_TESTING)
  enable_testing()
  find_package(Qt6 6.5 REQUIRED
    COMPONENTS Test
  )
  # libdl, only needed for testing
  find_library(DL_LIBRARY_PATH REQUIRED
    NAMES dl
  )
endif ()

include(FeatureSummary)
feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND)

# if given, pass path to translations and html path
if(${TRANSLATIONS_PATH})
  add_compile_definitions(TRANSLATIONS_PATH=${TRANSLATIONS_PATH})
endif()
if(${HTML_PATH})
  add_compile_definitions(HTML_PATH=${HTML_PATH})
endif()

add_subdirectory(src)
add_subdirectory(translations)

###
# handle translation files
###
file(GLOB TS_FILES "translations/stopmotion_*.ts")
qt_add_translation(QM_FILES "${TS_FILES}")

###
# create executable and link libraries
###
add_executable(stopmotion
  src/main.cpp
  src/config.cpp
  src/domain/domainfacade.cpp
  src/domain/observernotifier.cpp
  src/foundation/logger.cpp
  src/foundation/uiexception.cpp
  src/foundation/stringwriter.cpp
  src/domain/animation/animation.cpp
  src/domain/animation/animationimpl.cpp
  src/domain/animation/frame.cpp
  src/domain/animation/sound.cpp
  src/domain/animation/scenevector.cpp
  src/domain/animation/errorhandler.cpp
  src/presentation/imagecache.cpp
  src/presentation/frontends/nonguifrontend/nonguifrontend.cpp
  src/presentation/frontends/qtfrontend/mainwindowgui.cpp
  src/presentation/frontends/qtfrontend/qtfrontend.cpp
  src/application/runanimationhandler.cpp
  src/domain/undo/commandadd.cpp
  src/domain/undo/commandmove.cpp
  src/domain/undo/commandremove.cpp
  src/domain/undo/commandsetimage.cpp
  src/domain/undo/commandaddsound.cpp
  src/domain/undo/commandrenamesound.cpp
  src/domain/undo/commandremovesound.cpp
  src/domain/undo/commandaddscene.cpp
  src/domain/undo/commandmovescene.cpp
  src/domain/undo/commandremovescene.cpp
  src/domain/undo/filelogger.cpp
  src/domain/animation/workspacefile.cpp
  src/application/camerahandler.cpp
  src/presentation/frontends/qtfrontend/frameview.cpp
  src/presentation/frontends/qtfrontend/flexiblespinbox.cpp
  src/presentation/frontends/qtfrontend/menuframe.cpp
  src/presentation/frontends/qtfrontend/flexiblelineedit.cpp
  src/application/soundhandler.cpp
  src/presentation/frontends/qtfrontend/framepreferencesmenu.cpp
  src/application/editmenuhandler.cpp
  src/domain/animation/scene.cpp
  src/technical/projectserializer.cpp
  src/technical/audio/oggvorbis.cpp
  src/technical/audio/audioformat.cpp
  src/technical/audio/qtaudiodriver.cpp
  src/technical/grabber/imagegrabber.cpp
  src/technical/grabber/commandlinegrabber.cpp
  src/presentation/frontends/qtfrontend/imagegrabthread.cpp
  src/presentation/frontends/qtfrontend/preferencesmenu.cpp
  src/foundation/preferencestool.cpp
  src/application/modelhandler.cpp
  src/presentation/frontends/qtfrontend/toolsmenu.cpp
  src/application/languagehandler.cpp
  src/technical/video/videofactory.cpp
  src/technical/video/videoencoder.cpp
  src/presentation/frontends/qtfrontend/importtab.cpp
  src/presentation/frontends/qtfrontend/framebar/framebar.cpp
  src/presentation/frontends/qtfrontend/framebar/framethumbview.cpp
  src/presentation/frontends/qtfrontend/framebar/filenamesfromurlsiterator.cpp
  src/presentation/frontends/qtfrontend/framebar/scenearrowbutton.cpp
  src/presentation/frontends/qtfrontend/framebar/scenethumbview.cpp
  src/presentation/frontends/qtfrontend/framebar/thumbview.cpp
  src/presentation/frontends/qtfrontend/framebar/thumbdragger.cpp
  src/presentation/frontends/qtfrontend/exporttab.cpp
  src/presentation/frontends/qtfrontend/helpwindow.cpp
  src/presentation/frontends/qtfrontend/editobserver.cpp
  src/technical/util.cpp
  src/technical/stringiterator.cpp
  src/application/externalcommand.cpp
  src/application/externalcommandwithtemporarydirectory.cpp
  src/presentation/frontends/qtfrontend/aboutdialog.cpp
  src/presentation/frontends/qtfrontend/devicetab.cpp
  src/presentation/frontends/frontend.cpp
  src/domain/undo/command.cpp
  src/domain/undo/undoredoobserver.cpp
  src/domain/undo/commandlogger.cpp
  src/domain/undo/executor.cpp
  src/domain/undo/addallcommands.cpp
  src/domain/undo/random.cpp
  translations.qrc
  ${QM_FILES}
  )

# link to Qt libraries
target_link_libraries(stopmotion
  PUBLIC
  Qt6::Core
  Qt6::Widgets
  Qt6::Multimedia
  )
# link to LibXml2
target_link_libraries(stopmotion
  PUBLIC LibXml2::LibXml2)
# link to libVorbis, libarchive
target_link_libraries(stopmotion
  PUBLIC
  ${VORBISFILE_LIBRARY_PATH}
  LibArchive::LibArchive
  )

target_include_directories(stopmotion
  PUBLIC
  .
  src
  src/domain
  src/domain/animation
  src/foundation
  src/presentation
  src/presentation/frontends/nonguifrontend
  src/presentation/frontends/qtfrontend
  )

###
# handle installation
###
include(GNUInstallDirs)

install(TARGETS stopmotion
  RUNTIME
  DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
install(FILES stopmotion.desktop
  DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications)
install(FILES
  graphics/stopmotion.png
  graphics/stopmotion.svg
  graphics/stopmotion.xpm
  graphics/stopmotion_logo.xpm
  DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/pixmaps)
install(DIRECTORY graphics/icons
  DESTINATION ${CMAKE_INSTALL_FULL_DATADIR})
install(FILES ${QM_FILES}
  DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/stopmotion/translations)
install(FILES stopmotion.1
  DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1)
install(DIRECTORY manual
  DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR})