CMakeLists.txt 4.69 KB
Newer Older
Elvis Angelaccio's avatar
Elvis Angelaccio committed
1
cmake_minimum_required(VERSION 3.0)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
2

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

10
set(QT_MIN_VERSION "5.11.0")
11
set(KF5_MIN_VERSION "5.67.0")
12

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

include(ECMSetupVersion)
18
include(ECMGenerateHeaders)
19
include(CMakePackageConfigHelpers)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
20
21
22
23
include(GenerateExportHeader)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
24
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
25
include(ECMQtDeclareLoggingCategory)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
26

27
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHIN
Michael Palimaka's avatar
Michael Palimaka committed
28
29
30
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/dolphin_version.h"
)

31
ecm_setup_version("5.0.0" VARIABLE_PREFIX DOLPHINVCS
32
33
34
35
36
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
                  PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
                  SOVERSION 5
)

37
ecm_setup_version("5.0.0" VARIABLE_PREFIX DOLPHINPRIVATE
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
38
39
40
                  SOVERSION 5
)

41
42
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core
43
    Concurrent
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
    Widgets
    Gui
    DBus
)

find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
    DocTools
    Init
    KCMUtils
    NewStuff
    CoreAddons
    I18n
    DBusAddons
    Bookmarks
    Config
    KIO
    Parts
    Solid
62
63
    IconThemes
    Completion
Michael Palimaka's avatar
Michael Palimaka committed
64
    TextWidgets
65
    Notifications
66
    Crash
67
    WindowSystem
68
)
69
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS
70
71
    Activities
)
72
set_package_properties(KF5Activities PROPERTIES DESCRIPTION "KActivities libraries"
73
                       URL "https://www.kde.org"
74
75
76
                       TYPE OPTIONAL
                       PURPOSE "For tracking which folders are frequently accessed on a Plasma desktop"
                      )
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
77
78
79

find_package(Phonon4Qt5 CONFIG REQUIRED)

80
find_package(KF5Baloo ${KF5_MIN_VERSION})
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
81
set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
82
                       URL "https://www.kde.org"
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
83
84
85
86
                       TYPE OPTIONAL
                       PURPOSE "For adding desktop-wide search and tagging support to dolphin"
                      )

87
find_package(KF5BalooWidgets 19.07.70)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
88
set_package_properties(KF5BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
89
                       URL "https://www.kde.org"
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
90
91
92
                       TYPE OPTIONAL
                      )

93
find_package(KF5FileMetaData ${KF5_MIN_VERSION})
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
94
95
96
97
98
99
set_package_properties(KF5FileMetaData PROPERTIES
                       URL "https://projects.kde.org/kfilemetadata"
                       TYPE OPTIONAL
                       PURPOSE "For accessing file metadata labels"
                      )

100
101
102
103
if (KF5Activities_FOUND)
    set(HAVE_KACTIVITIES TRUE)
endif()

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
104
if (KF5Baloo_FOUND AND KF5BalooWidgets_FOUND AND KF5FileMetaData_FOUND)
105
    message(STATUS "Baloo packages are found")
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
106
    set(HAVE_BALOO TRUE)
107
else()
108
    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
109
110
endif()

Elvis Angelaccio's avatar
Elvis Angelaccio committed
111
112
113
114
115
116
117
# 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()

118
add_subdirectory(src)
119
add_subdirectory(doc)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
120

121
# CMake files
122
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/DolphinVcs")
123

124
configure_package_config_file(
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
    "${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
)

Ashish Bansal's avatar
Ashish Bansal committed
148
149
150
configure_file(org.kde.dolphin.FileManager1.service.in
               ${CMAKE_CURRENT_BINARY_DIR}/org.kde.dolphin.FileManager1.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.dolphin.FileManager1.service
151
        DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
Laurent Montel's avatar
Laurent Montel committed
152
install(FILES dolphin.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
153

154
155
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)