CMakeLists.txt 5.49 KB
Newer Older
Ömer Fadıl Usta's avatar
Ömer Fadıl Usta committed
1
cmake_minimum_required(VERSION 3.16)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
2

3
# KDE Application Version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "21")
5
set (RELEASE_SERVICE_VERSION_MINOR "07")
6
7
8
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
9

Ömer Fadıl Usta's avatar
Ömer Fadıl Usta committed
10
set(QT_MIN_VERSION "5.15.0")
11
set(KF5_MIN_VERSION "5.81.0")
12

Nicolas Fella's avatar
Nicolas Fella committed
13
14
15
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
16
# ECM setup
17
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Ashish Bansal's avatar
Ashish Bansal committed
18
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
19
20

include(ECMSetupVersion)
21
include(ECMGenerateHeaders)
Henri Chain's avatar
Henri Chain committed
22
23
include(ECMGenerateDBusServiceFile)
include(ECMConfiguredInstall)
24
include(CMakePackageConfigHelpers)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
25
26
27
28
include(GenerateExportHeader)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
29
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
30
include(ECMQtDeclareLoggingCategory)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
31

32
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHIN
Michael Palimaka's avatar
Michael Palimaka committed
33
34
35
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/dolphin_version.h"
)

36
ecm_setup_version("5.0.0" VARIABLE_PREFIX DOLPHINVCS
37
38
39
40
41
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
                  PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
                  SOVERSION 5
)

42
ecm_setup_version("5.0.0" VARIABLE_PREFIX DOLPHINPRIVATE
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
43
44
45
                  SOVERSION 5
)

46
47
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core
48
    Concurrent
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
    Widgets
    Gui
    DBus
)

find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
    DocTools
    KCMUtils
    NewStuff
    CoreAddons
    I18n
    DBusAddons
    Bookmarks
    Config
    KIO
    Parts
    Solid
66
67
    IconThemes
    Completion
Michael Palimaka's avatar
Michael Palimaka committed
68
    TextWidgets
69
    Notifications
70
    Crash
71
    WindowSystem
72
)
73
74
75
76
77
78
79
80
81
82
83

find_package(KUserFeedback 1.0.0)
set_package_properties(KUserFeedback
        PROPERTIES TYPE OPTIONAL
        PURPOSE "Used for submission of telemetry data"
        )

if(KUserFeedback_FOUND)
    set(HAVE_KUSERFEEDBACK TRUE)
endif()

84
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS
85
86
    Activities
)
87
set_package_properties(KF5Activities PROPERTIES DESCRIPTION "KActivities libraries"
88
                       URL "https://www.kde.org"
89
90
91
                       TYPE OPTIONAL
                       PURPOSE "For tracking which folders are frequently accessed on a Plasma desktop"
                      )
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
92
93
94

find_package(Phonon4Qt5 CONFIG REQUIRED)

95
96
97
98
99
100
101
102
103
104
find_package(PackageKitQt5)
set_package_properties(PackageKitQt5
        PROPERTIES DESCRIPTION "Software Manager integration"
        TYPE OPTIONAL
        PURPOSE "Used in the service menu installer"
        )
if(PackageKitQt5_FOUND)
    set(HAVE_PACKAGEKIT TRUE)
endif()

105
find_package(KF5Baloo ${KF5_MIN_VERSION})
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
106
set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
107
                       URL "https://www.kde.org"
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
108
109
110
111
                       TYPE OPTIONAL
                       PURPOSE "For adding desktop-wide search and tagging support to dolphin"
                      )

112
find_package(KF5BalooWidgets 19.07.70)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
113
set_package_properties(KF5BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
114
                       URL "https://www.kde.org"
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
115
116
117
                       TYPE OPTIONAL
                      )

118
find_package(KF5FileMetaData ${KF5_MIN_VERSION})
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
119
120
121
122
123
124
set_package_properties(KF5FileMetaData PROPERTIES
                       URL "https://projects.kde.org/kfilemetadata"
                       TYPE OPTIONAL
                       PURPOSE "For accessing file metadata labels"
                      )

125
126
127
128
if (KF5Activities_FOUND)
    set(HAVE_KACTIVITIES TRUE)
endif()

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
129
if (KF5Baloo_FOUND AND KF5BalooWidgets_FOUND AND KF5FileMetaData_FOUND)
130
    message(STATUS "Baloo packages are found")
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
131
    set(HAVE_BALOO TRUE)
132
else()
133
    message(WARNING "Baloo packages not found. They are needed for the metadata features of Dolphin (including the information panel).")
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
134
135
endif()

Elvis Angelaccio's avatar
Elvis Angelaccio committed
136
137
138
139
140
141
142
# TODO: drop HAVE_TERMINAL once we are sure the terminal panel works on Windows too.
if(WIN32)
    set(HAVE_TERMINAL FALSE)
else()
    set(HAVE_TERMINAL TRUE)
endif()

143
add_subdirectory(src)
144
add_subdirectory(doc)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
145

146
# CMake files
147
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/DolphinVcs")
148

149
configure_package_config_file(
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
    "${CMAKE_CURRENT_SOURCE_DIR}/DolphinVcsConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfig.cmake"
    INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
)

install(EXPORT DolphinVcsTargets
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    FILE DolphinVcsTargets.cmake
)

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
    DESTINATION "${KDE_INSTALL_INCLUDEDIR}/Dolphin"
    COMPONENT Devel
)

Henri Chain's avatar
Henri Chain committed
173
174
175
176
177
178
179
180
181
182
ecm_generate_dbus_service_file(
   NAME org.freedesktop.FileManager1
   EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
   SYSTEMD_SERVICE plasma-dolphin.service
   DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
   RENAME org.kde.dolphin.FileManager1.service
)

ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})

Laurent Montel's avatar
Laurent Montel committed
183
184
185
186
187
ecm_qt_install_logging_categories(
        EXPORT DOLPHIN
        FILE dolphin.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
188
189
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)