-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
173 lines (150 loc) · 4.65 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
cmake_minimum_required(VERSION 3.16)
project(Okteta VERSION 0.26.60)
set(REQUIRED_KF_VERSION "5.100.0")
find_package(ECM ${REQUIRED_KF_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
# ECM KDE macros (include first, to have their policies and settings effect all other macros)
include(KDEInstallDirs)
include(KDECMakeSettings NO_POLICY_SCOPE)
include(KDECompilerSettings NO_POLICY_SCOPE)
# ECM macros
include(ECMQtDeclareLoggingCategory)
include(ECMInstallIcons)
include(ECMAddAppIcon)
include(ECMDeprecationSettings)
# CMake macros
include(FeatureSummary)
include(CMakeDependentOption)
if(BUILD_TESTING)
include(ECMAddTests)
endif()
# Okteta macros
include(OktetaInternalMacros)
# control build scope, default to examples if BUILD_TESTING is ON
if( NOT DEFINED OMIT_EXAMPLES AND NOT BUILD_TESTING )
set( OMIT_EXAMPLES TRUE )
endif()
if( NOT DEFINED OMIT_INTERNAL_TEMPLATES AND NOT BUILD_TESTING )
set( OMIT_INTERNAL_TEMPLATES TRUE )
endif()
if( NOT OMIT_EXAMPLES )
set( OKTETA_BUILD_EXAMPLES TRUE )
endif()
if( NOT OMIT_INTERNAL_TEMPLATES )
set( KASTEN_BUILD_INTERNAL_TEMPLATES TRUE )
endif()
option(BUILD_DESIGNERPLUGIN "Build the Designer plugin." ON)
add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Qt Designer plugin")
option(BUILD_OKTETAKASTENLIBS "Build the Okteta Kasten libraries." ON)
add_feature_info(OKTETAKASTENLIBS ${BUILD_OKTETAKASTENLIBS} "Okteta Kasten libraries")
cmake_dependent_option(BUILD_TERMINALTOOL "Build the Terminal tool (needs Konsole/Qt5 KPart)." ON "BUILD_OKTETAKASTENLIBS" OFF)
add_feature_info(TERMINALTOOL ${BUILD_TERMINALTOOL} "Terminal tool")
cmake_dependent_option(BUILD_KPARTSPLUGIN "Build the KParts plugin." ON "BUILD_OKTETAKASTENLIBS" OFF)
add_feature_info(KPARTSPLUGIN ${BUILD_KPARTSPLUGIN} "KParts plugin")
cmake_dependent_option(BUILD_DESKTOPPROGRAM "Build the program." ON "BUILD_OKTETAKASTENLIBS" OFF)
add_feature_info(DESKTOPPROGRAM ${BUILD_DESKTOPPROGRAM} "Program")
set(REQUIRED_QT_VERSION "5.15.2")
set(ADDITIONAL_REQUIRED_QT_COMPONENTS)
if(BUILD_TESTING)
list(APPEND ADDITIONAL_REQUIRED_QT_COMPONENTS Test)
endif()
if( BUILD_DESIGNERPLUGIN )
list(APPEND ADDITIONAL_REQUIRED_QT_COMPONENTS UiPlugin)
endif()
if( BUILD_OKTETAKASTENLIBS )
list(APPEND ADDITIONAL_REQUIRED_QT_COMPONENTS
Network
PrintSupport
Qml
Script
ScriptTools
Xml
)
endif()
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED
COMPONENTS
Core
Widgets
${ADDITIONAL_REQUIRED_QT_COMPONENTS}
)
set(ADDITIONAL_REQUIRED_KF_COMPONENTS)
if( BUILD_OKTETAKASTENLIBS )
list(APPEND ADDITIONAL_REQUIRED_KF_COMPONENTS
Bookmarks
Completion
ItemViews
KIO
NewStuff
Service
WidgetsAddons
XmlGui
)
endif()
if (BUILD_TERMINALTOOL OR BUILD_KPARTSPLUGIN)
list(APPEND ADDITIONAL_REQUIRED_KF_COMPONENTS
Parts
)
endif()
if( BUILD_DESKTOPPROGRAM )
list(APPEND ADDITIONAL_REQUIRED_KF_COMPONENTS
Crash
DBusAddons
DocTools
)
endif()
find_package(KF5 ${REQUIRED_KF_VERSION} REQUIRED
COMPONENTS
ConfigWidgets
I18n
${ADDITIONAL_REQUIRED_KF_COMPONENTS}
)
ecm_set_disabled_deprecation_versions(
# Disable Qt deprecation warnings as there should be no new deprecations in Qt5,
# and QLinkedList porting will take some time, also not blocking Qt6 port
DISABLE_NEWER_WARNINGS
QT 5.14.0 # QLinkedList
)
ecm_set_disabled_deprecation_versions(
KF 5.100
)
# helper libs
add_subdirectory( libs )
if( BUILD_DESKTOPPROGRAM )
add_subdirectory( doc )
endif()
set( OKTETALIBS_MAJOR_VERSION 0 )
set( OKTETALIBS_MINOR_VERSION 10 )
set( OKTETALIBS_PATCHLEVEL_VERSION 0 )
set( OKTETALIBS_VERSION "${OKTETALIBS_MAJOR_VERSION}.${OKTETALIBS_MINOR_VERSION}.${OKTETALIBS_PATCHLEVEL_VERSION}" )
set( OKTETALIBS_ABI_VERSION 3 )
set( OKTETALIBS_LIB_SOVERSION 0 )
set( OKTETALIBS_LIB_VERSION ${OKTETALIBS_VERSION} )
# Okteta libs
add_subdirectory( core )
add_subdirectory( gui )
if( BUILD_DESIGNERPLUGIN )
add_subdirectory( designer )
endif()
# Okteta Kasten components
if( BUILD_OKTETAKASTENLIBS )
add_subdirectory( kasten )
endif()
# special mimetypes
if( BUILD_OKTETAKASTENLIBS )
add_subdirectory( mimetypes )
endif()
# programs and parts for desktop
add_subdirectory( parts )
if( BUILD_DESKTOPPROGRAM )
add_subdirectory( program )
endif()
ki18n_install(po)
if( BUILD_DESKTOPPROGRAM )
kdoctools_install(po)
endif()
ecm_qt_install_logging_categories(
EXPORT OKTETA
FILE okteta.categories
DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}"
)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)