CMakeLists.txt 2.35 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")
10
set(KF5_MIN_VERSION "5.76.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(ECMAddAppIcon)
Laurent Montel's avatar
Laurent Montel committed
29 30
include(ECMInstallIcons)
include(KDEInstallDirs)
31
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
32
include(KDECMakeSettings)
Laurent Montel's avatar
Laurent Montel committed
33
include(ECMAddTests)
34
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
35
include(GenerateExportHeader)
Laurent Montel's avatar
Laurent Montel committed
36

37

Laurent Montel's avatar
Laurent Montel committed
38
add_definitions(-DTRANSLATION_DOMAIN="kdebugsettings")
Laurent Montel's avatar
Laurent Montel committed
39
add_definitions(-DQT_NO_FOREACH)
40 41
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
42

43

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

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

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

53 54 55 56 57 58 59 60 61 62
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
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

Laurent Montel's avatar
Laurent Montel committed
70
install( FILES data/kde.renamecategories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} )
Laurent Montel's avatar
Laurent Montel committed
71
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)