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

Laurent Montel's avatar
Laurent Montel committed
9
set(QT_MIN_VERSION "5.14.0")
Laurent Montel's avatar
Laurent Montel committed
10
set(KF5_MIN_VERSION "5.79.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

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

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

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

55 56 57 58 59 60 61 62 63 64
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)

set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
    if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
        message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support")
    else()
        set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
    endif()
endif()
Laurent Montel's avatar
Laurent Montel committed
65

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

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