CMakeLists.txt 1.28 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16)
2

3
project(Milou)
4
set(PROJECT_VERSION "5.21.80")
5
set(PROJECT_VERSION_MAJOR 5)
6

7
set(QT_MIN_VERSION "5.15.0")
8
set(KF5_MIN_VERSION "5.78")
9

10
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
11
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
12

13
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Qml Quick Widgets)
Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
14
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n Declarative ItemModels Service Plasma Runner)
Vishesh Handa's avatar
Vishesh Handa committed
15

16
17
18
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
19
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
20
include(ECMAddTests)
21
include(GenerateExportHeader)
22
include(KDEClangFormat)
23
24
25
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    include(KDEGitCommitHooks)
endif()
26
27
28
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
29

30
31
add_definitions(-DQT_NO_FOREACH -DQT_NO_KEYWORDS)

32
add_subdirectory(lib)
33
add_subdirectory(plasmoid)
34

35
36
37
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
38
39
40
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
41

42
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)