CMakeLists.txt 4.15 KB
Newer Older
1
project(lattedock)
2
3
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)

4
set(CMAKE_CXX_STANDARD 14)
Michail Vourlakos's avatar
Michail Vourlakos committed
5
set(VERSION 0.10.8)
6
7
set(AUTHOR "Michail Vourlakos, Smith Ar")
set(EMAIL "mvourlakos@gmail.com, audoban@openmailbox.org")
8
9
10
set(WEBSITE "https://userbase.kde.org/LatteDock")
set(BUG_ADDRESS "https://bugs.kde.org/enter_bug.cgi?product=lattedock")
set(FAQS "https://userbase.kde.org/LatteDock/FAQ")
11

12
set(QT_MIN_VERSION "5.9.0")
13
set(KF5_MIN_VERSION "5.48.0")
14

15
set(KF5_LOCALE_PREFIX "")
16

17
find_package(ECM ${KF5_MIN_VER} REQUIRED NO_MODULE)
18
19
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

20
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED NO_MODULE COMPONENTS DBus Gui Qml Quick)
21

22
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
23
24
    Activities Archive CoreAddons GuiAddons Crash DBusAddons Declarative GlobalAccel Kirigami2
    I18n IconThemes KIO NewStuff Notifications Plasma PlasmaQuick Wayland WindowSystem XmlGui)
25
   
26
27
find_package(X11 REQUIRED)
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
28
29
30
    URL "http://www.x.org"
    TYPE OPTIONAL
    PURPOSE "Required for building the X11 based workspace")
31
32

if(X11_FOUND)
33
    find_package(XCB MODULE REQUIRED COMPONENTS XCB RANDR SHAPE EVENT)
34
35
    set_package_properties(XCB PROPERTIES TYPE REQUIRED)
    find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras)
36
37
38
39
40
41

    if(NOT X11_SM_FOUND)
        message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.
                \nPlease install libSM.\n")
    endif(NOT X11_SM_FOUND)

42
43
44
endif()

if(X11_FOUND AND XCB_XCB_FOUND)
45
    set(HAVE_X11 ON)
46
47
endif()

48
49
50
51
52
53
string(REGEX MATCH "\\.([^]]+)\\." KF5_VERSION_MINOR ${KF5_VERSION})
string(REGEX REPLACE "\\." "" KF5_VERSION_MINOR ${KF5_VERSION_MINOR})

message(STATUS "KF5 VERSION : ${KF5_VERSION}")
message(STATUS "KF5 VERSION MINOR : ${KF5_VERSION_MINOR}")

54
55
56
57
if(${KF5_VERSION_MINOR} LESS "62")
find_package(KF5 REQUIRED COMPONENTS SysGuard)
endif()

58
59
60
61
62
63
64
65
66
67
include(ECMQMLModules)
ecm_find_qmlmodule(QtQuick 2.7)
ecm_find_qmlmodule(QtQuick.Layouts 1.3)
ecm_find_qmlmodule(QtQuick.Controls 1.4)
ecm_find_qmlmodule(QtQuick.Controls.Styles.Plasma 2.0)
ecm_find_qmlmodule(QtGraphicalEffects 1.0)
ecm_find_qmlmodule(org.kde.kquickcontrolsaddons 2.0)
ecm_find_qmlmodule(org.kde.plasma.core 2.0)
ecm_find_qmlmodule(org.kde.plasma.components 2.0)

68
include(CheckIncludeFiles)
69
include(CMakePackageConfigHelpers)
70
71
include(ECMOptionalAddSubdirectory)
include(ECMQtDeclareLoggingCategory)
72
include(KDECMakeSettings)
73
include(KDECompilerSettings NO_POLICY_SCOPE)
74
include(KDEInstallDirs)
75
include(KDEPackageAppTemplates)
Michail Vourlakos's avatar
Michail Vourlakos committed
76
include(WriteBasicConfigVersionFile)
77

78
include(Definitions.cmake)
79

80
#hide warnings
81
string(REPLACE "-Wall" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
82
83
84
85
86
87
88
string(REPLACE "-Wdeprecated-declarations" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-Wreorder" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-Wunused-variable" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-Wunused-parameter" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})

#add format security check
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Werror=format-security")
89
90
91

message(STATUS "COMPILER FLAGS : ${CMAKE_CXX_FLAGS}")

92
93
94
95
96
# Share Same Core Types between declarativeimports and app
set(CORETYPESHEADER "LIBCORETYPES_H")
configure_file(declarativeimports/coretypes.h.in declarativeimports/core/types.h)
set(CORETYPESHEADER "APPCORETYPES_H")
configure_file(declarativeimports/coretypes.h.in app/coretypes.h)
97
98
99
set(CORETYPESHEADER "LATTEGENERALCONTAINMENTTYPES_H")
configure_file(declarativeimports/coretypes.h.in containment/plugin/lattetypes.h)

100
101
102
# Share App::Settings::GenericTools to containment actions
configure_file(app/settings/generic/generictools.h containmentactions/contextmenu/generictools.h)
configure_file(app/settings/generic/generictools.cpp containmentactions/contextmenu/generictools.cpp)
103
configure_file(app/data/contextmenudata.h containmentactions/contextmenu/contextmenudata.h)
104
105

# subdirectories
106
add_subdirectory(declarativeimports)
107
add_subdirectory(indicators)
108
add_subdirectory(app)
109
add_subdirectory(containmentactions)
110
add_subdirectory(containment)
111
add_subdirectory(icons)
112
113
add_subdirectory(plasmoid)
add_subdirectory(shell)
114

115
ki18n_install(po)