CMakeLists.txt 2.52 KB
Newer Older
1
2
3
4
# SPDX-FileCopyrightText: 2008 Volker Lanz <vl@fidra.de>
# SPDX-FileCopyrightText: 2014-2020 Andrius Štikonas <andrius@stikonas.eu>

# SPDX-License-Identifier: GPL-3.0-or-later
Volker Lanz's avatar
Volker Lanz committed
5

Andrius Štikonas's avatar
Andrius Štikonas committed
6
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
Volker Lanz's avatar
Volker Lanz committed
7

8
# KDE Application Version, managed by release script
9
10
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "03")
11
set (RELEASE_SERVICE_VERSION_MICRO "80")
12
13
14
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(partitionmanager VERSION ${RELEASE_SERVICE_VERSION})

15
# Dependencies
16
set(QT_MIN_VERSION "5.14.0")
17
set(KF5_MIN_VERSION "5.73")
18
set(KPMCORE_MIN_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}")
19

20
21
set(CMAKE_USE_RELATIVE_PATHS OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
22
set(KDE_INSTALL_USE_QT_SYS_PATHS ON CACHE BOOL "Install mkspecs files, Plugins and Imports to the Qt 5 install dir" FORCE)
Volker Lanz's avatar
Volker Lanz committed
23

Andrius Štikonas's avatar
Andrius Štikonas committed
24
add_definitions(-D'VERSION="${RELEASE_SERVICE_VERSION}"')
Volker Lanz's avatar
Volker Lanz committed
25

Andrius Štikonas's avatar
Andrius Štikonas committed
26
set(CMAKE_CXX_STANDARD 17)
27
28
set(CMAKE_CXX_STANDARD_REQUIRED ON)

29
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
30
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
31
32
33
34
include(ECMInstallIcons)

include(KDEInstallDirs)
include(KDECMakeSettings)
35
include(KDECompilerSettings NO_POLICY_SCOPE)
36
37
38
39
40
include(FeatureSummary)
include(GenerateExportHeader)

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
  Core
41
  Gui
42
43
44
45
  Widgets
)

# Load the frameworks we need
Andrius Štikonas's avatar
Andrius Štikonas committed
46
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
47
48
49
50
51
  COMPONENTS
    Config
    ConfigWidgets
    CoreAddons
    Crash
52
    DBusAddons
53
54
55
56
    I18n
    JobWidgets
    KIO
    WidgetsAddons
57
    XmlGui
58
59
  OPTIONAL_COMPONENTS
    DocTools
60
61
62
63
)

# use sane compile flags
add_definitions(
64
65
66
67
68
69
  -DQT_USE_QSTRINGBUILDER
  -DQT_NO_CAST_TO_ASCII
  -DQT_NO_CAST_FROM_ASCII
  -DQT_STRICT_ITERATORS
  -DQT_NO_URL_CAST_FROM_STRING
  -DQT_NO_CAST_FROM_BYTEARRAY
70
  -DQT_NO_CAST_TO_BYTEARRAY
71
  -DQT_USE_FAST_OPERATOR_PLUS
Andrius Štikonas's avatar
Andrius Štikonas committed
72
  -DQT_DISABLE_DEPRECATED_BEFORE=0x050900
Andrius Štikonas's avatar
Andrius Štikonas committed
73
  -DQT_NO_KEYWORDS
74
)
Volker Lanz's avatar
Volker Lanz committed
75

Andrius Štikonas's avatar
Andrius Štikonas committed
76
find_package(KPMcore ${KPMCORE_MIN_VERSION} REQUIRED)
Volker Lanz's avatar
Volker Lanz committed
77

78
include_directories(${Qt5Core_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${BLKID_INCLUDE_DIRS} ${KPMCORE_INCLUDE_DIR} lib/ src/)
Volker Lanz's avatar
Volker Lanz committed
79

80
add_subdirectory(src)
Volker Lanz's avatar
Volker Lanz committed
81
add_subdirectory(icons)
Andrius Štikonas's avatar
Andrius Štikonas committed
82
83
if (KF5DocTools_FOUND)
    add_subdirectory(doc)
84
    kdoctools_install(po)
Andrius Štikonas's avatar
Andrius Štikonas committed
85
endif()
Volker Lanz's avatar
Volker Lanz committed
86

Andrius Štikonas's avatar
Andrius Štikonas committed
87
ki18n_install(po)
Volker Lanz's avatar
Volker Lanz committed
88

89
message(STATUS "KDE Partition Manager ${RELEASE_SERVICE_VERSION} will be built for install into ${CMAKE_INSTALL_PREFIX}")
90
91

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)