CMakeLists.txt 2.84 KB
Newer Older
Volker Lanz's avatar
Volker Lanz committed
1
# Copyright (C) 2008 by Volker Lanz <vl@fidra.de>
Andrius Štikonas's avatar
Andrius Štikonas committed
2
# Copyright (C) 2014-2019 by Andrius Štikonas <andrius@stikonas.eu>
Volker Lanz's avatar
Volker Lanz committed
3
#
4 5 6 7
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of
# the License, or (at your option) any later version.
Volker Lanz's avatar
Volker Lanz committed
8 9 10 11 12 13 14
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Volker Lanz's avatar
Volker Lanz committed
16

17
project(partitionmanager)
Volker Lanz's avatar
Volker Lanz committed
18

Andrius Štikonas's avatar
Andrius Štikonas committed
19
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
Volker Lanz's avatar
Volker Lanz committed
20

21 22
# Dependencies
set(QT_MIN_VERSION "5.10.0")
23
set(KF5_MIN_VERSION "5.56")
Andrius Štikonas's avatar
Andrius Štikonas committed
24
set(KPMCORE_MIN_VERSION "4.1.0")
25

26 27
set(CMAKE_USE_RELATIVE_PATHS OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
28
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
29

30
# Check KPMcore dependency when bumping
31
set(VERSION_MAJOR "4")
Andrius Štikonas's avatar
Andrius Štikonas committed
32
set(VERSION_MINOR "1")
Andrius Štikonas's avatar
Andrius Štikonas committed
33
set(VERSION_RELEASE "0")
34
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE})
35
add_definitions(-D'VERSION="${VERSION}"') #"
Volker Lanz's avatar
Volker Lanz committed
36

37 38 39
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

40
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
41
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
42 43 44 45
include(ECMInstallIcons)

include(KDEInstallDirs)
include(KDECMakeSettings)
46
include(KDECompilerSettings NO_POLICY_SCOPE)
47 48 49 50 51
include(FeatureSummary)
include(GenerateExportHeader)

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
  Core
52
  Gui
53 54 55 56
  Widgets
)

# Load the frameworks we need
Andrius Štikonas's avatar
Andrius Štikonas committed
57
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
58 59 60 61 62
  COMPONENTS
    Config
    ConfigWidgets
    CoreAddons
    Crash
63
    DBusAddons
64 65 66 67 68
    I18n
    IconThemes
    JobWidgets
    KIO
    WidgetsAddons
69
    XmlGui
70 71
  OPTIONAL_COMPONENTS
    DocTools
72 73 74 75
)

# use sane compile flags
add_definitions(
76 77 78 79 80 81
  -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
82
  -DQT_NO_CAST_TO_BYTEARRAY
83 84
  -DQT_NO_SIGNALS_SLOTS_KEYWORDS
  -DQT_USE_FAST_OPERATOR_PLUS
Andrius Štikonas's avatar
Andrius Štikonas committed
85
  -DQT_DISABLE_DEPRECATED_BEFORE=0x050900
86
)
Volker Lanz's avatar
Volker Lanz committed
87

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

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

92
add_subdirectory(src)
93
add_subdirectory(icons)
Andrius Štikonas's avatar
Andrius Štikonas committed
94 95 96
if (KF5DocTools_FOUND)
    add_subdirectory(doc)
endif()
Volker Lanz's avatar
Volker Lanz committed
97

98
ki18n_install(po)
Volker Lanz's avatar
Volker Lanz committed
99

100
message(STATUS "KDE Partition Manager ${VERSION} will be built for install into ${CMAKE_INSTALL_PREFIX}")
101 102

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)