blob: d3775d520eb8caa20ee63aaa225a544a6c3d78c6 [file] [log] [blame]
Alexandre Lision10e86dd2015-01-19 16:11:14 -05001CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2
3IF(POLICY CMP0022)
4 CMAKE_POLICY(SET CMP0022 NEW)
5ENDIF(POLICY CMP0022)
6
Kateryna Kostiuk85a334e2018-12-03 15:54:19 -05007SET(PROJ_NAME Jami)
Kateryna Kostiuk5d10ee22018-05-16 10:09:05 -04008option(RELEASE_TYPE "RELEASE_TYPE" "website")
Alexandre Lision3d4143a2015-06-10 14:27:49 -04009
10# To build nighlies we need to update RING_VERSION with an optional command line arg
11IF("${RING_VERSION}" STREQUAL "")
Guillaume Roguez812d5502016-03-16 22:46:29 -040012 SET(RING_VERSION "1.0.0")
Alexandre Lision3d4143a2015-06-10 14:27:49 -040013ENDIF("${RING_VERSION}" STREQUAL "")
Kateryna Kostiuk5d10ee22018-05-16 10:09:05 -040014# if build for App Store version and build number should be incremented
15IF("${RELEASE_TYPE}" STREQUAL "AppStore")
Kateryna Kostiuka6a68b12019-06-03 17:39:14 -040016 SET(RING_VERSION_NAME "1.36")
Kateryna Kostiuk5d10ee22018-05-16 10:09:05 -040017ELSE()
Kateryna Kostiuk8be23e52018-08-23 16:01:05 -040018 SET(RING_VERSION_NAME "1")
Kateryna Kostiuk5d10ee22018-05-16 10:09:05 -040019ENDIF()
Alexandre Lisionbb306132015-03-27 11:30:02 -040020
Alexandre Lision71b41512016-05-02 13:53:44 -040021MESSAGE("Building Ring version - " ${RING_VERSION_NAME} " " ${RING_VERSION})
Sébastien Blin029ffa82019-01-02 17:43:48 -050022SET(PROJ_COPYRIGHT " © 2015-2019 Savoir-faire Linux \n GPLv3 https://www.gnu.org/copyleft/gpl.html")
Alexandre Lisionb47b4c82015-01-20 11:29:03 -050023
Anthony Léonard643a3902017-12-19 15:40:17 -050024SET(CMAKE_CXX_STANDARD 14)
25
26ADD_DEFINITIONS("-stdlib=libc++ -fobjc-arc")
Alexandre Lision5855b6a2015-02-03 11:31:05 -050027
Alexandre Lisionb47b4c82015-01-20 11:29:03 -050028PROJECT(${PROJ_NAME})
Alexandre Lision10e86dd2015-01-19 16:11:14 -050029
Alexandre Lision10e86dd2015-01-19 16:11:14 -050030FIND_PACKAGE(Qt5Core REQUIRED)
Alexandre Lision3b0bd332015-03-15 18:43:07 -040031FIND_PACKAGE(Qt5MacExtras REQUIRED)
Alexandre Lision10e86dd2015-01-19 16:11:14 -050032FIND_PACKAGE(Qt5Widgets REQUIRED)
Anthony Léonard786d4182017-11-08 14:26:31 -050033FIND_PACKAGE(Qt5Sql REQUIRED)
Alexandre Lision10e86dd2015-01-19 16:11:14 -050034FIND_PACKAGE(LibRingClient REQUIRED)
Anthony Léonard14e7bf32017-06-08 08:13:16 -040035FIND_PACKAGE(OpenGL REQUIRED)
Alexandre Lision10e86dd2015-01-19 16:11:14 -050036
Alexandre Lisionfd0d6c82016-03-29 17:06:54 -040037EXECUTE_PROCESS(COMMAND git submodule update --init
38 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
39
Kateryna Kostiuk00dcbff2019-07-11 15:42:13 -040040get_filename_component(PARENT_DIR ${CMAKE_SOURCE_DIR} PATH)
41
Alexandre Lisionfd0d6c82016-03-29 17:06:54 -040042INCLUDE(ExternalProject)
43ExternalProject_Add(libqrencode
44 GIT_SUBMODULES libqrencode
45 SOURCE_DIR ${CMAKE_SOURCE_DIR}/libqrencode
46 BINARY_DIR ${CMAKE_SOURCE_DIR}/libqrencode
47 INSTALL_DIR ${CMAKE_SOURCE_DIR}/libqrencode
48 CONFIGURE_COMMAND
49 #hack to fix incomplete config.h on first run
50 COMMAND ./autogen.sh
51 COMMAND ./autogen.sh && ./configure --prefix=${CMAKE_SOURCE_DIR}/libqrencode
52 BUILD_COMMAND make
53 INSTALL_COMMAND make install)
54
55INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libqrencode/include)
56LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/libqrencode/lib)
Kateryna Kostiuk00dcbff2019-07-11 15:42:13 -040057INCLUDE_DIRECTORIES(${PARENT_DIR}/daemon/contrib/native/ffmpeg)
58
59set(SHADERS_FILE "Shader.metallib")
60add_custom_command (OUTPUT ${CMAKE_SOURCE_DIR}/Shader.metallib
61 COMMAND ${CMAKE_SOURCE_DIR}/generateShaderLib.sh
62 COMMENT "Creating Shader.metallib")
63
64 add_custom_target(
65 shader ALL
66 DEPENDS ${CMAKE_SOURCE_DIR}/Shader.metallib
67 )
Alexandre Lisionfd0d6c82016-03-29 17:06:54 -040068
Alexandre Lision3d4143a2015-06-10 14:27:49 -040069IF(NOT (${ENABLE_SPARKLE} MATCHES false))
70 MESSAGE("Sparkle auto-update enabled")
71
72 # find_library searches in /Library/Frameworks by default
73 # We add an hint to our custom location
74
75 FIND_LIBRARY(SPARKLE_FRAMEWORK
76 NAMES Sparkle
77 HINTS ${CMAKE_CURRENT_SOURCE_DIR}/sparkle)
78 IF(EXISTS ${SPARKLE_FRAMEWORK})
79 SET(ENABLE_SPARKLE 1 CACHE BOOLEAN "Enable Sparkle")
80 ADD_DEFINITIONS(-DENABLE_SPARKLE=1)
81 MESSAGE("Sparkle is here:" ${SPARKLE_FRAMEWORK})
82 FIND_PATH(SPARKLE_INCLUDE_DIR Sparkle.h HINTS ${SPARKLE_FRAMEWORK}/Headers)
Alexandre Lision3d4143a2015-06-10 14:27:49 -040083 # we need to copy the public key to check the updates
84 SET(PUBLIC_KEY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/sparkle/dsa_pub.pem")
85 IF(EXISTS ${PUBLIC_KEY_PATH})
86 MESSAGE(STATUS "Looking for Public Key - found")
87 SET_SOURCE_FILES_PROPERTIES(${PUBLIC_KEY_PATH} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
88 SET(PUBLIC_KEY ${PUBLIC_KEY_PATH})
89 ELSE(EXISTS ${PUBLIC_KEY_PATH})
90 MESSAGE(WARNING "Looking for Public Key - not found")
91 MESSAGE(WARNING "${PUBLIC_KEY_PATH} not found Sparkle Framework will NOT work and may even prevent application from launching. Please consider disabling Sparkle Framework, creating a keypair for testing purposes")
92 ENDIF(EXISTS ${PUBLIC_KEY_PATH})
93 ELSE()
Alexandre Lisionfba8f792016-03-08 13:45:51 -050094 MESSAGE(WARNING "Sparkle framework not found, disabling it... to build it see README")
95 SET(ENABLE_SPARKLE 0 CACHE BOOLEAN "Enable Sparkle")
Alexandre Lision3d4143a2015-06-10 14:27:49 -040096 ENDIF(EXISTS ${SPARKLE_FRAMEWORK})
97ENDIF(NOT (${ENABLE_SPARKLE} MATCHES false))
98
Alexandre Lision10e86dd2015-01-19 16:11:14 -050099INCLUDE_DIRECTORIES(SYSTEM ${Qt5Core_INCLUDE_DIRS})
Alexandre Lision3b0bd332015-03-15 18:43:07 -0400100INCLUDE_DIRECTORIES(SYSTEM ${Qt5MacExtras_INCLUDE_DIRS})
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500101INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
102INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR})
103INCLUDE_DIRECTORIES(${LIB_RING_CLIENT_INCLUDE_DIR})
Anthony Léonard14e7bf32017-06-08 08:13:16 -0400104INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500105
Alexandre Lision04946de2016-03-08 09:31:38 -0500106SET(CMAKE_MACOSX_RPATH ON)
107SET(CMAKE_SKIP_BUILD_RPATH FALSE)
108SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
109SET(CMAKE_INSTALL_RPATH "${CMAKE_CURRENT_SOURCE_DIR}")
110SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
111
Alexandre Lision3d4143a2015-06-10 14:27:49 -0400112MESSAGE("LRC is here:" ${LIB_RING_CLIENT_INCLUDE_DIR})
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500113SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
114
115#Files to compile
Alexandre Lision4ba18022015-04-23 12:17:40 -0400116SET(ringclient_CONTROLLERS
Alexandre Lision7d2a48b2015-03-30 14:59:58 -0400117 src/QNSTreeController.mm
Alexandre Lision4ba18022015-04-23 12:17:40 -0400118 src/QNSTreeController.h
Alexandre Lision7d2a48b2015-03-30 14:59:58 -0400119 src/CurrentCallVC.mm
Alexandre Lision4ba18022015-04-23 12:17:40 -0400120 src/CurrentCallVC.h
Alexandre Lision7d2a48b2015-03-30 14:59:58 -0400121 src/GeneralPrefsVC.mm
122 src/RingWizardWC.mm
Alexandre Lision4ba18022015-04-23 12:17:40 -0400123 src/RingWizardWC.h
124 src/RingWindowController.mm
125 src/RingWindowController.h
Alexandre Lisionbfa68f62015-09-10 08:38:42 -0400126 src/PreferencesWC.mm
127 src/PreferencesWC.h
Kateryna Kostiuk1f8c1252018-07-30 18:18:57 -0400128 src/AccSipGeneralVC.mm
129 src/AccSipGeneralVC.h
Alexandre Lision4ba18022015-04-23 12:17:40 -0400130 src/AccAdvancedVC.mm
131 src/AccAdvancedVC.h
Kateryna Kostiuk1f8c1252018-07-30 18:18:57 -0400132 src/AccRingGeneralVC.mm
133 src/AccRingGeneralVC.h
134 src/AccAdvancedSipVC.mm
135 src/AccAdvancedSipVC.h
136 src/AccAdvancedRingVC.mm
137 src/AccAdvancedRingVC.h
Alexandre Lision4de68ce2015-04-24 18:22:49 -0400138 src/CertificateWC.mm
139 src/CertificateWC.h
Alexandre Lision886cde12016-10-25 17:39:49 -0400140 src/RestoreAccountWC.mm
141 src/RestoreAccountWC.h
Alexandre Lision4ba18022015-04-23 12:17:40 -0400142 src/AudioPrefsVC.mm
143 src/AudioPrefsVC.h
Alexandre Lision4ba18022015-04-23 12:17:40 -0400144 src/VideoPrefsVC.mm
145 src/VideoPrefsVC.h
146 src/GeneralPrefsVC.h
Alexandre Lision58cab672015-06-09 15:25:40 -0400147 src/ChatVC.mm
Alexandre Lision2db8f472015-07-22 15:05:46 -0400148 src/ChatVC.h
Alexandre Lision4dfcafc2015-08-20 12:43:23 -0400149 src/SmartViewVC.mm
Alexandre Lision883719f2015-10-22 17:37:45 -0400150 src/SmartViewVC.h
Alexandre Lision0f66bd32016-01-18 11:30:45 -0500151 src/ConversationVC.mm
Loïc Siret31d5cc02016-09-08 14:38:24 -0400152 src/ConversationVC.h
153 src/LoadingWCDelegate.h
154 src/AbstractLoadingWC.h
155 src/AbstractLoadingWC.mm
Alexandre Lision45f1f542016-08-25 15:16:17 -0400156 src/ExportPasswordWC.mm
157 src/ExportPasswordWC.h
Alexandre Lision624b1a82016-09-11 19:29:01 -0400158 src/MigrateRingAccountsWC.mm
159 src/MigrateRingAccountsWC.h
Loïc Siretfcb4ca62016-09-21 17:12:09 -0400160 src/RingWizardChooseVC.h
161 src/RingWizardChooseVC.mm
162 src/RingWizardLinkAccountVC.h
163 src/RingWizardLinkAccountVC.mm
164 src/RingWizardNewAccountVC.mm
165 src/RingWizardNewAccountVC.h
Alexandre Lision62005312016-01-28 15:55:16 -0500166 src/DialpadWC.mm
167 src/DialpadWC.h
Alexandre Lision34079c22016-10-31 16:14:02 -0400168 src/RegisterNameWC.mm
169 src/RegisterNameWC.h
Kateryna Kostiuk13b76882017-03-30 09:18:44 -0400170 src/ChooseAccountVC.h
171 src/ChooseAccountVC.mm
Kateryna Kostiuk58276bc2017-06-07 08:50:48 -0400172 src/MessagesVC.h
173 src/MessagesVC.mm
Anthony Léonard1f70f722017-10-02 10:53:32 -0400174 src/PasswordChangeWC.h
175 src/PasswordChangeWC.mm
Kateryna Kostiukecaa3952018-07-13 16:00:34 -0400176 src/LrcModelsProtocol.h
177 src/AddSIPAccountVC.mm
178 src/AddSIPAccountVC.h
Kateryna Kostiuk1f8c1252018-07-30 18:18:57 -0400179 src/AccountSettingsVC.mm
180 src/AccountSettingsVC.h
Kateryna Kostiukf6317422018-09-27 17:08:20 -0400181 src/LeaveMessageVC.mm
182 src/LeaveMessageVC.h
Loïc Siret31d5cc02016-09-08 14:38:24 -0400183)
Alexandre Lision74dd47f2015-04-14 13:47:42 -0400184
Alexandre Lision4ba18022015-04-23 12:17:40 -0400185SET(ringclient_BACKENDS
Alexandre Lision3b0bd332015-03-15 18:43:07 -0400186 src/backends/AddressBookBackend.mm
Alexandre Lision66643432015-06-04 11:59:36 -0400187 src/backends/AddressBookBackend.h)
Alexandre Lision4ba18022015-04-23 12:17:40 -0400188
189SET(ringclient_VIEWS
190 src/views/CallView.mm
191 src/views/CallView.h
Anthony Léonard14e7bf32017-06-08 08:13:16 -0400192 src/views/CallLayer.mm
193 src/views/CallLayer.h
Alexandre Lisionf47a2562015-06-15 15:48:29 -0400194 src/views/ITProgressIndicator.mm
195 src/views/ITProgressIndicator.h
Alexandre Lision2db8f472015-07-22 15:05:46 -0400196 src/views/RingOutlineView.mm
Alexandre Lision7f8351b2015-08-20 11:43:37 -0400197 src/views/RingOutlineView.h
Olivier Soldanod4311552017-11-20 15:09:53 -0500198 src/views/RingTableView.mm
199 src/views/RingTableView.h
Alexandre Lision7f8351b2015-08-20 11:43:37 -0400200 src/views/RingIDField.mm
Alexandre Lision4e280d62015-09-09 15:56:30 -0400201 src/views/RingIDField.h
202 src/views/HoverTableRowView.mm
203 src/views/HoverTableRowView.h
204 src/views/NSColor+RingTheme.mm
205 src/views/NSColor+RingTheme.h
Alexandre Lision261f1b92016-04-04 12:35:34 -0400206 src/views/NSImage+Extensions.mm
207 src/views/NSImage+Extensions.h
Alexandre Lision4e280d62015-09-09 15:56:30 -0400208 src/views/ContextualTableCellView.mm
Alexandre Lision6da08a82015-09-24 17:09:24 -0400209 src/views/ContextualTableCellView.h
210 src/views/IconButton.h
Alexandre Lision0f66bd32016-01-18 11:30:45 -0500211 src/views/IconButton.mm
Alexandre Lisione77f6f92016-04-17 23:39:39 -0400212 src/views/BackgroundView.h
213 src/views/BackgroundView.mm
Alexandre Lision0f66bd32016-01-18 11:30:45 -0500214 src/views/IMTableCellView.h
Kateryna Kostiuk13b76882017-03-30 09:18:44 -0400215 src/views/IMTableCellView.mm
216 src/views/AccountMenuItemView.h
Kateryna Kostiuka9e5c712017-05-15 16:46:16 -0400217 src/views/AccountMenuItemView.mm
Kateryna Kostiukd9039e92017-05-24 14:29:54 -0400218 src/views/RoundedTextField.h
Kateryna Kostiuk58276bc2017-06-07 08:50:48 -0400219 src/views/RoundedTextField.mm
220 src/views/MessageBubbleView.h
221 src/views/MessageBubbleView.mm
Kateryna Kostiuk64d025a2017-07-14 11:30:44 -0400222 src/views/SendMessagePanel.h
223 src/views/SendMessagePanel.mm
Kateryna Kostiuk958cd072017-07-14 15:56:35 -0400224 src/views/HoverButton.h
225 src/views/HoverButton.mm
Kateryna Kostiuk1f8c1252018-07-30 18:18:57 -0400226 src/views/CenteredClipView.h
227 src/views/CenteredClipView.mm
Kateryna Kostiuk00dcbff2019-07-11 15:42:13 -0400228 src/views/CallMTKView.h
229 src/views/CallMTKView.mm
Kateryna Kostiuk58276bc2017-06-07 08:50:48 -0400230)
Alexandre Lision4ba18022015-04-23 12:17:40 -0400231
232SET(ringclient_OTHERS
233 src/main.mm
234 src/AppDelegate.mm
235 src/AppDelegate.h
Alexandre Lision9fe374b2016-01-06 10:17:31 -0500236 src/Constants.h
Alexandre Lision83180df2016-01-18 11:32:20 -0500237 src/INDSequentialTextSelectionManager.mm
238 src/INDSequentialTextSelectionManager.h
Alexandre Lision4ba18022015-04-23 12:17:40 -0400239 src/delegates/ImageManipulationDelegate.mm
Kateryna Kostiuka16c9862017-05-03 13:30:14 -0400240 src/delegates/ImageManipulationDelegate.h
241 src/AccountSelectionManager.h
Olivier Soldanod4311552017-11-20 15:09:53 -0500242 src/AccountSelectionManager.mm
Andreas Traczyk252a94a2018-04-20 16:36:20 -0400243 src/utils.h
244 src/NSString+Extensions.h
Kateryna Kostiuk465cfbe2018-06-05 16:13:05 -0400245 src/NSString+Extensions.mm
246 src/RingMainWindow.h
Kateryna Kostiuk00dcbff2019-07-11 15:42:13 -0400247 src/RingMainWindow.mm
248 src/Shader.metal
249)
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500250
Alexandre Lisionf241c6a2015-03-24 14:53:47 -0400251SET(ringclient_XIBS
252 MainMenu
253 RingWindow
254 CurrentCall
255 GeneralPrefs
Kateryna Kostiuk1f8c1252018-07-30 18:18:57 -0400256 AccSipGeneral
Kateryna Kostiuk1f8c1252018-07-30 18:18:57 -0400257 AccRingGeneral
258 AccAdvancedSip
259 AccAdvancedRing
Alexandre Lisionf241c6a2015-03-24 14:53:47 -0400260 AudioPrefs
261 VideoPrefs
Alexandre Lisionbfa68f62015-09-10 08:38:42 -0400262 PreferencesWindow
Alexandre Lision4de68ce2015-04-24 18:22:49 -0400263 RingWizard
Alexandre Lision2db8f472015-07-22 15:05:46 -0400264 CertificateWindow
Alexandre Lision886cde12016-10-25 17:39:49 -0400265 RestoreAccountWindow
Alexandre Lision45f1f542016-08-25 15:16:17 -0400266 ExportPasswordWindow
Alexandre Lision624b1a82016-09-11 19:29:01 -0400267 MigrateRingAccountsWindow
Alexandre Lision45f1f542016-08-25 15:16:17 -0400268 Conversation
Loïc Siretfcb4ca62016-09-21 17:12:09 -0400269 RingWizardLinkAccount
270 RingWizardNewAccount
Alexandre Lision62005312016-01-28 15:55:16 -0500271 RingWizardChoose
272 Dialpad
Alexandre Lision34079c22016-10-31 16:14:02 -0400273 RegisterNameWindow
Kateryna Kostiuk13b76882017-03-30 09:18:44 -0400274 AccountMenuItemView
Anthony Léonard1f70f722017-10-02 10:53:32 -0400275 PasswordChange
Kateryna Kostiukae660fd2018-04-24 14:10:41 -0400276 MessageCells
Kateryna Kostiukecaa3952018-07-13 16:00:34 -0400277 AddSIPAccountVC
Kateryna Kostiuk1f8c1252018-07-30 18:18:57 -0400278 AccountSettings
Kateryna Kostiukf6317422018-09-27 17:08:20 -0400279 LeaveMessageVC
Alexandre Lision62005312016-01-28 15:55:16 -0500280)
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500281
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500282# Icons
Alexandre Lision5db3e4e2015-03-24 17:25:55 -0400283# This part tells CMake where to find and install the file itself
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500284SET(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/data/appicon.icns)
285SET_SOURCE_FILES_PROPERTIES(${myApp_ICON} PROPERTIES
Alexandre Lision3278ffe2016-02-03 14:45:22 -0500286 MACOSX_PACKAGE_LOCATION Resources)
Alexandre Lision7f8351b2015-08-20 11:43:37 -0400287SET(ring_ICONS
Kateryna Kostiukf6317422018-09-27 17:08:20 -0400288${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_audio_file.png
289${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_exit.png
290${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_stoprecord.png
291${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_audio.png
Kateryna Kostiuk54d76972018-06-07 15:45:07 -0400292${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_audio.png
Kateryna Kostiuk67735232018-05-10 15:05:32 -0400293${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_folder.png
Andreas Traczyk252a94a2018-04-20 16:36:20 -0400294${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_block.png
Kateryna Kostiukae660fd2018-04-24 14:10:41 -0400295${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_attachment.png
Andreas Traczyk87c999f2018-04-12 17:38:25 -0400296${CMAKE_CURRENT_SOURCE_DIR}/data/default_avatar_overlay.png
Alexandre Lision7f8351b2015-08-20 11:43:37 -0400297${CMAKE_CURRENT_SOURCE_DIR}/data/symbol_name.png
Alexandre Lisione77f6f92016-04-17 23:39:39 -0400298${CMAKE_CURRENT_SOURCE_DIR}/data/background-light.png
299${CMAKE_CURRENT_SOURCE_DIR}/data/background-dark.png
Alexandre Lision34607032016-02-08 16:16:49 -0500300${CMAKE_CURRENT_SOURCE_DIR}/data/symbol_blue.png
Alexandre Lision6da08a82015-09-24 17:09:24 -0400301${CMAKE_CURRENT_SOURCE_DIR}/data/background_tile.png
Alexandre Lision62005312016-01-28 15:55:16 -0500302${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_more.png
303${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_dialpad.png
Alexandre Lision7f8351b2015-08-20 11:43:37 -0400304${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_accept.png
Alexandre Lision0f66bd32016-01-18 11:30:45 -0500305${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_arrow_back.png
Alexandre Lision392ee722015-01-23 16:27:10 -0500306${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_call.png
307${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_cancel.png
Alexandre Lisiond18fa272015-06-15 11:18:03 -0400308${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_hangup.png
309${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_hold.png
310${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_holdoff.png
311${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_mute_video.png
312${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_mute_audio.png
313${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_chat.png
Alexandre Lision392ee722015-01-23 16:27:10 -0500314${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_search.png
Alexandre Lisionf23ec5a2015-07-16 11:24:06 -0400315${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_quality.png
Alexandre Lision266fca02015-09-28 14:47:05 -0400316${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_record.png
Alexandre Lision4dfcafc2015-08-20 12:43:23 -0400317${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_call_received.png
318${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_call_missed.png
319${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_call_made.png
Alexandre Lision883719f2015-10-22 17:37:45 -0400320${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_transfer.png
Alexandre Lision89edc6a2015-11-09 11:30:47 -0500321${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_add_participant.png
322${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_merge_calls.png
Alexandre Lisiond5229f32015-11-16 11:17:41 -0500323${CMAKE_CURRENT_SOURCE_DIR}/data/default_user_icon.png
Alexandre Lision0f66bd32016-01-18 11:30:45 -0500324${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_send.png
Alexandre Lision4a7b95e2015-02-20 10:06:43 -0500325${CMAKE_CURRENT_SOURCE_DIR}/data/dark/audio.png
Alexandre Lision2db8f472015-07-22 15:05:46 -0400326${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_person_add.png
Alexandre Lision4dfcafc2015-08-20 12:43:23 -0400327${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_persons.png
328${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_history.png
Alexandre Lision4a7b95e2015-02-20 10:06:43 -0500329${CMAKE_CURRENT_SOURCE_DIR}/data/dark/general.png
330${CMAKE_CURRENT_SOURCE_DIR}/data/dark/video.png
Alexandre Lisionf46768f2016-04-18 09:56:26 -0400331${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_delete.png
Alexandre Lisionfd0d6c82016-03-29 17:06:54 -0400332${CMAKE_CURRENT_SOURCE_DIR}/data/dark/qrcode.png
Kateryna Kostiukdb1f3a12017-04-24 12:08:28 -0400333${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_video.png
Anthony Léonarde7d62ed2018-01-25 10:51:47 -0500334${CMAKE_CURRENT_SOURCE_DIR}/data/dark/pending_contact_request.png
Kateryna Kostiuk87ae2bf2018-05-04 13:46:17 -0400335${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_file_upload.png
336${CMAKE_CURRENT_SOURCE_DIR}/data/light/ic_picture.png)
Alexandre Lision5db3e4e2015-03-24 17:25:55 -0400337
Alexandre Lision392ee722015-01-23 16:27:10 -0500338SET_SOURCE_FILES_PROPERTIES(${ring_ICONS} PROPERTIES
Alexandre Lision5855b6a2015-02-03 11:31:05 -0500339 MACOSX_PACKAGE_LOCATION Resources)
Alexandre Lisionbb306132015-03-27 11:30:02 -0400340SET_SOURCE_FILES_PROPERTIES(Credits.rtf PROPERTIES
341 MACOSX_PACKAGE_LOCATION Resources)
Kateryna Kostiuk00dcbff2019-07-11 15:42:13 -0400342SET_SOURCE_FILES_PROPERTIES(Shader.metallib PROPERTIES
343 MACOSX_PACKAGE_LOCATION Resources)
Alexandre Lision392ee722015-01-23 16:27:10 -0500344
Alexandre Lision88ee6cc2016-05-05 14:32:43 -0400345# package ringtones
346IF(NOT IS_DIRECTORY ${RINGTONE_DIR})
347 MESSAGE("No ringtone folder provided, use RINGTONE_DIR to specify one")
348 SET(RINGTONE_DIR ${CMAKE_INSTALL_PREFIX}/share/ring/ringtones)
349 MESSAGE("Trying ${RINGTONE_DIR}")
350ENDIF()
Alexandre Lision3278ffe2016-02-03 14:45:22 -0500351
Alexandre Lision88ee6cc2016-05-05 14:32:43 -0400352IF(IS_DIRECTORY ${RINGTONE_DIR})
353 FILE(GLOB RINGTONE_LIST ${RINGTONE_DIR}/*)
354 FOREACH(RINGTONE ${RINGTONE_LIST})
355 MESSAGE("Adding ringtone ${RINGTONE}")
356 GET_FILENAME_COMPONENT(FILE_PATH ${RINGTONE} ABSOLUTE)
357 SET(ring_RINGTONES ${ring_RINGTONES} ${FILE_PATH})
358 ENDFOREACH()
359ELSE()
360 MESSAGE("${RINGTONE_DIR} does not exist or is not readable")
361ENDIF()
Alexandre Lision3278ffe2016-02-03 14:45:22 -0500362
363SET_SOURCE_FILES_PROPERTIES(${ring_RINGTONES}
364 PROPERTIES MACOSX_PACKAGE_LOCATION Resources/ringtones)
Alexandre Lision46dc0c32015-09-15 10:22:59 -0400365
366# Check which translations are found for LRC
367SET(LRC_TRANSLATIONS_PATH ${CMAKE_INSTALL_PREFIX}/share/libringclient/translations)
368FILE(GLOB QM_LIST ${LRC_TRANSLATIONS_PATH}/*.qm)
369
370FOREACH(QM_FILE ${QM_LIST})
371 # Extract country code from filename
372 GET_FILENAME_COMPONENT(FILENAME ${QM_FILE} NAME_WE)
373 STRING(REGEX REPLACE "^lrc_" "" LANG ${FILENAME})
374
375 SET_SOURCE_FILES_PROPERTIES(${LRC_TRANSLATIONS_PATH}/lrc_${LANG}.qm
376 PROPERTIES MACOSX_PACKAGE_LOCATION Resources/QtTranslations)
377 SET(LOCALIZED_${LANG} ${LOCALIZED_${LANG}}
378 "${LRC_TRANSLATIONS_PATH}/lrc_${LANG}.qm")
Alexandre Lision922380d2015-09-15 10:25:17 -0400379ENDFOREACH()
380
381# Check which translations are found for the client
382FILE(GLOB LPROJ_LIST ui/*.lproj)
383
384FOREACH(LPROJ ${LPROJ_LIST})
385 # Extract country code from <lang>.lproj folder name
386 GET_FILENAME_COMPONENT(LANG ${LPROJ} NAME_WE)
387 IF(EXISTS "${LPROJ}/Localizable.strings")
388 MESSAGE("Localizable:" ${LANG})
389 SET_SOURCE_FILES_PROPERTIES(${LPROJ}/Localizable.strings
Alexandre Lision3278ffe2016-02-03 14:45:22 -0500390 PROPERTIES MACOSX_PACKAGE_LOCATION Resources/${LANG}.lproj)
Alexandre Lision922380d2015-09-15 10:25:17 -0400391
392 SET(LOCALIZED_${LANG} ${LOCALIZED_${LANG}}
393 ${LPROJ}/Localizable.strings)
394 ENDIF()
395 FOREACH(xib ${ringclient_XIBS})
396 IF(EXISTS "${LPROJ}/${xib}.strings")
397 SET_SOURCE_FILES_PROPERTIES(${LPROJ}/${xib}.strings
Alexandre Lision3278ffe2016-02-03 14:45:22 -0500398 PROPERTIES MACOSX_PACKAGE_LOCATION Resources/${LANG}.lproj)
Alexandre Lision922380d2015-09-15 10:25:17 -0400399
Alexandre Lision3278ffe2016-02-03 14:45:22 -0500400 SET(LOCALIZED_${LANG} ${LOCALIZED_${LANG}}
Alexandre Lision922380d2015-09-15 10:25:17 -0400401 ${LPROJ}/${xib}.strings)
402 ENDIF()
403 ENDFOREACH()
Alexandre Lision46dc0c32015-09-15 10:22:59 -0400404
405 # Regroup those files under a .lproj folder
406 SOURCE_GROUP("Resources\\${LANG}.lproj" FILES
407 ${LOCALIZED_${LANG}})
408 # Add them to the list of files to package
409 SET(LOCALIZABLE_FILES ${LOCALIZABLE_FILES} ${LOCALIZED_${LANG}})
410ENDFOREACH()
411
Alexandre Lision5db3e4e2015-03-24 17:25:55 -0400412# append '.xib' extension before linking xib files in executable
413FOREACH(xib ${ringclient_XIBS})
Alexandre Lision922380d2015-09-15 10:25:17 -0400414 SET(ringclient_XIBS_FOR_EXECUTABLE ${ringclient_XIBS_FOR_EXECUTABLE} ui/Base.lproj/${xib}.xib)
Alexandre Lision5db3e4e2015-03-24 17:25:55 -0400415ENDFOREACH()
416
Alexandre Lision46dc0c32015-09-15 10:22:59 -0400417SET(TO_ADD
Alexandre Lision4ba18022015-04-23 12:17:40 -0400418 ${ringclient_CONTROLLERS}
419 ${ringclient_BACKENDS}
420 ${ringclient_VIEWS}
421 ${ringclient_OTHERS}
Alexandre Lision5db3e4e2015-03-24 17:25:55 -0400422 ${ringclient_XIBS_FOR_EXECUTABLE}
Alexandre Lision46dc0c32015-09-15 10:22:59 -0400423 ${LOCALIZABLE_FILES}
Alexandre Lision392ee722015-01-23 16:27:10 -0500424 ${myApp_ICON}
Alexandre Lisionbb306132015-03-27 11:30:02 -0400425 Credits.rtf
Kateryna Kostiuk00dcbff2019-07-11 15:42:13 -0400426 Shader.metallib
Alexandre Lision3278ffe2016-02-03 14:45:22 -0500427 ${ring_ICONS}
428 ${ring_RINGTONES})
Alexandre Lision5855b6a2015-02-03 11:31:05 -0500429
Alexandre Lision3d4143a2015-06-10 14:27:49 -0400430IF(ENABLE_SPARKLE)
431 SET( TO_ADD ${TO_ADD} ${PUBLIC_KEY} ${SPARKLE_FRAMEWORK})
432ENDIF(ENABLE_SPARKLE)
433
434ADD_EXECUTABLE(${PROJ_NAME} MACOSX_BUNDLE ${TO_ADD})
435
Alexandre Lisionfd0d6c82016-03-29 17:06:54 -0400436ADD_DEPENDENCIES(${PROJ_NAME} libqrencode)
437
Alexandre Lision4ba18022015-04-23 12:17:40 -0400438# Follow Xcode hierarchy principles
439SOURCE_GROUP("Controllers" FILES ${ringclient_CONTROLLERS})
440SOURCE_GROUP("Backends" FILES ${ringclient_BACKENDS})
441SOURCE_GROUP("CustomViews" FILES ${ringclient_VIEWS})
442SOURCE_GROUP("Classes" FILES ${ringclient_OTHERS})
Alexandre Lision46dc0c32015-09-15 10:22:59 -0400443SOURCE_GROUP("Resources\\Interface Builder" FILES
444 ${ringclient_XIBS_FOR_EXECUTABLE})
Alexandre Lision3278ffe2016-02-03 14:45:22 -0500445SOURCE_GROUP("Resources\\ringtones" FILES ${ring_RINGTONES})
Alexandre Lision4ba18022015-04-23 12:17:40 -0400446
Alexandre Lision3d4143a2015-06-10 14:27:49 -0400447IF(ENABLE_SPARKLE)
448 SOURCE_GROUP("Frameworks" FILES ${SPARKLE_FRAMEWORK})
449ENDIF(ENABLE_SPARKLE)
Alexandre Lision4ba18022015-04-23 12:17:40 -0400450
Alexandre Lisionb47b4c82015-01-20 11:29:03 -0500451TARGET_LINK_LIBRARIES( ${PROJ_NAME}
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500452 ${LIB_RING_CLIENT_LIBRARY}
Alexandre Lision5855b6a2015-02-03 11:31:05 -0500453 ${Qt5Core_LIBRARIES}
Alexandre Lision3b0bd332015-03-15 18:43:07 -0400454 ${Qt5MacExtras_LIBRARIES}
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500455 ${Qt5Widgets_LIBRARIES}
Anthony Léonard14e7bf32017-06-08 08:13:16 -0400456 ${OPENGL_LIBRARIES}
Alexandre Lisionfd0d6c82016-03-29 17:06:54 -0400457 -lqrencode
Alexandre Lision10e86dd2015-01-19 16:11:14 -0500458)
459
Kateryna Kostiuk00dcbff2019-07-11 15:42:13 -0400460target_link_libraries(${PROJ_NAME} ${PARENT_DIR}/daemon/contrib/x86_64-apple-darwin${CMAKE_SYSTEM_VERSION}/lib/libavutil.a)
461
Alexandre Lision3d4143a2015-06-10 14:27:49 -0400462IF(ENABLE_SPARKLE)
463 TARGET_LINK_LIBRARIES(${PROJ_NAME} ${SPARKLE_FRAMEWORK})
464ENDIF(ENABLE_SPARKLE)
465
Alexandre Lisionf241c6a2015-03-24 14:53:47 -0400466SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AppKit")
467SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa")
468SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Quartz")
469SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AVFoundation")
470SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AddressBook")
Alexandre Lisionb9f3f942016-07-23 14:29:33 -0400471SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework SystemConfiguration")
Kateryna Kostiuk00dcbff2019-07-11 15:42:13 -0400472SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework MetalKit")
473SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Metal")
Alexandre Lisionf241c6a2015-03-24 14:53:47 -0400474
475# These variables are specific to our plist and are NOT standard CMake variables
Alexandre Lision3d4143a2015-06-10 14:27:49 -0400476SET(MACOSX_BUNDLE_NSMAIN_NIB_FILE "MainMenu")
477SET(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication")
Alexandre Lision392ee722015-01-23 16:27:10 -0500478
Kateryna Kostiuk5d10ee22018-05-16 10:09:05 -0400479# App store version should be sandboxed and using different bundle identifier
480IF("${RELEASE_TYPE}" STREQUAL "AppStore")
481 SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES
482 MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in
483 MACOSX_BUNDLE_GUI_IDENTIFIER "com.savoirfairelinux.ring.macos"
Kateryna Kostiuk85a334e2018-12-03 15:54:19 -0500484 XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_LIST_DIR}/data/Jami.entitlements"
Kateryna Kostiuk5d10ee22018-05-16 10:09:05 -0400485 MACOSX_BUNDLE_SHORT_VERSION_STRING "${RING_VERSION_NAME}"
486 MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJ_NAME} ${RING_VERSION_NAME}"
487 MACOSX_BUNDLE_BUNDLE_VERSION ${RING_VERSION}
488 MACOSX_BUNDLE_COPYRIGHT "${PROJ_COPYRIGHT}"
489 MACOSX_BUNDLE_INFO_STRING "Build of ${PROJ_NAME}, version ${RING_VERSION}"
490 MACOSX_BUNDLE_BUNDLE_NAME ${PROJ_NAME}
491 MACOSX_BUNDLE_ICON_FILE "appicon.icns"
492 )
493ELSE()
494 SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES
Alexandre Lisionb47b4c82015-01-20 11:29:03 -0500495 MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in
496 MACOSX_BUNDLE_GUI_IDENTIFIER "cx.ring"
Kateryna Kostiuk03ce9b22019-07-15 08:58:09 -0400497 XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_LIST_DIR}/data/HardenedRuntimeEntitlements/Jami.entitlements"
Alexandre Lision7208b762015-08-13 12:39:49 -0400498 MACOSX_BUNDLE_SHORT_VERSION_STRING "${RING_VERSION_NAME}"
Anthony Léonardf79fd7c2018-01-31 13:28:46 -0500499 MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJ_NAME} ${RING_VERSION_NAME}"
Alexandre Lision7208b762015-08-13 12:39:49 -0400500 MACOSX_BUNDLE_BUNDLE_VERSION ${RING_VERSION}
Alexandre Lisionbb306132015-03-27 11:30:02 -0400501 MACOSX_BUNDLE_COPYRIGHT "${PROJ_COPYRIGHT}"
Anthony Léonardf79fd7c2018-01-31 13:28:46 -0500502 MACOSX_BUNDLE_INFO_STRING "Build of ${PROJ_NAME}, version ${RING_VERSION}"
Alexandre Lisionb47b4c82015-01-20 11:29:03 -0500503 MACOSX_BUNDLE_BUNDLE_NAME ${PROJ_NAME}
504 MACOSX_BUNDLE_ICON_FILE "appicon.icns"
Kateryna Kostiuk03ce9b22019-07-15 08:58:09 -0400505 XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE
Alexandre Lisionb47b4c82015-01-20 11:29:03 -0500506 )
Kateryna Kostiuk5d10ee22018-05-16 10:09:05 -0400507ENDIF()
Alexandre Lisionf241c6a2015-03-24 14:53:47 -0400508# Make sure we can find the 'ibtool' program. If we can NOT find it we
509# skip generation of this project
510FIND_PROGRAM(IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin")
511IF(${IBTOOL} STREQUAL "IBTOOL-NOTFOUND")
512 MESSAGE(SEND_ERROR "ibtool can not be found and is needed to compile the .xib files. It should have been installed with
513 the Apple developer tools. The default system paths were searched in addition to ${OSX_DEVELOPER_ROOT}/usr/bin")
514endif()
515
Alexandre Lisionf241c6a2015-03-24 14:53:47 -0400516# Compile the .xib files using the 'ibtool' program with the destination being the app package
517FOREACH(xib ${ringclient_XIBS})
518 ADD_CUSTOM_COMMAND(TARGET ${PROJ_NAME} POST_BUILD
519 COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text
Alexandre Lision922380d2015-09-15 10:25:17 -0400520 --compile ${CMAKE_CURRENT_BINARY_DIR}/\${CONFIGURATION}/${PROJ_NAME}.app/Contents/Resources/Base.lproj/${xib}.nib
521 ${CMAKE_CURRENT_SOURCE_DIR}/ui/Base.lproj/${xib}.xib
522 COMMENT "Compiling ${CMAKE_CURRENT_SOURCE_DIR}/ui/Base.lproj/${xib}.xib")
Alexandre Lisionf241c6a2015-03-24 14:53:47 -0400523
524ENDFOREACH()
Alexandre Lisione7e01ba2015-03-30 13:30:51 -0400525
Alexandre Lision3d4143a2015-06-10 14:27:49 -0400526SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX})
Alexandre Lisione7e01ba2015-03-30 13:30:51 -0400527
528SET(APPS "\${CMAKE_INSTALL_PREFIX}/${PROJ_NAME}.app")
529
Alexandre Lisione7e01ba2015-03-30 13:30:51 -0400530INSTALL(TARGETS ${PROJ_NAME} BUNDLE DESTINATION . COMPONENT Runtime)
531
Alexandre Lision3a70f4f2015-04-15 14:18:26 -0400532SET(QT_PLUGINS_DESTDIR ${PROJ_NAME}.app/Contents/Plugins)
Alexandre Lisione7e01ba2015-03-30 13:30:51 -0400533#--------------------------------------------------------------------------------
534# Install needed Qt plugins by copying directories from the qt installation
Alexandre Lision3a70f4f2015-04-15 14:18:26 -0400535
536
537#MESSAGE("GUI====")
538#foreach(plugin ${Qt5Gui_PLUGINS})
539# message("Plugin ${plugin} is at location ${_loc}")
540#endforeach()
541
542LIST(APPEND QT_PLUGINS_IMAGEFORMAT Qt5::QTgaPlugin
543 Qt5::QGifPlugin
544 Qt5::QICNSPlugin
545 Qt5::QICOPlugin
546 Qt5::QJpegPlugin
Alexandre Lision8ac5c842017-03-18 08:45:31 +0100547 Qt5::QTiffPlugin)
Alexandre Lision3a70f4f2015-04-15 14:18:26 -0400548
549# we need two plugin directories platform and imageformats
550GET_TARGET_PROPERTY(_loc Qt5::QCocoaIntegrationPlugin LOCATION)
551INSTALL(FILES ${_loc} DESTINATION ${QT_PLUGINS_DESTDIR}/platforms COMPONENT Runtime)
552LIST(APPEND QT_PLUGINS Qt5::QCocoaIntegrationPlugin)
553
554FOREACH(plugin ${QT_PLUGINS_IMAGEFORMAT})
Alexandre Lisione7e01ba2015-03-30 13:30:51 -0400555 GET_TARGET_PROPERTY(_loc ${plugin} LOCATION)
Alexandre Lision3a70f4f2015-04-15 14:18:26 -0400556 INSTALL(FILES ${_loc} DESTINATION ${QT_PLUGINS_DESTDIR}/imageformats COMPONENT Runtime)
557 LIST(APPEND QT_PLUGINS ${plugin})
Alexandre Lisione7e01ba2015-03-30 13:30:51 -0400558ENDFOREACH()
559
Anthony Léonard786d4182017-11-08 14:26:31 -0500560# Add SQLite driver for QtSql
561GET_TARGET_PROPERTY(_loc Qt5::QSQLiteDriverPlugin LOCATION)
562INSTALL(FILES ${_loc} DESTINATION ${QT_PLUGINS_DESTDIR}/sqldrivers COMPONENT Runtime)
563LIST(APPEND QT_PLUGINS Qt5::QSQLiteDriverPlugin)
564
Alexandre Lisione7e01ba2015-03-30 13:30:51 -0400565# directories to look for dependencies
Alexandre Lisionfd0d6c82016-03-29 17:06:54 -0400566SET(DIRS ${CMAKE_INSTALL_PREFIX}/lib
567 ${QT_LIB_DIR}
568 ${CMAKE_CURRENT_SOURCE_DIR}/sparkle
569 ${CMAKE_CURRENT_SOURCE_DIR}/libqrencode/lib)
Alexandre Lisione7e01ba2015-03-30 13:30:51 -0400570
571INSTALL(CODE "
572 file(GLOB_RECURSE QTPLUGINS
573 \"\${CMAKE_INSTALL_PREFIX}/${QT_PLUGINS_DESTDIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
574 include(BundleUtilities)
575 SET(BU_CHMOD_BUNDLE_ITEMS TRUE)
576 fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
577 " COMPONENT Runtime)
578
579#================================
580# Packaging
581#================================
582SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJ_NAME})
583SET( CPACK_PACKAGE_NAME ${PROJ_NAME} )
584SET( CPACK_PACKAGE_CONTACT "Alexandre Lision")
585SET( CPACK_PACKAGE_VENDOR "Savoir-faire Linux")
586SET( CPACK_PACKAGE_VERSION_MAJOR ${PROG_MAJOR_VERSION})
587SET( CPACK_PACKAGE_VERSION_MINOR ${PROG_MINOR_VERSION})
588SET( CPACK_PACKAGE_VERSION_PATCH ${PROG_PATCH_VERSION})
589SET(CPACK_BINARY_DRAGNDROP ON)
590SET( CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
591INCLUDE(CPack)