CMakeLists.txt 6.4 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
###
#  Copyright 2013  Andreas Cord-Landwehr <cordlandwehr@kde.org>
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions
#  are met:
#
#  1. Redistributions of source code must retain the above copyright
#     notice, this list of conditions and the following disclaimer.
#  2. Redistributions in binary form must reproduce the above copyright
#     notice, this list of conditions and the following disclaimer in the
#     documentation and/or other materials provided with the distribution.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
#  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
#  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
#  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
#  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
#  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
#  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###
25
set(ARTIKULATE_VERSION_MAJOR 0)
26
set(ARTIKULATE_VERSION_MINOR 2)
27
set(ARTIKULATE_VERSION_PATCH 70)
28
29
30

configure_file("${artikulate_SOURCE_DIR}/version.h.cmake" "${artikulate_BINARY_DIR}/version.h" @ONLY)

Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
31
32
include(MacroLogFeature)

33
34
35
36
37
38
# switch sound backend to QtGStreamer
option(NO_QTMULTIMEDIA "NO_QTMULTIMEDIA" 0)
add_feature_info(NoQtMultimedia
    NO_QTMULTIMEDIA
    "Use QtGStreamer for sound backend."
)
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
39

40
find_package(KDeclarative REQUIRED)
41
find_package(QtMobility COMPONENTS MultimediaKit QUIET)
42
find_package(QtGStreamer QUIET)
43

44
45
add_subdirectory(qml)

Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
46
47
48
49
50
51
52
# set include directories
include_directories(
    ${QT_INCLUDE}
    ${KDE4_INCLUDES}
    ${CMAKE_CURRENT_BINARY_DIR}
)

53
# set the source code files from which Artikulate is compiled
54
set(artikulateCore_SRCS
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
55
    core/course.cpp
56
    core/resourcemanager.cpp
57
    core/language.cpp
58
    core/phrase.cpp
59
60
    core/phoneme.cpp
    core/phonemegroup.cpp
61
    core/unit.cpp
62
    core/profile.cpp
63
    core/skeleton.cpp
64
    core/trainingsession.cpp
65
    core/capturedevicecontroller.cpp
66
    core/outputdevicecontroller.cpp
67
68
    core/resources/resourceinterface.cpp
    core/resources/languageresource.cpp
69
    core/resources/courseresource.cpp
70
    core/resources/skeletonresource.cpp
71
    core/soundbackends/soundbackendinterface.cpp
72
73
    ui/newcoursedialog.cpp
)
74
75

set(artikulateCoreTargetLibs
76
77
78
79
80
81
82
83
84
85
86
    ${KDECLARATIVE_LIBRARIES}
    ${KDE4_KDEUI_LIBS}
    ${KDE4_PLASMA_LIBS}
    ${KDE4_KIO_LIBS}
    ${KDE4_KCMUTILS_LIBS}
    ${QT_QTCORE_LIBRARY}
    ${QT_QTOPENGL_LIBRARY}
    ${QT_QTSCRIPT_LIBRARY}
    ${QT_QTDECLARATIVE_LIBRARY}
    ${QT_QTXMLPATTERNS_LIBRARY}
    ${QT_QTSQL_LIBRARY}
87
    ${PHONON_LIBS}
88
89
)

90
91
set(artikulateTargetLibs
    artikulatecore
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
92
    learnerprofile
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
    ${KDECLARATIVE_LIBRARIES}
    ${KDE4_KDEUI_LIBS}
    ${KDE4_PLASMA_LIBS}
    ${KDE4_KIO_LIBS}
    ${KDE4_KCMUTILS_LIBS}
    ${QT_QTCORE_LIBRARY}
    ${QT_QTOPENGL_LIBRARY}
    ${QT_QTSCRIPT_LIBRARY}
    ${QT_QTDECLARATIVE_LIBRARY}
    ${QT_QTXMLPATTERNS_LIBRARY}
    ${QT_QTSQL_LIBRARY}
    ${PHONON_LIBS}
    ${KDE4_KNEWSTUFF3_LIBS}
)

108
109
# select backend and add files
if (NO_QTMULTIMEDIA)
110
111
112
    include_directories(
        ${QTGSTREAMER_INCLUDE_DIR}
    )
113
114
115
    if (NOT QTGSTREAMER_FOUND)
        message(FATAL_ERROR "Could not find QtGStreamer, which is required to build Artikulate with NO_QTMULTIMEDIA=TRUE.")
    endif()
116
117
118
119
120
121
122
123
124
125
    message("Build with alternative backend QtGStreamer")
    set(artikulateCore_SRCS
        ${artikulateCore_SRCS}
        core/soundbackends/qtgstreamerbackend.cpp
    )
    set(artikulateCoreTargetLibs
        ${artikulateCoreTargetLibs}
        ${QTGLIB_LIBRARIES}
        ${QTGSTREAMER_LIBRARIES}
    )
126
127
128
129
130
    set(artikulateeTargetLibs
        ${artikulateTargetLibs}
        ${QTGLIB_LIBRARIES}
        ${QTGSTREAMER_LIBRARIES}
    )
131
else(NO_QTMULTIMEDIA)
132
133
134
135
    include_directories(
        ${QTMOBILITY_INCLUDE_DIR}
        ${QTMOBILITY_MULTIMEDIAKIT_INCLUDE_DIR}
    )
136
137
138
139
    if (NOT QTMOBILITY_FOUND)
        message(FATAL_ERROR "Could not find QtMultimedia (part of QtMobility), which is required to build Artikulate with NO_QTMULTIMEDIA=FALSE.")
    endif()
    message("Build with default backend QtMultimedia")
140
141
142
143
144
145
146
147
    set(artikulateCore_SRCS
        ${artikulateCore_SRCS}
        core/soundbackends/qtmultimediabackend.cpp
    )
    set(artikulateCoreTargetLibs
        ${artikulateCoreTargetLibs}
        ${QTMOBILITY_MULTIMEDIAKIT_LIBRARY}
    )
148
149
150
151
    set(artikulateeTargetLibs
        ${artikulateTargetLibs}
        ${QTMOBILITY_MULTIMEDIAKIT_LIBRARY}
    )
152
153
154
155
156
157
158
159
160
endif(NO_QTMULTIMEDIA)

# compile UI files
kde4_add_ui_files(artikulateCore_SRCS
    ui/newcoursedialog.ui
)
kde4_add_kcfg_files(artikulateCore_SRCS settings.kcfgc)
kde4_add_library(artikulatecore SHARED ${artikulateCore_SRCS})
target_link_libraries(artikulatecore
161
162
163
    LINK_PRIVATE
        learnerprofile
        ${artikulateCoreTargetLibs}
164
165
166
167
168
169
)
set_target_properties(artikulatecore
    PROPERTIES VERSION ${GENERIC_LIB_VERSION}
    SOVERSION ${GENERIC_LIB_SOVERSION}
)
install(TARGETS artikulatecore ${INSTALL_TARGETS_DEFAULT_ARGS})
170
install( FILES artikulate.knsrc  DESTINATION  ${CONFIG_INSTALL_DIR} )
171

172
# set the source code files from which Artikulate is compiled
173
174
175
176
set(artikulate_SRCS
    main.cpp
    mainwindow.cpp
    application.cpp
177

Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
178
    models/coursemodel.cpp
179
    models/languagemodel.cpp
180
    models/languageresourcemodel.cpp
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
181
    models/unitmodel.cpp
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
182
    models/phrasemodel.cpp
183
    models/phrasefiltermodel.cpp
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
184
    models/phonememodel.cpp
185
186
    models/phonemegroupmodel.cpp
    models/phonemeunitmodel.cpp
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
187
    models/profilemodel.cpp
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
188
    models/skeletonmodel.cpp
189

Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
190
    ui/sounddevicedialogpage.cpp
191
    ui/appearencedialogpage.cpp
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
192
    ui/resourcesdialogpage.cpp
193

194
    declarativeitems/applicationbackground.cpp
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
195
)
196
kde4_add_ui_files(artikulate_SRCS
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
197
198
    ui/resourcesdialogpage.ui
    ui/sounddevicedialogpage.ui
199
    ui/appearencedialogpage.ui
200
)
201
kde4_add_kcfg_files(artikulate_SRCS settings.kcfgc)
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
202
kde4_add_executable(artikulate ${artikulate_SRCS})
203
target_link_libraries(artikulate
204
205
206
    LINK_PRIVATE
        learnerprofile
        ${artikulateTargetLibs}
207
)
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
208

209
install(FILES artikulate.kcfg DESTINATION ${KCFG_INSTALL_DIR})
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
210
install(TARGETS artikulate ${INSTALL_TARGETS_DEFAULT_ARGS})
211
install(FILES artikulateui.rc DESTINATION  ${DATA_INSTALL_DIR})