2014-07-11 02:31:24 +04:00
project(gui)
2023-05-31 21:10:01 +03:00
find_package(Qt5 REQUIRED COMPONENTS Widgets Svg Qml Quick QuickControls2 QuickWidgets Xml Network)
2022-07-20 18:23:43 +03:00
find_package(KF5Archive REQUIRED)
2021-12-29 19:44:40 +03:00
if(QUICK_COMPILER)
find_package(Qt5QuickCompiler)
set_package_properties(Qt5QuickCompiler PROPERTIES
DESCRIPTION "Compile QML at build time"
2022-01-05 14:42:47 +03:00
TYPE REQUIRED
2021-12-29 19:44:40 +03:00
)
endif()
2021-11-08 15:31:50 +03:00
if (NOT TARGET Qt5::GuiPrivate)
message(FATAL_ERROR "Could not find GuiPrivate component of Qt5. It might be shipped as a separate package, please check that.")
endif()
2020-03-09 03:48:07 +03:00
2020-11-23 19:09:44 +03:00
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DQT_QML_DEBUG)
endif()
2020-03-09 03:48:07 +03:00
IF(BUILD_UPDATER)
add_subdirectory(updater)
endif()
2014-07-11 02:31:24 +04:00
2021-06-02 18:13:40 +03:00
configure_file(${CMAKE_SOURCE_DIR}/theme.qrc.in ${CMAKE_SOURCE_DIR}/theme.qrc)
set(theme_dir ${CMAKE_SOURCE_DIR}/theme)
2020-01-19 22:13:12 +03:00
2017-12-14 17:10:33 +03:00
set(client_UI_SRCS
2014-07-11 02:31:24 +04:00
accountsettings.ui
2020-10-07 18:51:18 +03:00
conflictdialog.ui
2021-09-06 16:09:29 +03:00
invalidfilenamedialog.ui
2022-11-30 12:34:49 +03:00
caseclashfilenamedialog.ui
2021-01-29 21:00:21 +03:00
foldercreationdialog.ui
2014-07-11 02:31:24 +04:00
folderwizardsourcepage.ui
folderwizardtargetpage.ui
generalsettings.ui
2018-08-02 09:36:03 +03:00
legalnotice.ui
2014-07-11 02:31:24 +04:00
ignorelisteditor.ui
2019-08-15 00:09:19 +03:00
ignorelisttablewidget.ui
2014-07-11 02:31:24 +04:00
networksettings.ui
settingsdialog.ui
sslerrordialog.ui
2014-11-18 18:44:14 +03:00
addcertificatedialog.ui
2022-01-05 13:14:23 +03:00
passwordinputdialog.ui
2015-07-16 15:21:51 +03:00
proxyauthdialog.ui
2018-06-21 20:57:51 +03:00
mnemonicdialog.ui
2023-10-13 20:21:17 +03:00
vfsdownloaderrordialog.ui
2019-12-23 08:51:46 +03:00
wizard/flow2authwidget.ui
2014-07-11 02:31:24 +04:00
wizard/owncloudadvancedsetuppage.ui
2015-02-03 00:29:21 +03:00
wizard/owncloudconnectionmethoddialog.ui
2014-07-11 02:31:24 +04:00
wizard/owncloudhttpcredspage.ui
wizard/owncloudsetupnocredspage.ui
2017-11-29 00:25:35 +03:00
wizard/webview.ui
2021-02-16 12:20:04 +03:00
wizard/welcomepage.ui
2014-07-11 02:31:24 +04:00
)
2021-12-29 19:44:40 +03:00
if(QUICK_COMPILER)
qtquick_compiler_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc)
else()
2022-01-07 14:00:02 +03:00
qt_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc)
2021-12-29 19:44:40 +03:00
endif()
2014-11-10 00:30:05 +03:00
set(client_SRCS
2022-02-07 15:48:52 +03:00
accountmanager.h
2015-04-09 17:19:17 +03:00
accountmanager.cpp
2022-02-07 15:48:52 +03:00
accountsettings.h
2014-07-11 02:31:24 +04:00
accountsettings.cpp
2022-12-29 20:28:28 +03:00
accountsetupfromcommandlinejob.h
accountsetupfromcommandlinejob.cpp
2022-12-29 14:50:17 +03:00
accountsetupcommandlinemanager.h
accountsetupcommandlinemanager.cpp
2022-02-07 15:48:52 +03:00
application.h
2014-07-11 02:31:24 +04:00
application.cpp
2022-02-07 15:48:52 +03:00
invalidfilenamedialog.h
2021-09-06 16:09:29 +03:00
invalidfilenamedialog.cpp
2022-11-30 12:34:49 +03:00
caseclashfilenamedialog.h
caseclashfilenamedialog.cpp
2022-06-24 12:49:38 +03:00
callstatechecker.h
callstatechecker.cpp
2022-02-07 15:48:52 +03:00
conflictdialog.h
2020-10-07 18:51:18 +03:00
conflictdialog.cpp
2022-02-07 15:48:52 +03:00
conflictsolver.h
2020-10-07 17:30:43 +03:00
conflictsolver.cpp
2022-02-07 15:48:52 +03:00
connectionvalidator.h
2018-02-21 17:03:55 +03:00
connectionvalidator.cpp
2022-10-29 14:21:56 +03:00
editlocallyjob.h
editlocallyjob.cpp
2022-10-28 20:40:06 +03:00
editlocallymanager.h
editlocallymanager.cpp
2023-04-10 14:27:31 +03:00
filetagmodel.h
filetagmodel.cpp
2022-02-07 15:48:52 +03:00
folder.h
2014-07-11 02:31:24 +04:00
folder.cpp
2022-02-07 15:48:52 +03:00
foldercreationdialog.h
2021-01-29 21:00:21 +03:00
foldercreationdialog.cpp
2022-02-07 15:48:52 +03:00
folderman.h
2014-07-11 02:31:24 +04:00
folderman.cpp
2022-02-07 15:48:52 +03:00
folderstatusmodel.h
2014-07-11 02:31:24 +04:00
folderstatusmodel.cpp
2022-02-07 15:48:52 +03:00
folderstatusdelegate.h
2015-06-15 15:16:21 +03:00
folderstatusdelegate.cpp
2022-02-07 15:48:52 +03:00
folderstatusview.h
2018-10-30 22:35:35 +03:00
folderstatusview.cpp
2022-02-07 15:48:52 +03:00
folderwatcher.h
2014-07-11 02:31:24 +04:00
folderwatcher.cpp
2022-02-07 15:48:52 +03:00
folderwizard.h
2014-07-11 02:31:24 +04:00
folderwizard.cpp
2022-02-07 15:48:52 +03:00
generalsettings.h
2014-07-11 02:31:24 +04:00
generalsettings.cpp
2022-02-07 15:48:52 +03:00
legalnotice.h
2018-08-02 09:36:03 +03:00
legalnotice.cpp
2022-02-07 15:48:52 +03:00
ignorelisteditor.h
2014-07-11 02:31:24 +04:00
ignorelisteditor.cpp
2022-02-07 15:48:52 +03:00
ignorelisttablewidget.h
2019-08-15 00:09:19 +03:00
ignorelisttablewidget.cpp
2022-02-07 15:48:52 +03:00
lockwatcher.h
2016-04-29 17:14:18 +03:00
lockwatcher.cpp
2022-02-07 15:48:52 +03:00
logbrowser.h
2014-07-11 02:31:24 +04:00
logbrowser.cpp
2022-02-07 15:48:52 +03:00
navigationpanehelper.h
2017-10-04 14:49:42 +03:00
navigationpanehelper.cpp
2022-02-07 15:48:52 +03:00
networksettings.h
2014-07-11 02:31:24 +04:00
networksettings.cpp
2022-02-07 15:48:52 +03:00
ocsnavigationappsjob.h
2018-02-20 21:33:25 +03:00
ocsnavigationappsjob.cpp
2023-11-28 00:12:26 +03:00
ocsjob.h
ocsjob.cpp
2022-02-07 15:48:52 +03:00
ocssharejob.h
2015-09-07 14:50:01 +03:00
ocssharejob.cpp
2022-02-07 15:48:52 +03:00
ocsshareejob.h
2015-11-02 00:23:22 +03:00
ocsshareejob.cpp
2022-02-07 15:48:52 +03:00
openfilemanager.h
2014-07-11 02:31:24 +04:00
openfilemanager.cpp
2022-02-07 15:48:52 +03:00
owncloudgui.h
2014-07-11 02:31:24 +04:00
owncloudgui.cpp
2022-02-07 15:48:52 +03:00
owncloudsetupwizard.h
2014-07-11 02:31:24 +04:00
owncloudsetupwizard.cpp
2022-02-07 15:48:52 +03:00
passwordinputdialog.h
2022-01-05 13:14:23 +03:00
passwordinputdialog.cpp
2022-02-07 15:48:52 +03:00
selectivesyncdialog.h
2014-08-26 16:33:21 +04:00
selectivesyncdialog.cpp
2022-02-07 15:48:52 +03:00
settingsdialog.h
2014-07-11 02:31:24 +04:00
settingsdialog.cpp
2022-02-07 15:48:52 +03:00
sharemanager.h
2016-09-14 16:31:05 +03:00
sharemanager.cpp
2022-02-07 15:48:52 +03:00
profilepagewidget.h
2021-10-22 12:16:38 +03:00
profilepagewidget.cpp
2022-02-07 15:48:52 +03:00
sharee.h
2015-11-02 00:23:22 +03:00
sharee.cpp
2022-02-07 15:48:52 +03:00
sslbutton.h
2014-07-11 02:31:24 +04:00
sslbutton.cpp
2022-02-07 15:48:52 +03:00
sslerrordialog.h
2014-07-11 02:31:24 +04:00
sslerrordialog.cpp
2022-02-07 15:48:52 +03:00
syncrunfilelog.h
2014-07-11 02:31:24 +04:00
syncrunfilelog.cpp
2022-02-07 15:48:52 +03:00
systray.h
2014-07-11 02:31:24 +04:00
systray.cpp
2022-02-07 15:48:52 +03:00
thumbnailjob.h
2015-09-07 14:50:01 +03:00
thumbnailjob.cpp
2022-02-07 15:48:52 +03:00
userinfo.h
2020-02-14 04:10:01 +03:00
userinfo.cpp
2023-10-13 20:21:17 +03:00
vfsdownloaderrordialog.h
vfsdownloaderrordialog.cpp
2022-02-07 15:48:52 +03:00
accountstate.h
2014-12-17 16:09:57 +03:00
accountstate.cpp
2022-02-07 15:48:52 +03:00
addcertificatedialog.h
2014-11-18 18:44:14 +03:00
addcertificatedialog.cpp
2022-02-07 15:48:52 +03:00
authenticationdialog.h
2015-06-15 16:53:45 +03:00
authenticationdialog.cpp
2022-02-07 15:48:52 +03:00
proxyauthhandler.h
2015-07-16 15:21:51 +03:00
proxyauthhandler.cpp
2022-02-07 15:48:52 +03:00
proxyauthdialog.h
2015-07-16 15:21:51 +03:00
proxyauthdialog.cpp
2022-02-07 15:48:52 +03:00
tooltipupdater.h
2016-01-21 13:32:27 +03:00
tooltipupdater.cpp
2022-02-07 15:48:52 +03:00
notificationconfirmjob.h
2016-03-04 19:41:57 +03:00
notificationconfirmjob.cpp
2022-02-07 15:48:52 +03:00
guiutility.h
2017-05-10 10:37:10 +03:00
guiutility.cpp
2022-02-07 15:48:52 +03:00
elidedlabel.h
2017-07-11 16:50:56 +03:00
elidedlabel.cpp
2022-02-07 15:48:52 +03:00
iconutils.h
2021-08-17 16:39:18 +03:00
iconutils.cpp
2022-02-07 15:48:52 +03:00
remotewipe.h
2019-07-24 14:56:21 +03:00
remotewipe.cpp
2022-02-07 15:48:52 +03:00
userstatusselectormodel.h
2021-09-09 12:18:22 +03:00
userstatusselectormodel.cpp
2022-02-07 15:48:52 +03:00
emojimodel.h
2021-09-09 12:18:22 +03:00
emojimodel.cpp
2023-05-02 14:55:17 +03:00
syncconflictsmodel.h
syncconflictsmodel.cpp
2022-02-07 15:48:52 +03:00
fileactivitylistmodel.h
2021-08-20 16:17:06 +03:00
fileactivitylistmodel.cpp
2023-08-07 15:17:00 +03:00
filedetails/datefieldbackend.h
filedetails/datefieldbackend.cpp
2022-07-25 19:57:18 +03:00
filedetails/filedetails.h
filedetails/filedetails.cpp
filedetails/sharemodel.h
filedetails/sharemodel.cpp
filedetails/shareemodel.h
filedetails/shareemodel.cpp
filedetails/sortedsharemodel.h
filedetails/sortedsharemodel.cpp
2022-02-07 15:48:52 +03:00
tray/svgimageprovider.h
2021-10-29 10:05:51 +03:00
tray/svgimageprovider.cpp
2022-02-07 15:48:52 +03:00
tray/syncstatussummary.h
2021-09-14 14:17:03 +03:00
tray/syncstatussummary.cpp
2022-02-07 15:48:52 +03:00
tray/activitydata.h
2021-10-25 12:37:58 +03:00
tray/activitydata.cpp
2022-02-07 15:48:52 +03:00
tray/activitylistmodel.h
2021-10-25 12:37:58 +03:00
tray/activitylistmodel.cpp
2022-02-07 15:48:52 +03:00
tray/unifiedsearchresult.h
2022-01-20 14:54:36 +03:00
tray/asyncimageresponse.cpp
2021-09-09 14:33:57 +03:00
tray/unifiedsearchresult.cpp
2022-02-07 15:48:52 +03:00
tray/unifiedsearchresultslistmodel.h
2022-01-20 14:54:36 +03:00
tray/trayimageprovider.cpp
2021-09-09 14:33:57 +03:00
tray/unifiedsearchresultslistmodel.cpp
2022-02-07 15:48:52 +03:00
tray/usermodel.h
2021-10-25 12:37:58 +03:00
tray/usermodel.cpp
2022-02-07 15:48:52 +03:00
tray/notificationhandler.h
2021-10-25 12:37:58 +03:00
tray/notificationhandler.cpp
2022-09-14 02:03:56 +03:00
tray/sortedactivitylistmodel.h
tray/sortedactivitylistmodel.cpp
2022-02-07 15:48:52 +03:00
creds/credentialsfactory.h
2022-01-23 21:10:16 +03:00
tray/talkreply.cpp
2015-06-15 16:53:45 +03:00
creds/credentialsfactory.cpp
2022-02-07 15:48:52 +03:00
creds/httpcredentialsgui.h
2015-06-15 16:53:45 +03:00
creds/httpcredentialsgui.cpp
2022-02-07 15:48:52 +03:00
creds/flow2auth.h
2019-08-17 03:37:04 +03:00
creds/flow2auth.cpp
2022-02-07 15:48:52 +03:00
creds/webflowcredentials.h
2017-11-25 22:19:25 +03:00
creds/webflowcredentials.cpp
2022-02-07 15:48:52 +03:00
creds/webflowcredentialsdialog.h
2017-11-29 00:25:35 +03:00
creds/webflowcredentialsdialog.cpp
2022-02-07 15:48:52 +03:00
wizard/postfixlineedit.h
2016-03-22 12:20:20 +03:00
wizard/postfixlineedit.cpp
2022-02-07 15:48:52 +03:00
wizard/abstractcredswizardpage.h
2014-07-11 02:31:24 +04:00
wizard/abstractcredswizardpage.cpp
2022-02-07 15:48:52 +03:00
wizard/owncloudadvancedsetuppage.h
2014-07-11 02:31:24 +04:00
wizard/owncloudadvancedsetuppage.cpp
2022-02-07 15:48:52 +03:00
wizard/owncloudconnectionmethoddialog.h
2015-02-03 00:29:21 +03:00
wizard/owncloudconnectionmethoddialog.cpp
2022-02-07 15:48:52 +03:00
wizard/owncloudhttpcredspage.h
2014-07-11 02:31:24 +04:00
wizard/owncloudhttpcredspage.cpp
2022-02-07 15:48:52 +03:00
wizard/flow2authcredspage.h
2019-08-17 03:37:04 +03:00
wizard/flow2authcredspage.cpp
2022-02-07 15:48:52 +03:00
wizard/flow2authwidget.h
2019-08-24 17:21:44 +03:00
wizard/flow2authwidget.cpp
2022-02-07 15:48:52 +03:00
wizard/owncloudsetuppage.h
2014-07-11 02:31:24 +04:00
wizard/owncloudsetuppage.cpp
2022-02-07 15:48:52 +03:00
wizard/owncloudwizardcommon.h
2014-07-11 02:31:24 +04:00
wizard/owncloudwizardcommon.cpp
2022-02-07 15:48:52 +03:00
wizard/owncloudwizard.h
2014-07-11 02:31:24 +04:00
wizard/owncloudwizard.cpp
2022-02-07 15:48:52 +03:00
wizard/slideshow.h
2018-10-29 13:17:04 +03:00
wizard/slideshow.cpp
2022-02-07 15:48:52 +03:00
wizard/welcomepage.h
2021-02-16 12:20:04 +03:00
wizard/welcomepage.cpp
2022-02-07 15:48:52 +03:00
wizard/linklabel.h
2021-02-16 12:20:04 +03:00
wizard/linklabel.cpp
2021-06-22 13:01:18 +03:00
)
2021-06-24 10:54:54 +03:00
if (Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND)
2021-06-22 13:01:18 +03:00
list(APPEND client_SRCS
2022-02-07 15:48:52 +03:00
wizard/webviewpage.h
2021-06-22 13:01:18 +03:00
wizard/webviewpage.cpp
2022-02-07 15:48:52 +03:00
wizard/webview.h
2021-06-22 13:01:18 +03:00
wizard/webview.cpp
)
endif()
2014-07-11 02:31:24 +04:00
2020-03-09 03:48:07 +03:00
IF(BUILD_UPDATER)
set(updater_SRCS
2022-02-07 15:48:52 +03:00
updater/ocupdater.h
2020-03-09 03:48:07 +03:00
updater/ocupdater.cpp
2022-02-07 15:48:52 +03:00
updater/updateinfo.h
2020-03-09 03:48:07 +03:00
updater/updateinfo.cpp
2022-02-07 15:48:52 +03:00
updater/updater.h
2020-03-09 03:48:07 +03:00
updater/updater.cpp
)
endif()
2014-07-11 02:31:24 +04:00
IF( APPLE )
2014-11-10 00:30:05 +03:00
list(APPEND client_SRCS cocoainitializer_mac.mm)
2015-02-07 20:23:09 +03:00
list(APPEND client_SRCS systray.mm)
2023-03-15 13:04:19 +03:00
if (BUILD_FILE_PROVIDER_MODULE)
list(APPEND client_SRCS
2023-11-22 14:42:05 +03:00
# Symlinks to files in shell_integration/MacOSX/NextcloudIntegration/
macOS/ClientCommunicationProtocol.h
# End of symlink files
2023-03-15 13:04:19 +03:00
macOS/fileprovider.h
macOS/fileprovider_mac.mm
macOS/fileproviderdomainmanager.h
macOS/fileproviderdomainmanager_mac.mm
2023-09-28 15:45:19 +03:00
macOS/fileprovideritemmetadata.h
macOS/fileprovideritemmetadata.cpp
2023-09-28 19:38:12 +03:00
macOS/fileprovideritemmetadata_mac.mm
2023-10-10 06:30:29 +03:00
macOS/fileprovidermaterialiseditemsmodel.h
macOS/fileprovidermaterialiseditemsmodel.cpp
2023-09-14 09:05:16 +03:00
macOS/fileprovidersettingscontroller.h
macOS/fileprovidersettingscontroller_mac.mm
2023-03-15 13:04:19 +03:00
macOS/fileprovidersocketcontroller.h
macOS/fileprovidersocketcontroller.cpp
macOS/fileprovidersocketserver.h
macOS/fileprovidersocketserver.cpp
2023-11-21 12:38:01 +03:00
macOS/fileprovidersocketserver_mac.mm
2023-09-14 09:05:16 +03:00
macOS/fileproviderstorageuseenumerationobserver.h
macOS/fileproviderstorageuseenumerationobserver.m
2023-11-21 12:38:01 +03:00
macOS/fileproviderxpc.h
2023-12-27 13:58:07 +03:00
macOS/fileproviderxpc_mac.mm
macOS/fileproviderxpc_mac_utils.h
2023-09-14 09:05:16 +03:00
macOS/fileproviderxpc_mac_utils.mm)
2023-03-15 13:04:19 +03:00
endif()
2014-07-11 02:31:24 +04:00
2020-03-09 03:48:07 +03:00
if(SPARKLE_FOUND AND BUILD_UPDATER)
2020-11-25 11:43:59 +03:00
# Define this, we need to check in updater.cpp
add_definitions(-DHAVE_SPARKLE)
list(APPEND updater_SRCS updater/sparkleupdater_mac.mm updater/sparkleupdater.h)
list(APPEND updater_DEPS ${SPARKLE_LIBRARY})
# Sparkle.framework is installed from here because macdeployqt's CopyFramework breaks on this bundle
# as its logic is tightly tailored around Qt5 frameworks
install(DIRECTORY "${SPARKLE_LIBRARY}"
DESTINATION "${OWNCLOUD_OSX_BUNDLE}/Contents/Frameworks" USE_SOURCE_PERMISSIONS)
2014-07-11 02:31:24 +04:00
endif()
ENDIF()
IF( NOT WIN32 AND NOT APPLE )
2014-11-10 00:58:24 +03:00
set(client_SRCS ${client_SRCS} folderwatcher_linux.cpp)
2014-07-11 02:31:24 +04:00
ENDIF()
IF( WIN32 )
2022-07-04 15:36:06 +03:00
set(client_SRCS ${client_SRCS} folderwatcher_win.cpp shellextensionsserver.cpp ${CMAKE_SOURCE_DIR}/src/common/shellextensionutils.cpp)
2014-07-11 02:31:24 +04:00
ENDIF()
IF( APPLE )
2014-11-10 00:30:05 +03:00
list(APPEND client_SRCS folderwatcher_mac.cpp)
2014-07-11 02:31:24 +04:00
ENDIF()
set(3rdparty_SRC
2022-02-07 15:48:52 +03:00
../3rdparty/QProgressIndicator/QProgressIndicator.h
2014-07-11 02:31:24 +04:00
../3rdparty/QProgressIndicator/QProgressIndicator.cpp
2022-02-07 15:48:52 +03:00
../3rdparty/qtlockedfile/qtlockedfile.h
2014-07-11 02:31:24 +04:00
../3rdparty/qtlockedfile/qtlockedfile.cpp
2022-02-07 15:48:52 +03:00
../3rdparty/qtsingleapplication/qtlocalpeer.h
2014-07-11 02:31:24 +04:00
../3rdparty/qtsingleapplication/qtlocalpeer.cpp
2022-02-07 15:48:52 +03:00
../3rdparty/qtsingleapplication/qtsingleapplication.h
2014-07-11 02:31:24 +04:00
../3rdparty/qtsingleapplication/qtsingleapplication.cpp
2022-02-07 15:48:52 +03:00
../3rdparty/qtsingleapplication/qtsinglecoreapplication.h
2014-07-11 02:31:24 +04:00
../3rdparty/qtsingleapplication/qtsinglecoreapplication.cpp
2022-02-07 15:48:52 +03:00
../3rdparty/kmessagewidget/kmessagewidget.h
2019-05-08 20:56:00 +03:00
../3rdparty/kmessagewidget/kmessagewidget.cpp
2022-02-07 15:48:52 +03:00
../3rdparty/kirigami/wheelhandler.h
2021-11-12 23:02:58 +03:00
../3rdparty/kirigami/wheelhandler.cpp
2014-07-11 02:31:24 +04:00
)
2022-11-10 01:19:35 +03:00
set_property(SOURCE ../3rdparty/kmessagewidget/kmessagewidget.cpp PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
set_property(SOURCE ../3rdparty/kirigami/wheelhandler.cpp PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
2014-07-11 02:31:24 +04:00
if(NOT WIN32)
list(APPEND 3rdparty_SRC ../3rdparty/qtlockedfile/qtlockedfile_unix.cpp)
2022-10-29 03:30:47 +03:00
set_property(SOURCE ../3rdparty/qtlockedfile/qtlockedfile_unix.cpp PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
2014-07-11 02:31:24 +04:00
else()
list(APPEND 3rdparty_SRC ../3rdparty/qtlockedfile/qtlockedfile_win.cpp )
2022-10-29 03:30:47 +03:00
set_property(SOURCE ../3rdparty/qtlockedfile/qtlockedfile_win.cpp PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
2014-07-11 02:31:24 +04:00
endif()
2017-12-14 17:10:33 +03:00
find_package(Qt5LinguistTools)
if(Qt5LinguistTools_FOUND)
qt5_add_translation(client_I18N ${TRANSLATIONS})
endif()
2014-07-11 02:31:24 +04:00
2015-04-01 14:45:04 +03:00
IF( WIN32 )
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
set(client_version ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
2016-10-29 23:06:03 +03:00
IF(NOT MSVC)
set(client_manifest ${CMAKE_CURRENT_SOURCE_DIR}/manifest-mingw.rc)
ENDIF()
2015-04-01 14:45:04 +03:00
ENDIF()
2014-07-11 02:31:24 +04:00
set( final_src
2014-11-10 00:30:05 +03:00
${client_SRCS}
${client_UI_SRCS}
2014-11-10 01:10:18 +03:00
${guiMoc}
2014-11-10 00:30:05 +03:00
${client_I18N}
2014-07-11 02:31:24 +04:00
${3rdparty_SRC}
${3rdparty_MOC}
)
2020-10-29 15:24:20 +03:00
if(Qt5Keychain_FOUND)
list(APPEND libsync_LINK_TARGETS qt5keychain)
2015-06-15 16:53:45 +03:00
endif()
2014-07-11 02:31:24 +04:00
# add executable icon on windows and osx
2022-09-02 12:48:52 +03:00
include(GenerateIconsUtils)
2014-07-11 02:31:24 +04:00
2017-03-27 12:12:28 +03:00
# For historical reasons we can not use the application_shortname
# for ownCloud but must rather set it manually.
if (NOT DEFINED APPLICATION_ICON_NAME)
set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME})
2014-07-11 02:31:24 +04:00
endif()
2021-11-24 17:09:41 +03:00
if(NOT DEFINED APPLICATION_FOLDER_ICON_INDEX)
set(APPLICATION_FOLDER_ICON_INDEX 0)
endif()
2022-06-08 12:44:39 +03:00
set(STATE_ICONS_COLORS colored black white)
foreach(state_icons_color ${STATE_ICONS_COLORS})
set(STATE_ICONS_PATH "${theme_dir}/${state_icons_color}/")
2022-07-05 12:54:00 +03:00
message("Generating state icons from SVG in path: ${STATE_ICONS_PATH}")
2022-06-08 12:44:39 +03:00
file(GLOB_RECURSE STATE_ICONS_SVG "${STATE_ICONS_PATH}/state-*.svg")
foreach(state_icon_svg ${STATE_ICONS_SVG})
get_filename_component(status_icon_name_wle ${state_icon_svg} NAME_WLE)
foreach(size IN ITEMS 16;32;64;128;256)
generate_sized_png_from_svg(${state_icon_svg} ${size} OUTPUT_ICON_FULL_NAME_WLE "${status_icon_name_wle}-${size}")
endforeach()
endforeach()
endforeach()
2021-06-02 18:14:37 +03:00
if ((APPLICATION_ICON_SET MATCHES "PNG")
AND
(NOT EXISTS "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon.svg"))
# We may have no svg application icon in when customers use PNG
# icons in brander, but theme.qrc expects a svg icon.
file(TOUCH "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon.svg")
endif()
if(APPLE)
set(MACOS_SIDEBAR_ICON_SVG "${theme_dir}/colored/${APPLICATION_ICON_NAME}-sidebar.svg")
generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 16)
generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 32)
generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 64)
generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 128)
generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 256)
endif()
if(WIN32)
set(STARTMENU_ICON_SVG "${theme_dir}/colored/${APPLICATION_ICON_NAME}-w10startmenu.svg")
generate_sized_png_from_svg(${STARTMENU_ICON_SVG} 70)
generate_sized_png_from_svg(${STARTMENU_ICON_SVG} 150)
endif()
set(APP_ICON_SVG "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon.svg")
2021-11-24 17:09:41 +03:00
# generate secondary icon if available (currently for Windows only)--------------------------------------
set(APP_SECONDARY_ICONS "${theme_dir}/colored/icons")
set(APP_ICON_WIN_FOLDER_SVG "${APP_SECONDARY_ICONS}/${APPLICATION_ICON_NAME}-icon-win-folder.svg")
set(RC_DEPENDENCIES "")
2021-12-14 18:45:13 +03:00
if(WIN32)
if (EXISTS ${APP_ICON_WIN_FOLDER_SVG})
get_filename_component(output_icon_name_win ${APP_ICON_WIN_FOLDER_SVG} NAME_WLE)
# Product icon (for smallest size)
foreach(size IN ITEMS 16;20)
generate_sized_png_from_svg(${APP_ICON_SVG} ${size} OUTPUT_ICON_NAME ${output_icon_name_win} OUTPUT_ICON_PATH "${APP_SECONDARY_ICONS}/")
endforeach()
# Product icon with Windows folder (for sizes larger than 20)
foreach(size IN ITEMS 24;32;40;48;64;128;256;512;1024)
generate_sized_png_from_svg(${APP_ICON_WIN_FOLDER_SVG} ${size} OUTPUT_ICON_NAME ${output_icon_name_win} OUTPUT_ICON_PATH "${APP_SECONDARY_ICONS}/")
endforeach()
file(GLOB_RECURSE OWNCLOUD_ICONS_WIN_FOLDER "${APP_SECONDARY_ICONS}/*-${APPLICATION_ICON_NAME}-icon*")
set(APP_ICON_WIN_FOLDER_ICO_NAME "${APPLICATION_ICON_NAME}-win-folder")
set(RC_DEPENDENCIES "${RC_DEPENDENCIES} ${APP_ICON_WIN_FOLDER_ICO_NAME}.ico")
ecm_add_app_icon(APP_ICON_WIN_FOLDER ICONS "${OWNCLOUD_ICONS_WIN_FOLDER}" SIDEBAR_ICONS "${OWNCLOUD_SIDEBAR_ICONS}" OUTFILE_BASENAME "${APP_ICON_WIN_FOLDER_ICO_NAME}" ICON_INDEX 2)
endif()
2021-11-24 17:09:41 +03:00
endif()
# --------------------------------------
if (NOT ${RC_DEPENDENCIES} STREQUAL "")
string(STRIP ${RC_DEPENDENCIES} RC_DEPENDENCIES)
endif()
# generate primary icon from SVG (due to Win .ico vs .rc dependency issues, primary icon must always be generated last)--------------------------------------
if(WIN32)
foreach(size IN ITEMS 16;20;24;32;40;48;64;128;256;512;1024)
generate_sized_png_from_svg(${APP_ICON_SVG} ${size})
endforeach()
else()
foreach(size IN ITEMS 16;24;32;48;64;128;256;512;1024)
generate_sized_png_from_svg(${APP_ICON_SVG} ${size})
endforeach()
endif()
2021-06-02 18:14:37 +03:00
2018-01-04 23:06:23 +03:00
file(GLOB_RECURSE OWNCLOUD_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-icon*")
2021-11-24 17:09:41 +03:00
2018-01-04 23:06:23 +03:00
if(APPLE)
file(GLOB_RECURSE OWNCLOUD_SIDEBAR_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-sidebar*")
MESSAGE(STATUS "OWNCLOUD_SIDEBAR_ICONS: ${APPLICATION_ICON_NAME}: ${OWNCLOUD_SIDEBAR_ICONS}")
2016-09-11 17:14:08 +03:00
endif()
2021-11-24 17:09:41 +03:00
ecm_add_app_icon(APP_ICON RC_DEPENDENCIES ${RC_DEPENDENCIES} ICONS "${OWNCLOUD_ICONS}" SIDEBAR_ICONS "${OWNCLOUD_SIDEBAR_ICONS}" OUTFILE_BASENAME "${APPLICATION_ICON_NAME}" ICON_INDEX 1)
# --------------------------------------
if(WIN32)
# merge *.rc.in files for Windows (multiple ICON resources must be placed in a single file, otherwise, this won't work de to a bug in Windows compiler https://developercommunity.visualstudio.com/t/visual-studio-2017-prof-1557-cvt1100-duplicate-res/363156)
function(merge_files IN_FILE OUT_FILE)
file(READ ${IN_FILE} CONTENTS)
message("Merging ${IN_FILE} into ${OUT_FILE}")
file(APPEND ${OUT_FILE} "${CONTENTS}")
endfunction()
message("APP_ICON is: ${APP_ICON}")
if(APP_ICON)
get_filename_component(RC_IN_FOLDER ${APP_ICON}} DIRECTORY)
file(GLOB_RECURSE RC_IN_FILES "${RC_IN_FOLDER}/*rc.in")
foreach(rc_in_file IN ITEMS ${RC_IN_FILES})
get_filename_component(rc_in_file_name ${rc_in_file} NAME)
get_filename_component(app_icon_name "${APP_ICON}.in" NAME)
if(NOT "${rc_in_file_name}" STREQUAL "${app_icon_name}")
merge_files(${rc_in_file} "${APP_ICON}.in")
if (DEFINED APPLICATION_FOLDER_ICON_INDEX)
MATH(EXPR APPLICATION_FOLDER_ICON_INDEX "${APPLICATION_FOLDER_ICON_INDEX}+1")
message("APPLICATION_FOLDER_ICON_INDEX is now set to: ${APPLICATION_FOLDER_ICON_INDEX}")
endif()
endif()
endforeach()
endif()
endif()
# --------------------------------------
2014-07-11 02:31:24 +04:00
2017-09-20 19:26:06 +03:00
if(UNIX AND NOT APPLE)
2017-10-06 15:34:22 +03:00
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
2017-09-20 19:26:06 +03:00
endif()
2017-11-24 16:54:24 +03:00
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
endif()
2021-01-15 01:07:32 +03:00
add_library(nextcloudCore STATIC ${final_src})
target_link_libraries(nextcloudCore
PUBLIC
2021-10-05 13:00:22 +03:00
Nextcloud::sync
2021-01-15 01:07:32 +03:00
Qt5::Widgets
Qt5::GuiPrivate
Qt5::Svg
Qt5::Network
Qt5::Xml
Qt5::Qml
Qt5::Quick
Qt5::QuickControls2
2023-05-31 21:10:01 +03:00
Qt5::QuickWidgets
2022-07-20 18:23:43 +03:00
KF5::Archive
2021-06-22 13:01:18 +03:00
)
2021-02-17 17:41:32 +03:00
add_subdirectory(socketapi)
2022-10-29 03:30:47 +03:00
# skip unity inclusion for files which cause problems with a CMake unity build
set_property(SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/socketapi/socketapi.cpp
${CMAKE_CURRENT_SOURCE_DIR}/socketapi/socketuploadjob.cpp
PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
foreach(FILE IN LISTS client_UI_SRCS)
set_property(SOURCE ${FILE} PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
endforeach()
2021-06-24 10:54:54 +03:00
if(Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND)
2021-06-22 13:01:18 +03:00
target_link_libraries(nextcloudCore PUBLIC Qt5::WebEngineWidgets)
endif()
2021-01-15 01:07:32 +03:00
set_target_properties(nextcloudCore
PROPERTIES
AUTOUIC ON
AUTOMOC ON
)
target_include_directories(nextcloudCore
PUBLIC
${CMAKE_SOURCE_DIR}/src/3rdparty/QProgressIndicator
${CMAKE_SOURCE_DIR}/src/3rdparty/qtlockedfile
2021-11-12 23:02:58 +03:00
${CMAKE_SOURCE_DIR}/src/3rdparty/kirigami
2021-01-15 01:07:32 +03:00
${CMAKE_SOURCE_DIR}/src/3rdparty/qtsingleapplication
${CMAKE_SOURCE_DIR}/src/3rdparty/kmessagewidget
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
2014-07-11 14:36:01 +04:00
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
2014-07-11 02:31:24 +04:00
if(NOT WIN32)
2018-01-17 14:14:56 +03:00
file(GLOB _icons "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-icon.png")
foreach(_file ${_icons})
string(REPLACE "${theme_dir}/colored/" "" _res ${_file})
string(REPLACE "-${APPLICATION_ICON_NAME}-icon.png" "" _res ${_res})
2021-04-15 02:06:52 +03:00
install(FILES ${_file} RENAME ${APPLICATION_ICON_NAME}.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${_res}x${_res}/apps)
2018-01-17 14:14:56 +03:00
endforeach(_file)
2021-04-15 02:06:52 +03:00
install(FILES ${client_I18N} DESTINATION ${CMAKE_INSTALL_DATADIR}/${APPLICATION_EXECUTABLE}/i18n)
2018-06-27 00:28:37 +03:00
else()
2019-09-06 09:35:46 +03:00
file(GLOB_RECURSE VISUAL_ELEMENTS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-w10startmenu*")
2019-09-06 10:24:06 +03:00
install(FILES ${VISUAL_ELEMENTS} DESTINATION bin/visualelements)
install(FILES "${theme_dir}/${APPLICATION_EXECUTABLE}.VisualElementsManifest.xml" DESTINATION bin)
2018-06-27 00:28:37 +03:00
install(FILES ${client_I18N} DESTINATION i18n)
endif()
2014-07-11 02:31:24 +04:00
# we may not add MACOSX_BUNDLE here, if not building one
2021-04-13 13:39:10 +03:00
add_executable(nextcloud WIN32 main.cpp ${client_version} ${client_manifest} ${APP_ICON})
set_target_properties(nextcloud PROPERTIES
OUTPUT_NAME "${APPLICATION_EXECUTABLE}"
)
2014-09-12 13:25:52 +04:00
else()
2014-10-22 12:20:38 +04:00
# set(CMAKE_INSTALL_PREFIX ".") # Examples use /Applications. hurmpf.
2018-09-05 12:57:26 +03:00
set(MACOSX_BUNDLE_ICON_FILE "${APPLICATION_ICON_NAME}.icns")
2014-07-11 02:31:24 +04:00
# we must add MACOSX_BUNDLE only if building a bundle
2021-04-13 13:39:10 +03:00
add_executable(nextcloud WIN32 MACOSX_BUNDLE main.cpp ${APP_ICON})
2014-07-11 02:31:24 +04:00
2021-06-04 21:34:58 +03:00
if (BUILD_OWNCLOUD_OSX_BUNDLE)
2021-04-13 13:39:10 +03:00
set_target_properties(nextcloud PROPERTIES
2021-06-04 21:34:58 +03:00
OUTPUT_NAME "${APPLICATION_NAME}")
2021-04-13 13:39:10 +03:00
else()
set_target_properties(nextcloud PROPERTIES
OUTPUT_NAME "${APPLICATION_EXECUTABLE}")
2021-06-04 21:34:58 +03:00
endif()
2014-07-11 02:31:24 +04:00
set (QM_DIR ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/Translations)
2014-11-10 00:30:05 +03:00
install(FILES ${client_I18N} DESTINATION ${QM_DIR})
2014-10-22 12:20:38 +04:00
get_target_property(_qmake Qt5::qmake LOCATION)
execute_process(COMMAND ${_qmake} -query QT_INSTALL_TRANSLATIONS
OUTPUT_VARIABLE QT_TRANSLATIONS_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
2014-07-11 02:31:24 +04:00
file(GLOB qt_I18N ${QT_TRANSLATIONS_DIR}/qt_??.qm ${QT_TRANSLATIONS_DIR}/qt_??_??.qm)
install(FILES ${qt_I18N} DESTINATION ${QM_DIR})
2014-10-22 12:20:38 +04:00
file(GLOB qtbase_I18N ${QT_TRANSLATIONS_DIR}/qtbase_??.qm ${QT_TRANSLATIONS_DIR}/qt_??_??.qm)
install(FILES ${qtbase_I18N} DESTINATION ${QM_DIR})
2014-07-11 02:31:24 +04:00
file(GLOB qtkeychain_I18N ${QT_TRANSLATIONS_DIR}/qtkeychain*.qm)
install(FILES ${qtkeychain_I18N} DESTINATION ${QM_DIR})
endif()
2020-03-09 03:48:07 +03:00
IF(BUILD_UPDATER)
add_library(updater STATIC ${updater_SRCS})
2021-10-05 13:00:22 +03:00
target_link_libraries(updater Nextcloud::sync ${updater_DEPS} Qt5::Widgets Qt5::Svg Qt5::Network Qt5::Xml)
2020-03-09 03:48:07 +03:00
target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
2021-02-02 02:25:38 +03:00
set_target_properties(updater PROPERTIES AUTOMOC ON)
2021-04-13 13:39:10 +03:00
target_link_libraries(nextcloudCore PUBLIC updater)
2020-03-09 03:48:07 +03:00
endif()
2014-07-11 02:31:24 +04:00
2021-04-13 13:39:10 +03:00
set_target_properties(nextcloud PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
2014-07-11 14:36:01 +04:00
)
2014-07-11 02:31:24 +04:00
2021-04-13 13:39:10 +03:00
target_link_libraries(nextcloud PRIVATE nextcloudCore)
2021-01-15 01:07:32 +03:00
2021-04-01 20:46:56 +03:00
if(TARGET PkgConfig::CLOUDPROVIDERS)
message("Building with libcloudproviderssupport")
target_sources(nextcloudCore PRIVATE cloudproviders/cloudprovidermanager.cpp cloudproviders/cloudproviderwrapper.cpp)
2017-07-23 21:58:00 +03:00
string(TOLOWER "${APPLICATION_VENDOR}" DBUS_VENDOR)
string(REGEX REPLACE "[^A-z0-9]" "" DBUS_VENDOR "${DBUS_VENDOR}")
string(REGEX REPLACE "[^A-z0-9]" "" DBUS_APPLICATION_NAME "${APPLICATION_SHORTNAME}")
if(NOT DBUS_PREFIX)
set(DBUS_PREFIX "com")
endif(NOT DBUS_PREFIX)
set(LIBCLOUDPROVIDERS_DBUS_BUS_NAME "${DBUS_PREFIX}.${DBUS_VENDOR}.${DBUS_APPLICATION_NAME}")
set(LIBCLOUDPROVIDERS_DBUS_OBJECT_PATH "/${DBUS_PREFIX}/${DBUS_VENDOR}/${DBUS_APPLICATION_NAME}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cloudproviders/cloudproviderconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/cloudproviderconfig.h)
2021-04-01 20:46:56 +03:00
target_compile_definitions(nextcloudCore PUBLIC -DWITH_LIBCLOUDPROVIDERS)
2021-01-15 01:07:32 +03:00
target_link_libraries(nextcloudCore
2021-04-01 20:46:56 +03:00
PRIVATE
PkgConfig::CLOUDPROVIDERS
PkgConfig::GLIB2
PkgConfig::GIO
2021-01-15 01:07:32 +03:00
)
2023-09-06 17:04:15 +03:00
list(APPEND LIBCLOUDPROVIDERS_DESKTOP_IMPLEMENTS "Implements=org.freedesktop.CloudProviders\n")
list(APPEND LIBCLOUDPROVIDERS_DESKTOP_IMPLEMENTS "[org.freedesktop.CloudProviders]")
list(APPEND LIBCLOUDPROVIDERS_DESKTOP_IMPLEMENTS "BusName=${LIBCLOUDPROVIDERS_DBUS_BUS_NAME}")
list(APPEND LIBCLOUDPROVIDERS_DESKTOP_IMPLEMENTS "ObjectPath=${LIBCLOUDPROVIDERS_DBUS_OBJECT_PATH}")
list(JOIN LIBCLOUDPROVIDERS_DESKTOP_IMPLEMENTS "\n" LIBCLOUDPROVIDERS_DESKTOP_IMPLEMENTS)
2021-04-01 20:46:56 +03:00
endif()
2017-07-23 21:58:00 +03:00
2017-12-14 17:10:33 +03:00
## handle DBUS for Fdo notifications
if( UNIX AND NOT APPLE )
find_package(Qt5 COMPONENTS DBus)
2021-01-15 01:07:32 +03:00
target_link_libraries(nextcloudCore PUBLIC Qt5::DBus)
target_compile_definitions(nextcloudCore PUBLIC "USE_FDO_NOTIFICATIONS")
2017-12-14 17:10:33 +03:00
endif()
2018-01-04 22:47:54 +03:00
if (APPLE)
find_package(Qt5 COMPONENTS MacExtras)
2023-03-15 13:04:19 +03:00
if (BUILD_FILE_PROVIDER_MODULE)
target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras "-framework UserNotifications -framework FileProvider")
else()
target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras "-framework UserNotifications")
endif()
2018-01-04 22:47:54 +03:00
endif()
2014-08-26 20:07:42 +04:00
if(WITH_CRASHREPORTER)
2021-01-15 01:07:32 +03:00
target_link_libraries(nextcloudCore PUBLIC crashreporter-handler)
2014-08-26 20:07:42 +04:00
if(UNIX AND NOT MAC)
find_package(Threads REQUIRED)
2021-04-13 14:19:40 +03:00
target_link_libraries(nextcloudCore PUBLIC Threads::Threads)
2014-08-26 20:07:42 +04:00
endif()
endif()
2021-04-13 13:39:10 +03:00
install(TARGETS nextcloud
2014-07-11 14:36:01 +04:00
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
2014-10-22 12:20:38 +04:00
BUNDLE DESTINATION "."
2014-07-11 02:31:24 +04:00
)
2014-11-18 18:44:14 +03:00
2015-01-20 21:03:56 +03:00
# FIXME: The following lines are dup in src/gui and src/cmd because it needs to be done after both are installed
2014-07-11 02:31:24 +04:00
#FIXME: find a nice solution to make the second if(BUILD_OWNCLOUD_OSX_BUNDLE) unnecessary
# currently it needs to be done because the code right above needs to be executed no matter
# if building a bundle or not and the install_qt4_executable needs to be called afterwards
2020-06-06 20:53:48 +03:00
#
# OSX: Run macdeployqt for src/gui and for src/cmd using the -executable option
2014-10-22 12:20:38 +04:00
if(BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY)
2020-01-22 06:53:03 +03:00
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")
2020-06-06 20:53:48 +03:00
set(cmd_NAME ${APPLICATION_EXECUTABLE}cmd)
2020-07-17 15:07:13 +03:00
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(NO_STRIP "-no-strip")
else()
set(NO_STRIP "")
endif()
2021-10-07 13:56:52 +03:00
add_custom_command(TARGET nextcloud POST_BUILD
2020-01-22 06:53:03 +03:00
COMMAND "${MACDEPLOYQT_EXECUTABLE}"
2021-10-07 13:56:52 +03:00
"$<TARGET_FILE_DIR:nextcloud>/../.."
2021-03-26 13:28:40 +03:00
-qmldir=${CMAKE_SOURCE_DIR}/src/gui
-always-overwrite
2021-10-07 13:56:52 +03:00
-executable="$<TARGET_FILE_DIR:nextcloud>/${cmd_NAME}"
2021-03-26 13:28:40 +03:00
${NO_STRIP}
COMMAND "${CMAKE_COMMAND}"
-E rm -rf "${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns/bearer"
2020-01-22 06:53:03 +03:00
COMMENT "Running macdeployqt..."
)
2014-07-11 02:31:24 +04:00
endif()
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE AND NOT WIN32)
configure_file(${CMAKE_SOURCE_DIR}/mirall.desktop.in
2019-09-30 10:45:41 +03:00
${CMAKE_CURRENT_BINARY_DIR}/${LINUX_APPLICATION_ID}.desktop)
2021-04-15 02:06:52 +03:00
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LINUX_APPLICATION_ID}.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications )
2018-01-15 21:43:33 +03:00
2018-01-25 18:20:35 +03:00
configure_file(owncloud.xml.in ${APPLICATION_EXECUTABLE}.xml)
2021-04-15 02:06:52 +03:00
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_EXECUTABLE}.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages )
2018-01-15 21:43:33 +03:00
find_package(SharedMimeInfo)
if(SharedMimeInfo_FOUND)
2021-04-15 02:06:52 +03:00
update_xdg_mimetypes( ${CMAKE_INSTALL_DATADIR}/mime/packages )
2018-01-15 21:43:33 +03:00
endif(SharedMimeInfo_FOUND)
2014-07-11 02:31:24 +04:00
endif()
2021-11-24 17:09:41 +03:00
configure_file(configgui.h.in ${CMAKE_CURRENT_BINARY_DIR}/configgui.h)