1
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
2
find_package(ECM 1.8.0 REQUIRED NOMODULE)
3
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
4
include(SetKexiCMakePolicies NO_POLICY_SCOPE)
5
include(SetKexiVersionInfo)
7
project(Kexi VERSION ${KEXI_VERSION})
9
include(ECMInstallIcons)
10
include(ECMAddAppIcon)
11
include(ECMSetupVersion)
13
include(ECMMarkAsTest)
14
include(ECMMarkNonGuiExecutable)
15
include(ECMGenerateHeaders)
18
include(KDEInstallDirs)
19
include(KDECMakeSettings)
20
include(KDECompilerSettings)
24
ensure_out_of_source_build("Please refer to the build instruction https://community.kde.org/Kexi/Building")
25
get_git_revision_and_branch()
26
detect_release_build()
28
#######################
29
########################
30
## Productset setting ##
31
########################
32
#######################
34
# For predefined productsets see the definitions in KexiProducts.cmake and
35
# in the files in the folder cmake/productsets.
37
# Finding out the products & features to build is done in 5 steps:
38
# 1. have the user define the products/features wanted, by giving a productset
39
# 2. estimate all additional required products/features
40
# 3. estimate which of the products/features can be build by external deps
41
# 4. find which products/features have been temporarily disabled due to problems
42
# 5. estimate which of the products/features can be build by internal deps
44
# get the special macros
45
include(CalligraProductSetMacros)
47
# get the definitions of products, features and product sets
48
include(KexiProducts.cmake)
50
set(PRODUCTSET_DEFAULT "ALL")
53
set(PRODUCTSET ${PRODUCTSET_DEFAULT} CACHE STRING "Set of products/features to build" FORCE)
57
set(KEXI_SHOULD_BUILD_STAGING FALSE)
59
set(KEXI_SHOULD_BUILD_STAGING TRUE)
62
# finally choose products/features to build
63
calligra_set_productset(${PRODUCTSET})
65
##########################
66
###########################
67
## Look for Qt, KF5 ##
68
###########################
69
##########################
71
set(REQUIRED_KF5_VERSION 5.16.0)
72
find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS
89
find_package(KF5 ${REQUIRED_KF5_VERSION} QUIET OPTIONAL_COMPONENTS Crash)
90
macro_bool_to_01(KF5Crash_FOUND HAVE_KCRASH)
91
macro_log_feature(${KF5Crash_FOUND} "KCrash" "KDE's Crash Handler"
92
"https://api.kde.org/frameworks/kcrash/html" FALSE ""
93
"Optionally used to provide crash reporting on Linux")
95
set(REQUIRED_QT_VERSION 5.4.0)
96
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets Xml Network PrintSupport Test)
97
find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS UiTools WebKit WebKitWidgets)
99
# use sane compile flags
101
-DQT_NO_CAST_TO_ASCII
102
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
103
-DQT_NO_URL_CAST_FROM_STRING
104
-DQT_STRICT_ITERATORS
105
-DQT_USE_FAST_CONCATENATION
106
-DQT_USE_FAST_OPERATOR_PLUS
107
-DQT_USE_QSTRINGBUILDER
110
# only with COMPILING_TESTS definition will all the FOO_TEST_EXPORT macros do something
111
# TODO: check if this can be moved to only those places which make use of it,
112
# to reduce global compiler definitions that would trigger a recompile of
113
# everything on a change (like adding/removing tests to/from the build)
114
macro_bool_to_01(BUILD_TESTING COMPILING_TESTS)
116
# overcome some platform incompatibilities
118
find_package(KDEWin REQUIRED)
121
# set custom Kexi plugin installdir
122
set(KEXI_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/kexi)
124
# TEMPORARY: for initial Qt5/KF5 build porting phase deprecation warnings are only annoying noise
125
# remove once code porting phase starts, perhaps first locally in product subdirs
126
#if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
127
# add_definitions(-Wno-deprecated -Wno-deprecated-declarations)
130
###########################
131
############################
132
## Required dependencies ##
133
############################
134
###########################
136
set(REQUIRED_KEXI_LIBS_VERSION 3.0)
137
set(MAXIMUM_KEXI_LIBS_VERSION 3.0.80) # .80 means < 3.1 Alpha
142
option(KEXI_DEBUG_GUI "Debugging GUI for Kexi (requires KDB_DEBUG_GUI to be set too)" OFF)
144
set(KDB_REQUIRED_COMPONENTS DEBUG_GUI)
146
find_package(KDb ${REQUIRED_KEXI_LIBS_VERSION} REQUIRED COMPONENTS ${KDB_REQUIRED_COMPONENTS})
147
macro_log_feature(KDb_FOUND "KDb" "A database connectivity and creation framework"
148
"http://community.kde.org/KDb" FALSE "" "Required by Kexi for data handling")
149
check_maximum_package_version(KDb ${MAXIMUM_KEXI_LIBS_VERSION})
154
find_package(KReport ${REQUIRED_KEXI_LIBS_VERSION} REQUIRED)
156
if(NOT KREPORT_SCRIPTING)
157
message(FATAL_ERROR "Kexi requires KReport package with scripting support enabled (KREPORT_SCRIPTING)")
160
check_maximum_package_version(KReport ${MAXIMUM_KEXI_LIBS_VERSION})
163
## Test for KPropertyWidgets
165
find_package(KPropertyWidgets ${KEXI_LIBS_MIN_VERSION} REQUIRED)
166
macro_log_feature(KPropertyWidgets_FOUND "KPropertyWidgets" "A property editing framework with editor widget"
167
"http://community.kde.org/KProperty" FALSE "" "Required by Kexi")
168
check_maximum_package_version(KPropertyWidgets ${MAXIMUM_KEXI_LIBS_VERSION})
170
include(CheckIfQtGuiCanBeExecuted)
171
include(CheckGlobalBreezeIcons)
173
###########################
174
############################
175
## Optional dependencies ##
176
############################
177
###########################
182
set(MARBLE_MIN_VERSION "0.19.2")
183
find_package(KexiMarble)
185
set(MARBLE_INCLUDE_DIR "")
187
set(HAVE_MARBLE TRUE)
189
macro_log_feature(MARBLE_FOUND "Marble" "KDE World Globe Widget library" "https://marble.kde.org/" FALSE "${MARBLE_MIN_VERSION}" "Required by Kexi form map widget")
192
set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR}
193
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
194
LIBRARY ${INSTALL_TARGETS_DEFAULT_ARGS}
195
ARCHIVE ${INSTALL_TARGETS_DEFAULT_ARGS} )
196
set(DATA_INSTALL_DIR "$ENV{APPDATA}")
197
STRING(REGEX REPLACE "\\\\" "/" DATA_INSTALL_DIR ${DATA_INSTALL_DIR})
198
# Install own icons to CMAKE_INSTALL_FULL_ICONDIR (relative to bin/data/) on Windows.
199
# We're consistend because icons from breeze-icons.git are installed there as well.
200
set(ICONS_INSTALL_DIR ${CMAKE_INSTALL_FULL_ICONDIR})
202
# On other OSes install own icons in app's data dir
203
set(ICONS_INSTALL_DIR "${DATA_INSTALL_DIR}/${PROJECT_NAME_LOWER}/icons")
207
## Test for Qt WebKitWidgets
209
#TODO switch to Qt WebEngine
210
macro_bool_to_01(Qt5WebKitWidgets_FOUND HAVE_QTWEBKITWIDGETS)
211
macro_log_feature(Qt5WebKitWidgets_FOUND "Qt WebkitWidgets" "QWidgets module for Webkit, the HTML engine." "http://qt.io" FALSE "" "Required by Kexi web form widget")
219
include(MacroCalligraAddBenchmark)
220
include(MacroCalligraAddTest)
222
#############################################
223
#### Temporarily broken products ####
224
#############################################
226
# If a product does not build due to some temporary brokeness disable it here,
227
# by calling calligra_disable_product with the product id and the reason,
229
# calligra_disable_product(APP_KEXI "isn't buildable at the moment")
231
#############################################
232
#### Calculate buildable products ####
233
#############################################
235
calligra_drop_unbuildable_products()
238
#############################################
239
#### Setup product-depending vars ####
240
#############################################
248
add_subdirectory(src)
251
add_subdirectory(doc)
254
# non-app directories are moved here because they can depend on SHOULD_BUILD_{appname} variables set above
255
add_subdirectory(cmake)
257
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
261
macro_display_feature_log()
263
calligra_product_deps_report("product_deps")
264
calligra_log_should_build()