CMakeLists.txt 3.4 KB
Newer Older
1
# Konsole project
2

Kurt Hindenburg's avatar
Kurt Hindenburg committed
3 4 5
# See comments in https://invent.kde.org/utilities/konsole/-/commit/9d8e47298c81fc1e47c998eda1b6e980589274eb
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)

6
# KDE Application Version, managed by release script
7 8
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "03")
9 10
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
11

12 13
# Do not increase these requirements without a merge-request or/and
# approval from maintainer(s).
14
# minimal requirements
15
cmake_minimum_required (VERSION 3.0 FATAL_ERROR)
16
# Qt 5.12 LTS EOL December 2021
17
set (QT_MIN_VERSION "5.12.0")
Kurt Hindenburg's avatar
Kurt Hindenburg committed
18

Kurt Hindenburg's avatar
Kurt Hindenburg committed
19 20
# Ubuntu 20.04 LTS only has KF 5.68 and Qt 5.12
set (KF5_MIN_VERSION "5.68.0")
21

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

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

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

41 42
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KONSOLEPRIVATE
    SOVERSION ${RELEASE_SERVICE_VERSION_MAJOR}
43
)
44 45 46 47 48 49
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
    Core
    DBus
    PrintSupport
    Widgets
)
Stephen Kelly's avatar
Stephen Kelly committed
50

Kurt Hindenburg's avatar
Kurt Hindenburg committed
51
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
52
    Bookmarks Completion Config ConfigWidgets
53
    CoreAddons Crash GuiAddons DBusAddons
54
    I18n IconThemes Init KIO NewStuff NewStuffCore Notifications NotifyConfig
55
    Parts Pty Service TextWidgets WidgetsAddons
56
    WindowSystem XmlGui DBusAddons GlobalAccel
Alex Richardson's avatar
Alex Richardson committed
57
)
58

59
find_package(KF5DocTools ${KF5_MIN_VERSION})
60
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
61 62 63 64
    "Tools to generate documentation"
    TYPE OPTIONAL
)

65 66 67 68
if(NOT APPLE)
    find_package(X11)
    set_package_properties(X11 PROPERTIES TYPE OPTIONAL)
endif()
69 70
set(HAVE_X11 ${X11_FOUND})

71 72
# Check for function GETPWUID
check_symbol_exists(getpwuid "pwd.h" HAVE_GETPWUID)
73

74
# See above includes for defaults
75
add_definitions(
76
  -DQT_NO_FOREACH
77 78 79
  -DQT_STRICT_ITERATORS
  -DQT_NO_URL_CAST_FROM_STRING
)
80

81 82
# 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
83
set(CMAKE_CXX_STANDARD 17)
Kurt Hindenburg's avatar
Kurt Hindenburg committed
84 85 86
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

87
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
88

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

91 92
add_subdirectory( src )
add_subdirectory( data )
Robert Knight's avatar
Robert Knight committed
93
add_subdirectory( desktop )
94 95 96
if (KF5DocTools_FOUND)
    add_subdirectory( doc/manual )
endif()
97

98
add_subdirectory( tools )
99

Albert Astals Cid's avatar
Albert Astals Cid committed
100 101 102 103 104 105 106
# 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()

107 108 109 110 111 112

if (${ECM_VERSION} STRGREATER "5.58.0")
    install( FILES konsole.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} )
else()
    install( FILES konsole.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
endif()
Laurent Montel's avatar
Laurent Montel committed
113

Alex Richardson's avatar
Alex Richardson committed
114
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)