~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
ImportĀ upstreamĀ versionĀ 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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)
 
6
 
 
7
project(Kexi VERSION ${KEXI_VERSION})
 
8
 
 
9
include(ECMInstallIcons)
 
10
include(ECMAddAppIcon)
 
11
include(ECMSetupVersion)
 
12
include(ECMAddTests)
 
13
include(ECMMarkAsTest)
 
14
include(ECMMarkNonGuiExecutable)
 
15
include(ECMGenerateHeaders)
 
16
include(ECMPoQmTools)
 
17
 
 
18
include(KDEInstallDirs)
 
19
include(KDECMakeSettings)
 
20
include(KDECompilerSettings)
 
21
 
 
22
include(KexiMacros)
 
23
 
 
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()
 
27
 
 
28
 #######################
 
29
########################
 
30
## Productset setting ##
 
31
########################
 
32
#######################
 
33
 
 
34
# For predefined productsets see the definitions in KexiProducts.cmake and
 
35
# in the files in the folder cmake/productsets.
 
36
 
 
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
 
43
 
 
44
# get the special macros
 
45
include(CalligraProductSetMacros)
 
46
 
 
47
# get the definitions of products, features and product sets
 
48
include(KexiProducts.cmake)
 
49
 
 
50
set(PRODUCTSET_DEFAULT "ALL")
 
51
 
 
52
if(NOT PRODUCTSET)
 
53
    set(PRODUCTSET ${PRODUCTSET_DEFAULT} CACHE STRING "Set of products/features to build" FORCE)
 
54
endif()
 
55
 
 
56
if (RELEASE_BUILD)
 
57
    set(KEXI_SHOULD_BUILD_STAGING FALSE)
 
58
else ()
 
59
    set(KEXI_SHOULD_BUILD_STAGING TRUE)
 
60
endif ()
 
61
 
 
62
# finally choose products/features to build
 
63
calligra_set_productset(${PRODUCTSET})
 
64
 
 
65
 ##########################
 
66
###########################
 
67
## Look for Qt, KF5 ##
 
68
###########################
 
69
##########################
 
70
 
 
71
set(REQUIRED_KF5_VERSION 5.16.0)
 
72
find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS
 
73
        Archive 
 
74
        Codecs 
 
75
        Completion
 
76
        Config 
 
77
        ConfigWidgets 
 
78
        CoreAddons
 
79
        GuiAddons 
 
80
        I18n 
 
81
        IconThemes 
 
82
        ItemViews
 
83
        KIO 
 
84
        TextEditor 
 
85
        TextWidgets 
 
86
        WidgetsAddons 
 
87
        XmlGui 
 
88
)
 
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")
 
94
 
 
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)
 
98
 
 
99
# use sane compile flags
 
100
add_definitions(
 
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
 
108
)
 
109
 
 
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)
 
115
 
 
116
# overcome some platform incompatibilities
 
117
if(WIN32)
 
118
    find_package(KDEWin REQUIRED)
 
119
endif()
 
120
 
 
121
# set custom Kexi plugin installdir
 
122
set(KEXI_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/kexi)
 
123
 
 
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)
 
128
#endif ()
 
129
 
 
130
 ###########################
 
131
############################
 
132
## Required dependencies  ##
 
133
############################
 
134
###########################
 
135
 
 
136
set(REQUIRED_KEXI_LIBS_VERSION 3.0)
 
137
set(MAXIMUM_KEXI_LIBS_VERSION 3.0.80) # .80 means < 3.1 Alpha
 
138
 
 
139
##
 
140
## Test for KDb
 
141
##
 
142
option(KEXI_DEBUG_GUI "Debugging GUI for Kexi (requires KDB_DEBUG_GUI to be set too)" OFF)
 
143
if(KEXI_DEBUG_GUI)
 
144
    set(KDB_REQUIRED_COMPONENTS DEBUG_GUI)
 
145
endif()
 
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})
 
150
 
 
151
##
 
152
## Test for KReport
 
153
##
 
154
find_package(KReport ${REQUIRED_KEXI_LIBS_VERSION} REQUIRED)
 
155
if (KReport_FOUND)
 
156
    if(NOT KREPORT_SCRIPTING)
 
157
        message(FATAL_ERROR "Kexi requires KReport package with scripting support enabled (KREPORT_SCRIPTING)")
 
158
    endif()
 
159
endif()
 
160
check_maximum_package_version(KReport ${MAXIMUM_KEXI_LIBS_VERSION})
 
161
 
 
162
##
 
163
## Test for KPropertyWidgets
 
164
##
 
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})
 
169
 
 
170
include(CheckIfQtGuiCanBeExecuted)
 
171
include(CheckGlobalBreezeIcons)
 
172
 
 
173
 ###########################
 
174
############################
 
175
## Optional dependencies  ##
 
176
############################
 
177
###########################
 
178
 
 
179
##
 
180
## Test for marble
 
181
##
 
182
set(MARBLE_MIN_VERSION "0.19.2")
 
183
find_package(KexiMarble)
 
184
if(NOT MARBLE_FOUND)
 
185
    set(MARBLE_INCLUDE_DIR "")
 
186
else()
 
187
    set(HAVE_MARBLE TRUE)
 
188
endif()
 
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")
 
190
 
 
191
if(WIN32)
 
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})
 
201
else()
 
202
    # On other OSes install own icons in app's data dir
 
203
    set(ICONS_INSTALL_DIR "${DATA_INSTALL_DIR}/${PROJECT_NAME_LOWER}/icons")
 
204
endif()
 
205
 
 
206
##
 
207
## Test for Qt WebKitWidgets
 
208
##
 
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")
 
212
 
 
213
 ##################
 
214
###################
 
215
## Helper macros ##
 
216
###################
 
217
##################
 
218
 
 
219
include(MacroCalligraAddBenchmark)
 
220
include(MacroCalligraAddTest)
 
221
 
 
222
#############################################
 
223
####      Temporarily broken products    ####
 
224
#############################################
 
225
 
 
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,
 
228
# e.g.:
 
229
# calligra_disable_product(APP_KEXI "isn't buildable at the moment")
 
230
 
 
231
#############################################
 
232
####     Calculate buildable products    ####
 
233
#############################################
 
234
 
 
235
calligra_drop_unbuildable_products()
 
236
 
 
237
 
 
238
#############################################
 
239
####     Setup product-depending vars    ####
 
240
#############################################
 
241
 
 
242
 ###################
 
243
####################
 
244
## Subdirectories ##
 
245
####################
 
246
###################
 
247
 
 
248
add_subdirectory(src)
 
249
 
 
250
if(SHOULD_BUILD_DOC)
 
251
    add_subdirectory(doc)
 
252
endif()
 
253
 
 
254
# non-app directories are moved here because they can depend on SHOULD_BUILD_{appname} variables set above
 
255
add_subdirectory(cmake)
 
256
 
 
257
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
 
258
    ki18n_install(po)
 
259
endif()
 
260
 
 
261
macro_display_feature_log()
 
262
 
 
263
calligra_product_deps_report("product_deps")
 
264
calligra_log_should_build()