CMakeLists.txt 2.18 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
2
3

# KDE Application Version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "22")
5
set (RELEASE_SERVICE_VERSION_MINOR "07")
6
set (RELEASE_SERVICE_VERSION_MICRO "70")
7
8
9
10
11
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
set (RELEASE_SERVICE_COMPACT_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}${RELEASE_SERVICE_VERSION_MINOR}${RELEASE_SERVICE_VERSION_MICRO}")

project(kmplot VERSION "1.3.${RELEASE_SERVICE_COMPACT_VERSION}")

12
set (QT_MIN_VERSION "5.15.2")
13
14
set (KF5_MIN_VERSION "5.86.0")
set (KDE_COMPILERSETTINGS_LEVEL "5.82.0")
Christoph Feck's avatar
Christoph Feck committed
15

16
find_package (ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
17
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
Laurent Montel's avatar
Laurent Montel committed
18

Patrick Spendrin's avatar
Patrick Spendrin committed
19
include(CheckIncludeFiles)
Christoph Feck's avatar
Christoph Feck committed
20
include(KDEInstallDirs)
Albert Astals Cid's avatar
Albert Astals Cid committed
21
include(ECMAddAppIcon)
22
include(ECMInstallIcons)
23
include(ECMSetupVersion)
Christoph Feck's avatar
Christoph Feck committed
24
include(KDECMakeSettings)
25
include(KDECompilerSettings NO_POLICY_SCOPE)
26
27
include(KDEClangFormat)
include(KDEGitCommitHooks)
Christoph Feck's avatar
Christoph Feck committed
28

29
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Svg Widgets PrintSupport)
Christoph Feck's avatar
Christoph Feck committed
30

31
find_package (KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
32
    Crash
Christoph Feck's avatar
Christoph Feck committed
33
34
35
36
    GuiAddons
    I18n
    Parts
    WidgetsAddons
Albert Astals Cid's avatar
Albert Astals Cid committed
37
    DocTools
38
    DBusAddons
Christoph Feck's avatar
Christoph Feck committed
39
)
Patrick Spendrin's avatar
Patrick Spendrin committed
40

Laurent Montel's avatar
Laurent Montel committed
41
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
42
add_definitions (-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
43
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
Yuri Chornoivan's avatar
Yuri Chornoivan committed
44
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
45

Adriaan de Groot's avatar
Adriaan de Groot committed
46
check_include_files(ieeefp.h HAVE_IEEEFP_H)
47
configure_file(config-kmplot.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kmplot/config-kmplot.h)
48
ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX KMPLOT VERSION_HEADER kmplot_version.h)
Adriaan de Groot's avatar
Adriaan de Groot committed
49

Laurent Montel's avatar
Laurent Montel committed
50
add_subdirectory( doc )
Christoph Feck's avatar
Christoph Feck committed
51
add_subdirectory( kmplot )
52
add_subdirectory( icons )
Laurent Montel's avatar
Laurent Montel committed
53

Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
54
ki18n_install(po)
55
56
57
if (KF5DocTools_FOUND)
    kdoctools_install(po)
endif()
58
install(FILES org.kde.kmplot.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
59
60
61
62
63
64

file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})

kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)

Laurent Montel's avatar
Laurent Montel committed
65
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)