CMakeLists.txt 3.87 KB
Newer Older
1
# Konsole project
2
3

# KDE Application Version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "21")
5
set (RELEASE_SERVICE_VERSION_MINOR "11")
6
7
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
Christophe Giboudeaux's avatar
Build.    
Christophe Giboudeaux committed
8

9
10
# Do not increase these requirements without a merge-request or/and
# approval from maintainer(s).
11
# minimal requirements
Kurt Hindenburg's avatar
Kurt Hindenburg committed
12

13
14
15
# See comments in https://invent.kde.org/utilities/konsole/-/commit/9d8e47298c81fc1e47c998eda1b6e980589274eb
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)

16
17
# Match KDE Frameworks update Apr 2021
set (QT_MIN_VERSION "5.15.0")
18
19

set (KF5_MIN_VERSION "5.71.0")
20

21
# Release script will create bugzilla versions
22
project(konsole VERSION ${RELEASE_SERVICE_VERSION})
23

24
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
25
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
Stephen Kelly's avatar
Stephen Kelly committed
26
27
28

include(KDEInstallDirs)
include(KDECMakeSettings)
29
include(KDECompilerSettings NO_POLICY_SCOPE)
30
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
31
32
33
34
35
36
37
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMMarkNonGuiExecutable)
include(ECMGenerateHeaders)
include(GenerateExportHeader)
include(FeatureSummary)
38
include(ECMQtDeclareLoggingCategory)
39
include(KDEClangFormat)
40

41
42
43
44

# Allows passing e.g. -DECM_ENABLE_SANITIZERS='address;undefined' to cmake.
include(ECMEnableSanitizers)

45
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KONSOLEPRIVATE
46
    SOVERSION 1
47
)
48
49
50
51
52
53
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
    Core
    DBus
    PrintSupport
    Widgets
)
Stephen Kelly's avatar
Stephen Kelly committed
54

Kurt Hindenburg's avatar
Kurt Hindenburg committed
55
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
    Bookmarks
    Config
    ConfigWidgets
    CoreAddons
    Crash
    GlobalAccel
    GuiAddons
    DBusAddons
    I18n
    IconThemes
    KIO
    NewStuff
    NewStuffCore
    Notifications
    NotifyConfig
    Parts
    Pty
    Service
    TextWidgets
    WidgetsAddons
    WindowSystem
    XmlGui
Alex Richardson's avatar
Alex Richardson committed
78
)
79

80
find_package(KF5DocTools ${KF5_MIN_VERSION})
81
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
82
83
84
85
    "Tools to generate documentation"
    TYPE OPTIONAL
)

86
87
88
89
if(NOT APPLE)
    find_package(X11)
    set_package_properties(X11 PROPERTIES TYPE OPTIONAL)
endif()
90
91
set(HAVE_X11 ${X11_FOUND})

92
93
# Check for function GETPWUID
check_symbol_exists(getpwuid "pwd.h" HAVE_GETPWUID)
94

95
# See above includes for defaults
96
add_definitions(
97
  -DQT_NO_FOREACH
98
99
100
  -DQT_STRICT_ITERATORS
  -DQT_NO_URL_CAST_FROM_STRING
)
101

102
103
# FIXME: on my system coverity build doesn't work with 17; change to 11 to
#        get a scan
Kurt Hindenburg's avatar
Kurt Hindenburg committed
104
set(CMAKE_CXX_STANDARD 17)
Kurt Hindenburg's avatar
Kurt Hindenburg committed
105
106
107
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

108
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
109

Albert Astals Cid's avatar
Albert Astals Cid committed
110
111
file(GLOB ICONS_SRCS "data/icons/*.png")

112
113
option(ENABLE_PLUGIN_SSHMANAGER "Build the SSHManager plugin" ON)

114
115
add_subdirectory( src )
add_subdirectory( data )
Robert Knight's avatar
Robert Knight committed
116
add_subdirectory( desktop )
117
118
119
if (KF5DocTools_FOUND)
    add_subdirectory( doc/manual )
endif()
120

121
add_subdirectory( tools )
122

Albert Astals Cid's avatar
Albert Astals Cid committed
123
124
125
126
127
128
129
# Conditionally install icons for Linux as they may not be provided by the user theme
option(INSTALL_ICONS "Install icons" OFF)
if (INSTALL_ICONS)
    include(ECMInstallIcons)
    ecm_install_icons( ICONS ${ICONS_SRCS} DESTINATION ${KDE_INSTALL_ICONDIR} )
endif()

130
131
132
133
134
ecm_qt_install_logging_categories(
    EXPORT KONSOLE
    FILE konsole.categories
    DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}"
)
Laurent Montel's avatar
Laurent Montel committed
135

Alex Richardson's avatar
Alex Richardson committed
136
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
137
138
139
140
141
142
143
144
145

# Do not do bulk whitespace/style changes without MRs and maintainer(s)
# approval.  clang-format executeable needs to be installed prior to initial
# building; then do make clang-format.
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.c *.cpp *.h *.hpp)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
# Let's not do pre-hooks yet
#kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)