CMakeLists.txt 2.4 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
# KDE Application Version, managed by release script
2
set (RELEASE_SERVICE_VERSION_MAJOR "21")
3
set (RELEASE_SERVICE_VERSION_MINOR "07")
4
5
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
6
cmake_minimum_required (VERSION 3.16.0 FATAL_ERROR)
7
project(kdebugsettings VERSION ${RELEASE_SERVICE_VERSION})
Laurent Montel's avatar
Laurent Montel committed
8

9
set(QT_MIN_VERSION "5.15.0")
Laurent Montel's avatar
Laurent Montel committed
10
set(KF5_MIN_VERSION "5.80.0")
Laurent Montel's avatar
Laurent Montel committed
11

12
set(ECM_VERSION ${KF5_MIN_VERSION})
Laurent Montel's avatar
Laurent Montel committed
13
14

find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE)
15
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
Laurent Montel's avatar
Laurent Montel committed
16

Laurent Montel's avatar
Minor    
Laurent Montel committed
17

Laurent Montel's avatar
Laurent Montel committed
18
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Test)
19
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS 
Laurent Montel's avatar
Laurent Montel committed
20
    CoreAddons 
Laurent Montel's avatar
Laurent Montel committed
21
    Config
Laurent Montel's avatar
Laurent Montel committed
22
23
    DBusAddons 
    I18n 
Laurent Montel's avatar
Laurent Montel committed
24
    WidgetsAddons
Laurent Montel's avatar
Laurent Montel committed
25
    ItemViews
Michael Palimaka's avatar
Michael Palimaka committed
26
    Completion)
Laurent Montel's avatar
Laurent Montel committed
27
include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
28
include(KDEGitCommitHooks)
Laurent Montel's avatar
Laurent Montel committed
29
include(ECMAddAppIcon)
Laurent Montel's avatar
Laurent Montel committed
30
31
include(ECMInstallIcons)
include(KDEInstallDirs)
32
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
33
include(KDECMakeSettings)
Laurent Montel's avatar
Laurent Montel committed
34
include(ECMAddTests)
35
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
36
include(GenerateExportHeader)
Laurent Montel's avatar
Laurent Montel committed
37

38

Laurent Montel's avatar
Laurent Montel committed
39
add_definitions(-DTRANSLATION_DOMAIN="kdebugsettings")
Laurent Montel's avatar
Laurent Montel committed
40
add_definitions(-DQT_NO_FOREACH)
41
add_definitions(-DQT_NO_KEYWORDS)
42
43
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
44
45
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
46

47

Laurent Montel's avatar
Laurent Montel committed
48
configure_file(config-kdebugsettings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdebugsettings.h)
Laurent Montel's avatar
Laurent Montel committed
49

50
set(KDEBUGSETTINGS_LIB_VERSION "${RELEASE_SERVICE_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
51
52
set(KDEBUGSETTINGS_LIB_SOVERSION "5")

53
if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
54
    add_definitions(-DBUILD_TESTING)
55
56
endif(BUILD_TESTING)

57
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
58

59
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
60
if (USE_UNITY_CMAKE_SUPPORT)
61
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
62
endif()
Laurent Montel's avatar
Laurent Montel committed
63

Laurent Montel's avatar
Laurent Montel committed
64
add_subdirectory( src )
Laurent Montel's avatar
Laurent Montel committed
65
if (BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
66
    add_subdirectory( autotests )
Laurent Montel's avatar
Laurent Montel committed
67
endif()
Laurent Montel's avatar
Laurent Montel committed
68
ecm_qt_install_logging_categories(EXPORT KDEBUGSETTINGS FILE kdebugsettings.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
69
add_subdirectory(data/groups)
Laurent Montel's avatar
Laurent Montel committed
70

Laurent Montel's avatar
Laurent Montel committed
71
install( FILES data/kde.renamecategories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} )
Laurent Montel's avatar
Laurent Montel committed
72
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
Laurent Montel's avatar
Laurent Montel committed
73
ki18n_install(po)
Laurent Montel's avatar
Laurent Montel committed
74
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)