-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
160 lines (117 loc) · 5.23 KB
/
CMakeLists.txt
File metadata and controls
160 lines (117 loc) · 5.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
cmake_minimum_required(VERSION 3.18)
include(VERSION.cmake)
project(OpenCloudDesktop LANGUAGES CXX VERSION ${MIRALL_VERSION_MAJOR}.${MIRALL_VERSION_MINOR}.${MIRALL_VERSION_PATCH})
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FeatureSummary)
find_package(ECM 6.0.0 REQUIRED NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
# disable pointless warning in KDECMakeSettings
set(APPLE_SUPPRESS_X11_WARNING ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMMarkNonGuiExecutable)
include(ECMSetupVersion)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMEnableSanitizers)
include(ECMQmlModule)
find_package(Qt6 COMPONENTS Core Concurrent Network Widgets Xml Quick QuickWidgets QuickControls2 Linguist REQUIRED)
qt6_standard_project_setup(REQUIRES 6.8)
get_target_property (QT_QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
message(STATUS "Using Qt ${Qt6_VERSION_MAJOR}.${Qt6_VERSION_MINOR}.${Qt6_VERSION_PATCH} (${QT_QMAKE_EXECUTABLE})")
if (UNIX AND NOT APPLE)
find_package(Qt6 REQUIRED COMPONENTS DBus)
endif()
if(UNIT_TESTING)
message(DEPRECATION "Setting UNIT_TESTING is deprecated please use BUILD_TESTING")
set(BUILD_TESTING TRUE)
endif()
include(CTest)
include(OCBundleResources)
include(OCApplyCommonSettings)
include("${CMAKE_CURRENT_LIST_DIR}/THEME.cmake")
if(NOT WITH_CRASHREPORTER)
message(STATUS "Build of crashreporter disabled.")
else()
# obviously, a crash reported without the URL set is pretty pointless and won't work
if(NOT DEFINED CRASHREPORTER_SUBMIT_URL)
message(FATAL_ERROR "No crash reporter submit URL provided")
endif()
endif()
include(GenerateExportHeader)
include(GetGitRevisionDescription)
# used in src/csync/CMakeLists.txt
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
# if we cannot get it from git, directly try .tag (packages)
# this will work if the tar balls have been properly created
# via git-archive.
if ("${GIT_SHA1}" STREQUAL "GITDIR-NOTFOUND")
file(READ ${CMAKE_SOURCE_DIR}/.tag sha1_candidate)
string(REPLACE "\n" "" sha1_candidate ${sha1_candidate})
if (NOT ${sha1_candidate} STREQUAL "$Format:%H$")
message("${sha1_candidate}")
set (GIT_SHA1 "${sha1_candidate}")
endif()
endif()
message(STATUS "GIT_SHA1 ${GIT_SHA1}")
option(NO_MSG_HANDLER "Don't redirect QDebug outputs to the log window/file" OFF)
if (APPLE)
# this option builds the shell integration, currently only available on MacOS
option(BUILD_SHELL_INTEGRATION "BUILD_SHELL_INTEGRATION" ON)
endif()
# build the auto updater component
option(WITH_AUTO_UPDATER "WITH_AUTO_UPDATER" OFF)
option(WITH_UPDATE_NOTIFICATION "Whether to check for new releases" ON)
# create a co-installable client, that uses a separate profile
option(BETA_CHANNEL_BUILD "Use a standalone profile for a beta release" OFF)
# build with -DQT_FORCE_ASSERTS
option(FORCE_ASSERTS "FORCE_ASSERTS" OFF)
option(WITH_APPIMAGEUPDATER OFF "Enable built-in libappimageupdate based updater on Linux")
add_feature_info(AppImageUpdate WITH_APPIMAGEUPDATER "Built-in libappimageupdate based updater")
option(WITH_EXTERNAL_BRANDING "A URL to an external branding repo" "")
# specify additional vfs plugins
set(VIRTUAL_FILE_SYSTEM_PLUGINS off cfapi openvfs CACHE STRING "Name of internal plugin in src/libsync/vfs or the locations of virtual file plugins")
if(APPLE)
set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
endif()
if (WITH_AUTO_UPDATER)
if(APPLE)
find_package(Sparkle REQUIRED)
endif(APPLE)
if(WITH_APPIMAGEUPDATER)
find_package(AppImageUpdate REQUIRED)
endif()
endif()
if(UNIX AND NOT APPLE)
find_package(Inotify REQUIRED)
endif()
find_package(ZLIB REQUIRED)
find_package(SQLite3 3.9.0 REQUIRED)
# in the ownBrander themes, the icon files are named after the shortname
# the theme included in this repository defines a custom icon name, therefore we set the shortname as a fallback if the
# theme does not define the variable
if (NOT DEFINED APPLICATION_ICON_NAME)
set(APPLICATION_ICON_NAME "${APPLICATION_SHORTNAME}")
endif()
file(GLOB_RECURSE OPENCLOUD_ICONS "${OEM_THEME_DIR}/theme/colored/*-${APPLICATION_ICON_NAME}-icon.png")
MESSAGE(STATUS "OPENCLOUD_ICONS: ${APPLICATION_ICON_NAME}: ${OPENCLOUD_ICONS}")
add_subdirectory(src)
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/admin)
add_subdirectory(admin)
endif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/admin)
if(BUILD_SHELL_INTEGRATION)
add_subdirectory(shell_integration)
endif()
if(BUILD_TESTING)
add_subdirectory(test)
endif()
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
message(STATUS "Suitable ECM ${ECM_VERSION} found, installing clang-format git hook")
include(KDEGitCommitHooks)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
else()
message(WARNING "ECM ${ECM_VERSION} too old, cannot install clang-format git hook")
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES INCLUDE_QUIET_PACKAGES)