File: CMakeLists.txt

package info (click to toggle)
kexi 1:3.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 29,524 kB
  • sloc: cpp: 98,982; ansic: 4,492; sql: 955; sh: 628; python: 556; xml: 350; java: 107; makefile: 20
file content (289 lines) | stat: -rw-r--r-- 8,771 bytes parent folder | download
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
find_package(ECM 1.8.0 REQUIRED NOMODULE)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(SetKexiCMakePolicies NO_POLICY_SCOPE)
include(SetKexiVersionInfo)

project(Kexi VERSION ${PROJECT_VERSION})

include(KexiAddTests)
kexi_add_tests(OFF)

# ECM
include(ECMAddAppIcon)
include(ECMAddTests)
include(ECMGenerateHeaders)
include(ECMInstallIcons)
include(ECMMarkAsTest)
include(ECMMarkNonGuiExecutable)
include(ECMPoQmTools)
include(ECMSetupVersion)
include(KDEInstallDirs)
include(KDECMakeSettings NO_POLICY_SCOPE)
include(KDECompilerSettings NO_POLICY_SCOPE)

# Own
include(KexiMacros)
include(KexiAddIconsRccFile)
include(KexiGenerateDependencyGraph)

ensure_out_of_source_build("Please refer to the build instruction https://community.kde.org/Kexi/Building")
get_git_revision_and_branch()
detect_release_build()

 #######################
########################
## Productset setting ##
########################
#######################

# For predefined productsets see the definitions in KexiProducts.cmake and
# in the files in the folder cmake/productsets.

# Finding out the products & features to build is done in 5 steps:
# 1. have the user define the products/features wanted, by giving a productset
# 2. estimate all additional required products/features
# 3. estimate which of the products/features can be build by external deps
# 4. find which products/features have been temporarily disabled due to problems
# 5. estimate which of the products/features can be build by internal deps

# get the special macros
include(CalligraProductSetMacros)

set(PRODUCTSET_DEFAULT "DESKTOP")

if(NOT PRODUCTSET OR PRODUCTSET STREQUAL "ALL")
    # Force the default set also when it is "ALL" because we can't build both desktop and mobile
    set(PRODUCTSET ${PRODUCTSET_DEFAULT} CACHE STRING "Set of products/features to build" FORCE)
endif()

# get the definitions of products, features and product sets
include(KexiProducts.cmake)

if (RELEASE_BUILD)
    set(KEXI_SHOULD_BUILD_STAGING FALSE)
else ()
    set(KEXI_SHOULD_BUILD_STAGING TRUE)
endif ()

# finally choose products/features to build
calligra_set_productset(${PRODUCTSET})

 ##########################
###########################
## Look for Qt, KF5 ##
###########################
##########################

set(REQUIRED_KF5_VERSION 5.16.0)
set(REQUIRED_KF5_COMPONENTS
    Archive
    Codecs
    Config
    ConfigWidgets
    CoreAddons
    GuiAddons
    I18n
    IconThemes
    ItemViews
    WidgetsAddons
    TextWidgets
    XmlGui
)
if(SHOULD_BUILD_KEXI_DESKTOP_APP)
    list(APPEND REQUIRED_KF5_COMPONENTS
        Completion
        KIO
        TextEditor
        TextWidgets
    )
endif()
find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS ${REQUIRED_KF5_COMPONENTS})

find_package(KF5 ${REQUIRED_KF5_VERSION} COMPONENTS Crash)
macro_bool_to_01(KF5Crash_FOUND HAVE_KCRASH)
set_package_properties(KF5Crash PROPERTIES TYPE OPTIONAL
                       PURPOSE "Used to provide crash reporting on Linux")

set(REQUIRED_QT_VERSION 5.4.0)
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets Xml Network PrintSupport Test)
find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS UiTools WebKit WebKitWidgets)

# use sane compile flags
add_definitions(
  -DQT_NO_CAST_TO_ASCII
  -DQT_NO_SIGNALS_SLOTS_KEYWORDS
  -DQT_NO_URL_CAST_FROM_STRING
  -DQT_STRICT_ITERATORS
  -DQT_USE_FAST_CONCATENATION
  -DQT_USE_FAST_OPERATOR_PLUS
  -DQT_USE_QSTRINGBUILDER
)

# overcome some platform incompatibilities
if(WIN32)
    find_package(KDEWin REQUIRED)
endif()

# set custom Kexi plugin installdir
set(KEXI_PLUGIN_INSTALL_DIR ${PLUGIN_INSTALL_DIR}/${KEXI_BASE_PATH})

simple_option(BUILD_EXAMPLES "Build and install examples" ON)

macro_bool_to_01(BUILD_EXAMPLES COMPILING_EXAMPLES)

# set custom Kexi examples installdir
set(KEXI_EXAMPLES_INSTALL_DIR ${SHARE_INSTALL_PREFIX}/${KEXI_BASE_PATH}/examples)

# TEMPORARY: for initial Qt5/KF5 build porting phase deprecation warnings are only annoying noise
# remove once code porting phase starts, perhaps first locally in product subdirs
#if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
#    add_definitions(-Wno-deprecated -Wno-deprecated-declarations)
#endif ()

 ###########################
############################
## Required dependencies  ##
############################
###########################

set(KEXI_FRAMEWORKS_MIN_VERSION 3.1.0)

##
## Test for KDb
##
simple_option(KEXI_DEBUG_GUI "Debugging GUI for Kexi (requires KDB_DEBUG_GUI to be set too)" OFF)
if(KEXI_DEBUG_GUI)
    set(KDB_REQUIRED_COMPONENTS DEBUG_GUI)
endif()
find_package(KDb ${KEXI_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS ${KDB_REQUIRED_COMPONENTS})
set_package_properties(KDb PROPERTIES TYPE REQUIRED
                       PURPOSE "Required by Kexi for data handling")

##
## Test for KReport
##
find_package(KReport ${KEXI_FRAMEWORKS_MIN_VERSION})
set_package_properties(KReport PROPERTIES TYPE REQUIRED
                       PURPOSE "Required by Kexi for report handling")
if (KReport_FOUND)
    if(NOT KREPORT_SCRIPTING)
        message(FATAL_ERROR "Kexi requires KReport package with scripting support enabled (KREPORT_SCRIPTING)")
    endif()
endif()

##
## Test for KPropertyWidgets
##
if(SHOULD_BUILD_KEXI_DESKTOP_APP)
    find_package(KPropertyWidgets ${KEXI_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS KF)
    set_package_properties(KPropertyWidgets PROPERTIES TYPE REQUIRED
                           PURPOSE "Required by Kexi for handling properties")
else() # only KPropertyCore
    find_package(KPropertyCore ${KEXI_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS KF)
    set_package_properties(KPropertyCore PROPERTIES TYPE REQUIRED
                           PURPOSE "Required by Kexi for handling properties")
endif()
include(CheckIfQtGuiCanBeExecuted)

if(SHOULD_BUILD_KEXI_DESKTOP_APP)
include(CheckGlobalBreezeIcons)
endif()
 ###########################
############################
## Optional dependencies  ##
############################
###########################

##
## Test for marble
##
set(MARBLE_MIN_VERSION "0.19.2")
find_package(KexiMarble ${MARBLE_MIN_VERSION})
set_package_properties(KexiMarble PROPERTIES
    DESCRIPTION "KDE World Globe Widget library"
    URL "https://marble.kde.org"
    TYPE RECOMMENDED
    PURPOSE "Required by Kexi form map widget"
)
if(NOT MARBLE_FOUND)
    set(MARBLE_INCLUDE_DIR "")
else()
    set(HAVE_MARBLE TRUE)
endif()
set_package_properties(GLIB2 PROPERTIES TYPE RECOMMENDED PURPOSE "${_REQUIRED_BY_MDB}")

##
## Test for Qt WebKitWidgets
##
#TODO switch to Qt WebEngine
macro_bool_to_01(Qt5WebKitWidgets_FOUND HAVE_QTWEBKITWIDGETS)
set_package_properties(Qt5WebKit PROPERTIES
                       DESCRIPTION "Webkit for Qt, the HTML engine."
                       URL "http://qt.io"
                       TYPE RECOMMENDED PURPOSE "Required by Kexi web form widget"
)
set_package_properties(Qt5WebKitWidgets PROPERTIES
                       DESCRIPTION "QWidgets module for Webkit, the HTML engine."
                       URL "http://qt.io"
                       TYPE RECOMMENDED PURPOSE "Required by Kexi web form widget"
)

 ##################
###################
## Helper macros ##
###################
##################

include(MacroKexiAddBenchmark)
include(MacroKexiAddTest)

#############################################
####      Temporarily broken products    ####
#############################################

# If a product does not build due to some temporary brokeness disable it here,
# by calling calligra_disable_product with the product id and the reason,
# e.g.:
# calligra_disable_product(APP_KEXI "isn't buildable at the moment")

#############################################
####     Calculate buildable products    ####
#############################################

calligra_drop_unbuildable_products()


#############################################
####     Setup product-depending vars    ####
#############################################

 ###################
####################
## Subdirectories ##
####################
###################

add_subdirectory(src)

if(SHOULD_BUILD_DOC)
    find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS DocTools)
    add_subdirectory(doc)
endif()

# non-app directories are moved here because they can depend on SHOULD_BUILD_{appname} variables set above
add_subdirectory(cmake)

if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
    ki18n_install(po)
endif()

calligra_product_deps_report("product_deps")
calligra_log_should_build()

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

  find_package(KF5DocTools CONFIG)
  if(KF5DocTools_FOUND)
    kdoctools_install(po)
  endif()