CMakeLists.txt 2.01 KB
Newer Older
Marco Martin's avatar
Marco Martin committed
1
2
3
project(plymouthkcm)

cmake_minimum_required(VERSION 2.8.12)
4
set(KF5_MIN_VERSION "5.62.0")
5
set(QT_MIN_VERSION "5.12.0")
Marco Martin's avatar
Marco Martin committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

################# Disallow in-source build #################

if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
   message(FATAL_ERROR "plymouthkcm requires an out of source build. Please create a separate build directory and run 'cmake path_to_kirigami [options]' there.")
endif()



# Make CPack available to easy generate binary packages
include(CPack)
include(FeatureSummary)

################# set KDE specific information #################

21
set(PROJECT_VERSION "5.17.80")
Marco Martin's avatar
gpl    
Marco Martin committed
22
23
set(PROJECT_VERSION_MAJOR 5)

Laurent Montel's avatar
Laurent Montel committed
24
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Marco Martin's avatar
Marco Martin committed
25
26

# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
Marco Martin's avatar
Marco Martin committed
27
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
Marco Martin's avatar
Marco Martin committed
28
29
30
31
32
33

include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
34
include(KDEClangFormat)
Marco Martin's avatar
Marco Martin committed
35
36
37
38

find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui )

find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Michael Palimaka's avatar
Michael Palimaka committed
39
                    Archive NewStuff NewStuffCore KIO Declarative I18n Config ConfigWidgets)
Marco Martin's avatar
Marco Martin committed
40

41
42
43
44
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
Marco Martin's avatar
Marco Martin committed
45
46
47
48
49
50
51
52
################# Enable C++11 features for clang and gcc #################

if(UNIX)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
endif()

################# now find all used packages #################

Marco Martin's avatar
Marco Martin committed
53
find_package(Plymouth REQUIRED)
Marco Martin's avatar
Marco Martin committed
54
55
56

add_subdirectory(src)

57
58
59
60
# 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})

Marco Martin's avatar
Marco Martin committed
61
62
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)