CMakeLists.txt 16.7 KB
Newer Older
1
################################################################################
2
# CMakeLists.txt
3
# Copyright (C) 2017-2018  Belledonne Communications, Grenoble France
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#
################################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
################################################################################
22

Ronan's avatar
Ronan committed
23
cmake_minimum_required(VERSION 3.1)
Ghislain MARY's avatar
Ghislain MARY committed
24
project(linphoneqt VERSION 4.1.1)
Ronan's avatar
Ronan committed
25

26
set(APP_LIBRARY app-library)
Ronan's avatar
Ronan committed
27

28
set(EXECUTABLE_NAME linphone)
29 30
set(TESTER_EXECUTABLE_NAME "${EXECUTABLE_NAME}-tester")

31
set(TARGET_NAME linphone-qt)
32 33
set(TESTER_TARGET_NAME "${TARGET_NAME}-tester")

34
set(CMAKE_CXX_STANDARD 11)
Ronan's avatar
Ronan committed
35

36 37
set(ASSETS_DIR assets)

38
option(ENABLE_DBUS "Enable single instance handling via DBus." NO)
Ghislain MARY's avatar
Ghislain MARY committed
39 40
option(ENABLE_UPDATE_CHECK "Enable update check." NO)

41
include(GNUInstallDirs)
42
include(CheckCXXCompilerFlag)
43

Ronan's avatar
Ronan committed
44 45 46 47
# Use automatically moc from Qt5.
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

48 49 50 51 52
# Avoid cmake warning if CMP0071 is not set.
if (POLICY CMP0071)
  cmake_policy(SET CMP0071 NEW)
endif ()

53
if (NOT WIN32)
54 55
  check_cxx_compiler_flag("-Wsuggest-override" SUGGEST_OVERRIDE)
  set(CUSTOM_FLAGS "\
Ronan's avatar
Ronan committed
56
-Wall \
Ronan's avatar
Ronan committed
57 58
-Wcast-align \
-Wconversion \
59
-Werror=old-style-cast \
60
-Werror=return-type \
Ronan's avatar
Ronan committed
61 62 63
-Wextra \
-Wfloat-equal \
-Winit-self \
64
-Wnon-virtual-dtor \
Ronan's avatar
Ronan committed
65 66
-Woverloaded-virtual \
-Wpointer-arith \
67
-Wsign-conversion \
Ronan's avatar
Ronan committed
68 69 70
-Wuninitialized \
-Wunused \
")
71
  if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
72
    set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -Wlogical-op")
73 74
  endif ()
  if (SUGGEST_OVERRIDE)
75
    set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -Wsuggest-override -Werror=suggest-override")
76 77
  endif ()
endif ()
Ronan's avatar
Ronan committed
78

79 80
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -DQT_NO_EXCEPTIONS")

81
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}")
82
# See: http://stackoverflow.com/a/1372836
83
if (WIN32)
84
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WINSOCKAPI_")
85
endif ()
86

87 88 89
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG")

Ronan's avatar
Ronan committed
90 91 92
# ------------------------------------------------------------------------------
# Define packages, libs, sources, headers, resources and languages.
# ------------------------------------------------------------------------------
93

94
set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network)
95 96 97
if (ENABLE_DBUS)
  list(APPEND QT5_PACKAGES DBus)
endif ()
98
set(QT5_PACKAGES_OPTIONAL TextToSpeech)
Ronan's avatar
Ronan committed
99

100
if (LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
Ronan's avatar
Ronan committed
101
  include("${EP_linphone_CONFIG_DIR}/wrappers/cpp/LinphoneCxxConfig.cmake")
102
  include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
Ronan's avatar
Ronan committed
103
  include("${EP_belcard_CONFIG_DIR}/BelcardConfig.cmake")
104
  include("${EP_ms2_CONFIG_DIR}/Mediastreamer2Config.cmake")
105
else ()
Ronan's avatar
Ronan committed
106 107 108
  find_package(LinphoneCxx REQUIRED)
  find_package(BcToolbox REQUIRED)
  find_package(Belcard REQUIRED)
109
  find_package(Mediastreamer2 REQUIRED)
110
endif ()
jehan's avatar
jehan committed
111

Ronan's avatar
Ronan committed
112
set(SOURCES
113
  src/app/App.cpp
114
  src/app/AppController.cpp
Nicolas Follet's avatar
Nicolas Follet committed
115
  src/app/cli/Cli.cpp
116 117 118
  src/app/logger/Logger.cpp
  src/app/paths/Paths.cpp
  src/app/providers/AvatarProvider.cpp
119
  src/app/providers/ImageProvider.cpp
120 121
  src/app/providers/ThumbnailProvider.cpp
  src/app/translator/DefaultTranslator.cpp
122
  src/components/assistant/AssistantModel.cpp
123
  src/components/authentication/AuthenticationNotifier.cpp
Ronan's avatar
Ronan committed
124 125
  src/components/call/CallModel.cpp
  src/components/calls/CallsListModel.cpp
126
  src/components/calls/CallsListProxyModel.cpp
127
  src/components/camera/Camera.cpp
128
  src/components/camera/CameraPreview.cpp
129
  src/components/camera/MSFunctions.cpp
130
  src/components/chat/ChatModel.cpp
Ronan's avatar
Ronan committed
131
  src/components/chat/ChatProxyModel.cpp
132
  src/components/codecs/AbstractCodecsModel.cpp
133 134
  src/components/codecs/AudioCodecsModel.cpp
  src/components/codecs/VideoCodecsModel.cpp
135
  src/components/conference/ConferenceAddModel.cpp
136
  src/components/conference/ConferenceHelperModel.cpp
137
  src/components/conference/ConferenceModel.cpp
Ronan's avatar
Ronan committed
138 139
  src/components/contact/ContactModel.cpp
  src/components/contact/VcardModel.cpp
Ronan's avatar
Ronan committed
140 141
  src/components/contacts/ContactsListModel.cpp
  src/components/contacts/ContactsListProxyModel.cpp
Ronan's avatar
Ronan committed
142
  src/components/core/CoreHandlers.cpp
Ronan's avatar
Ronan committed
143
  src/components/core/CoreManager.cpp
144
  src/components/core/messages-count-notifier/AbstractMessagesCountNotifier.cpp
Ronan's avatar
Ronan committed
145
  src/components/notifier/Notifier.cpp
146
  src/components/other/clipboard/Clipboard.cpp
147
  src/components/other/colors/Colors.cpp
148 149
  src/components/other/text-to-speech/TextToSpeech.cpp
  src/components/other/units/Units.cpp
150
  src/components/presence/OwnPresenceModel.cpp
Ghislain MARY's avatar
Ghislain MARY committed
151
  src/components/presence/Presence.cpp
Ronan's avatar
Ronan committed
152 153
  src/components/settings/AccountSettingsModel.cpp
  src/components/settings/SettingsModel.cpp
154
  src/components/sip-addresses/SipAddressesModel.cpp
155
  src/components/sip-addresses/SipAddressesProxyModel.cpp
156
  src/components/sip-addresses/SipAddressObserver.cpp
157
  src/components/sound-player/SoundPlayer.cpp
158
  src/components/telephone-numbers/TelephoneNumbersModel.cpp
Ronan's avatar
Ronan committed
159
  src/components/timeline/TimelineModel.cpp
160
  src/components/url-handlers/UrlHandlers.cpp
161 162
  src/utils/LinphoneUtils.cpp
  src/utils/Utils.cpp
163
  src/utils/QExifImageHeader.cpp
Ronan's avatar
Ronan committed
164 165 166
)

set(HEADERS
167
  src/app/App.hpp
168
  src/app/AppController.hpp
Nicolas Follet's avatar
Nicolas Follet committed
169
  src/app/cli/Cli.hpp
170 171 172
  src/app/logger/Logger.hpp
  src/app/paths/Paths.hpp
  src/app/providers/AvatarProvider.hpp
173
  src/app/providers/ImageProvider.hpp
174
  src/app/providers/ThumbnailProvider.hpp
175
  src/app/single-application/SingleApplication.hpp
176
  src/app/translator/DefaultTranslator.hpp
177
  src/components/assistant/AssistantModel.hpp
178
  src/components/authentication/AuthenticationNotifier.hpp
Ronan's avatar
Ronan committed
179 180
  src/components/call/CallModel.hpp
  src/components/calls/CallsListModel.hpp
181
  src/components/calls/CallsListProxyModel.hpp
182
  src/components/camera/Camera.hpp
183
  src/components/camera/CameraPreview.hpp
184
  src/components/camera/MSFunctions.hpp
185
  src/components/chat/ChatModel.hpp
Ronan's avatar
Ronan committed
186
  src/components/chat/ChatProxyModel.hpp
187 188 189
  src/components/codecs/AbstractCodecsModel.hpp
  src/components/codecs/AudioCodecsModel.hpp
  src/components/codecs/VideoCodecsModel.hpp
190
  src/components/Components.hpp
191
  src/components/conference/ConferenceAddModel.hpp
192
  src/components/conference/ConferenceHelperModel.hpp
193
  src/components/conference/ConferenceModel.hpp
Ronan's avatar
Ronan committed
194 195
  src/components/contact/ContactModel.hpp
  src/components/contact/VcardModel.hpp
Ronan's avatar
Ronan committed
196 197
  src/components/contacts/ContactsListModel.hpp
  src/components/contacts/ContactsListProxyModel.hpp
Ronan's avatar
Ronan committed
198
  src/components/core/CoreHandlers.hpp
Ronan's avatar
Ronan committed
199
  src/components/core/CoreManager.hpp
200
  src/components/core/messages-count-notifier/AbstractMessagesCountNotifier.hpp
Ronan's avatar
Ronan committed
201
  src/components/notifier/Notifier.hpp
202
  src/components/other/clipboard/Clipboard.hpp
203
  src/components/other/colors/Colors.hpp
204 205
  src/components/other/text-to-speech/TextToSpeech.hpp
  src/components/other/units/Units.hpp
206
  src/components/presence/OwnPresenceModel.hpp
Ronan's avatar
Ronan committed
207 208 209
  src/components/presence/Presence.hpp
  src/components/settings/AccountSettingsModel.hpp
  src/components/settings/SettingsModel.hpp
210
  src/components/sip-addresses/SipAddressesModel.hpp
211
  src/components/sip-addresses/SipAddressesProxyModel.hpp
212
  src/components/sip-addresses/SipAddressObserver.hpp
213
  src/components/sound-player/SoundPlayer.hpp
214
  src/components/telephone-numbers/TelephoneNumbersModel.hpp
Ronan's avatar
Ronan committed
215
  src/components/timeline/TimelineModel.hpp
216
  src/components/url-handlers/UrlHandlers.hpp
217 218
  src/utils/LinphoneUtils.hpp
  src/utils/Utils.hpp
219
  src/utils/QExifImageHeader.h
Ronan's avatar
Ronan committed
220 221
)

222
set(TESTS
Ronan's avatar
Ronan committed
223 224
  src/tests/assistant-view/AssistantViewTest.cpp
  src/tests/assistant-view/AssistantViewTest.hpp
225 226
  src/tests/main-view/MainViewTest.cpp
  src/tests/main-view/MainViewTest.hpp
227 228
  src/tests/self-test/SelfTest.cpp
  src/tests/self-test/SelfTest.hpp
229 230
  src/tests/TestUtils.cpp
  src/tests/TestUtils.hpp
231 232 233 234 235
)

set(MAIN_FILE src/app/main.cpp)
set(TESTER_MAIN_FILE src/tests/main.cpp)

236 237 238 239 240 241
if (UNIX AND NOT APPLE)
  list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierLinux.cpp)
  list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierLinux.hpp)
endif ()

if (WIN32)
242 243
  list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierWindows.cpp)
  list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierWindows.hpp)
244 245 246 247 248 249 250 251
endif ()

if (APPLE)
  list(APPEND SOURCES src/components/core/messages-count-notifier/MessagesCountNotifierMacOs.m)
  list(APPEND HEADERS src/components/core/messages-count-notifier/MessagesCountNotifierMacOs.hpp)
endif ()

if (ENABLE_DBUS)
252 253
  list(APPEND SOURCES src/app/single-application/SingleApplicationDBus.cpp)
  list(APPEND HEADERS src/app/single-application/SingleApplicationDBusPrivate.hpp)
254
else ()
255 256
  list(APPEND SOURCES src/app/single-application/SingleApplication.cpp)
  list(APPEND HEADERS src/app/single-application/SingleApplicationPrivate.hpp)
257
endif ()
258

Ronan's avatar
Ronan committed
259
set(QRC_RESOURCES resources.qrc)
260

261
set(LANGUAGES_DIRECTORY "${ASSETS_DIR}/languages")
262
set(I18N_FILENAME i18n.qrc)
263
set(LANGUAGES en fr_FR)
264

Ronan's avatar
Ronan committed
265
# ------------------------------------------------------------------------------
266

267 268
function (PREPEND list prefix)
  set(new_list "")
269

270 271 272
  foreach (elem ${${list}})
    list(APPEND new_list "${prefix}${elem}")
  endforeach ()
273

274 275 276 277
  set(${list} ${new_list} PARENT_SCOPE)
endfunction ()

# Force absolute paths.
jehan's avatar
jehan committed
278 279 280
PREPEND(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/")
PREPEND(HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/")
PREPEND(QRC_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/")
281

Ronan's avatar
Ronan committed
282
# ------------------------------------------------------------------------------
283
# Compute QML files list.
Ronan's avatar
Ronan committed
284
# ------------------------------------------------------------------------------
285 286 287 288 289 290

set(QML_SOURCES)
file(STRINGS ${QRC_RESOURCES} QRC_RESOURCES_CONTENT)
foreach (line ${QRC_RESOURCES_CONTENT})
  set(result)
  string(REGEX REPLACE
Ronan's avatar
Ronan committed
291
    "^[ \t]*<[ \t]*file[ \t]*>[ \t]*(.+\\.[a-z]+)[ \t]*<[ \t]*/[ \t]*file[ \t]*>[ \t]*$"
292 293
    "\\1"
    result
294 295
    "${line}"
  )
296 297
  string(REGEX MATCH "\\.[a-z]+$" is_ui ${result})
  if (NOT ${is_ui} STREQUAL "")
jehan's avatar
jehan committed
298
    list(APPEND QML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${result}")
299 300 301
  endif ()
endforeach ()

302 303 304 305 306
# ------------------------------------------------------------------------------
# Init git hooks.
# ------------------------------------------------------------------------------

if (NOT WIN32)
Ghislain MARY's avatar
Ghislain MARY committed
307 308
  add_custom_target(
    check_qml DEPENDS ${QML_SOURCES}
jehan's avatar
jehan committed
309
    COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/check_qml_syntax"
Ghislain MARY's avatar
Ghislain MARY committed
310
  )
311
endif ()
312 313

execute_process(COMMAND ${CMAKE_COMMAND} -E copy
jehan's avatar
jehan committed
314
  "${CMAKE_CURRENT_SOURCE_DIR}/tools/private/pre-commit"
315
  "${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit"
316 317
)

Ghislain MARY's avatar
Ghislain MARY committed
318 319 320 321 322 323 324
# ------------------------------------------------------------------------------
# Create config.h file
# ------------------------------------------------------------------------------

set(MSPLUGINS_DIR "${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h")

Ronan's avatar
Ronan committed
325
# ------------------------------------------------------------------------------
326
# Build.
Ronan's avatar
Ronan committed
327
# ------------------------------------------------------------------------------
328

329
find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED)
330
find_package(Qt5 COMPONENTS ${QT5_PACKAGES_OPTIONAL} QUIET)
331
find_package(Qt5 COMPONENTS Test REQUIRED)
332

333
if (CMAKE_INSTALL_RPATH)
334 335 336 337
  get_target_property(LUPDATE_PATH Qt5::lupdate LOCATION)
  get_filename_component(LUPDATE_PATH "${LUPDATE_PATH}" DIRECTORY)
  get_filename_component(QT_PATH "${LUPDATE_PATH}/../lib" ABSOLUTE)
  list(APPEND CMAKE_INSTALL_RPATH "${QT_PATH}")
338
endif ()
339

340 341
# Add languages support.
add_subdirectory(${LANGUAGES_DIRECTORY})
jehan's avatar
jehan committed
342
list(APPEND QRC_RESOURCES "${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_FILENAME}")
343 344

# Add qrc. (images, qml, translations...)
345
qt5_add_resources(RESOURCES ${QRC_RESOURCES})
Ronan's avatar
Ronan committed
346 347

# Build.
348 349 350 351 352 353 354
add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${RESOURCES} ${QML_SOURCES})
set_property(TARGET ${APP_LIBRARY} PROPERTY POSITION_INDEPENDENT_CODE ON)

bc_git_version(${TARGET_NAME} ${PROJECT_VERSION})
add_dependencies(${APP_LIBRARY} ${TARGET_NAME}-git-version)
add_dependencies(${APP_LIBRARY} update_translations)

355
if (WIN32)
356 357
  add_executable(${TARGET_NAME} WIN32 $<TARGET_OBJECTS:${APP_LIBRARY}> assets/linphone.rc ${MAIN_FILE})
  add_executable(${TESTER_TARGET_NAME} WIN32 $<TARGET_OBJECTS:${APP_LIBRARY}> assets/linphone.rc ${TESTER_MAIN_FILE} ${TESTS})
358
else ()
359 360
  add_executable(${TARGET_NAME} $<TARGET_OBJECTS:${APP_LIBRARY}> ${MAIN_FILE})
  add_executable(${TESTER_TARGET_NAME} $<TARGET_OBJECTS:${APP_LIBRARY}> ${TESTER_MAIN_FILE} ${TESTS})
361
endif ()
362

363
if (NOT WIN32)
Ghislain MARY's avatar
Ghislain MARY committed
364
  add_dependencies(update_translations check_qml)
365
endif ()
366
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}")
367
set_target_properties(${TESTER_TARGET_NAME} PROPERTIES OUTPUT_NAME "${TESTER_EXECUTABLE_NAME}")
368

369
set(INCLUDED_DIRECTORIES "${LINPHONECXX_INCLUDE_DIRS}" "${BELCARD_INCLUDE_DIRS}" "${BCTOOLBOX_INCLUDE_DIRS}" "${MEDIASTREAMER2_INCLUDE_DIRS}")
370
set(LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BELCARD_LIBRARIES} ${LINPHONECXX_LIBRARIES})
371

372
foreach (package ${QT5_PACKAGES})
373
  list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}")
374 375 376
  # `qt5_create_translation` is provided from `LinguistTools` package.
  # But the `Qt5::LinguistTools` lib does not exist. Remove it.
  if (NOT (${package} STREQUAL LinguistTools))
377
    list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES})
378 379 380 381 382 383
  endif ()
endforeach ()

foreach (package ${QT5_PACKAGES_OPTIONAL})
  if ("${Qt5${package}_FOUND}")
    message("Optional package ${package} found.")
384 385
    list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}")
    list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES})
386 387

    string(TOUPPER "${package}" INCLUDE_NAME)
388
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${INCLUDE_NAME}_ENABLED")
389 390 391
  else ()
    message("Optional package ${package} not found.")
  endif ()
392
endforeach ()
Ronan's avatar
Ronan committed
393

394 395 396
if (APPLE)
  list(APPEND LIBRARIES "-framework Cocoa")
endif ()
397

398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
target_include_directories(${APP_LIBRARY} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES})
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES})
target_include_directories(${TESTER_TARGET_NAME} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES})

target_link_libraries(${TARGET_NAME} ${LIBRARIES})
target_link_libraries(${TESTER_TARGET_NAME} ${LIBRARIES} Qt5::Test)

foreach (target ${TARGET_NAME} ${TESTER_TARGET_NAME})
  install(TARGETS ${target}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
  )
endforeach ()
Ghislain MARY's avatar
Ghislain MARY committed
413

414
install(FILES "assets/linphone.desktop"
415 416
  DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
)
417
install(FILES "${ASSETS_DIR}/images/linphone_logo.svg"
418
  DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps/"
419 420
  RENAME "linphone.svg"
)
421

422 423 424 425
# ------------------------------------------------------------------------------
# Install rc files.
# ------------------------------------------------------------------------------

426
install(FILES "${ASSETS_DIR}/linphonerc-factory"
Ghislain MARY's avatar
Ghislain MARY committed
427 428
  DESTINATION "${CMAKE_INSTALL_DATADIR}/linphone"
)
429 430

set(ASSETS_ASSISTANT_DIR "${ASSETS_DIR}/assistant")
431
set(ASSISTANT_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/linphone/assistant")
432 433

install(FILES "${ASSETS_ASSISTANT_DIR}/use-other-sip-account.rc"
434
  DESTINATION "${ASSISTANT_INSTALL_DATADIR}"
435 436
)
install(FILES "${ASSETS_ASSISTANT_DIR}/create-linphone-sip-account.rc"
437
  DESTINATION "${ASSISTANT_INSTALL_DATADIR}"
438 439
)
install(FILES "${ASSETS_ASSISTANT_DIR}/use-linphone-sip-account.rc"
440
  DESTINATION "${ASSISTANT_INSTALL_DATADIR}"
441
)
442 443 444 445 446 447 448 449

# ------------------------------------------------------------------------------
# CPack settings.
# ------------------------------------------------------------------------------

set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES
450 451 452 453 454 455
  "^${CMAKE_BINARY_DIR}"
  "/\\\\..+"
  "OUTPUT"
  "WORK"
  "cmake_builder"
  "submodules"
456 457 458
)

include(CPack)
459

460 461 462 463 464 465 466 467 468 469 470 471 472
# ------------------------------------------------------------------------------
# To start better integration into IDE.
# ------------------------------------------------------------------------------

source_group(
  "Qml" REGULAR_EXPRESSION ".+\.qml$"
)
source_group(
  "Js" REGULAR_EXPRESSION ".+\.js)$"
)
source_group(
  "Svg" REGULAR_EXPRESSION ".+\.svg$"
)