Warning, /office/kexi/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
0002 find_package(ECM 1.8.0 REQUIRED NOMODULE)
0003 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
0004 include(SetKexiCMakePolicies NO_POLICY_SCOPE)
0005 include(SetKexiVersionInfo)
0006 
0007 project(Kexi VERSION ${PROJECT_VERSION})
0008 
0009 include(KexiAddTests)
0010 kexi_add_tests(OFF)
0011 
0012 # ECM
0013 include(ECMAddAppIcon)
0014 include(ECMAddTests)
0015 include(ECMGenerateHeaders)
0016 include(ECMInstallIcons)
0017 include(ECMMarkAsTest)
0018 include(ECMMarkNonGuiExecutable)
0019 include(ECMPoQmTools)
0020 include(ECMSetupVersion)
0021 include(KDEInstallDirs)
0022 include(KDECMakeSettings NO_POLICY_SCOPE)
0023 include(KDECompilerSettings NO_POLICY_SCOPE)
0024 
0025 # Own
0026 include(KexiMacros)
0027 include(KexiAddIconsRccFile)
0028 include(KexiGenerateDependencyGraph)
0029 
0030 ensure_out_of_source_build("Please refer to the build instruction https://community.kde.org/Kexi/Building")
0031 get_git_revision_and_branch()
0032 detect_release_build()
0033 
0034  #######################
0035 ########################
0036 ## Productset setting ##
0037 ########################
0038 #######################
0039 
0040 # For predefined productsets see the definitions in KexiProducts.cmake and
0041 # in the files in the folder cmake/productsets.
0042 
0043 # Finding out the products & features to build is done in 5 steps:
0044 # 1. have the user define the products/features wanted, by giving a productset
0045 # 2. estimate all additional required products/features
0046 # 3. estimate which of the products/features can be build by external deps
0047 # 4. find which products/features have been temporarily disabled due to problems
0048 # 5. estimate which of the products/features can be build by internal deps
0049 
0050 # get the special macros
0051 include(CalligraProductSetMacros)
0052 
0053 set(PRODUCTSET_DEFAULT "DESKTOP")
0054 
0055 if(NOT PRODUCTSET OR PRODUCTSET STREQUAL "ALL")
0056     # Force the default set also when it is "ALL" because we can't build both desktop and mobile
0057     set(PRODUCTSET ${PRODUCTSET_DEFAULT} CACHE STRING "Set of products/features to build" FORCE)
0058 endif()
0059 
0060 # get the definitions of products, features and product sets
0061 include(KexiProducts.cmake)
0062 
0063 if (RELEASE_BUILD)
0064     set(KEXI_SHOULD_BUILD_STAGING FALSE)
0065 else ()
0066     set(KEXI_SHOULD_BUILD_STAGING TRUE)
0067 endif ()
0068 
0069 # finally choose products/features to build
0070 calligra_set_productset(${PRODUCTSET})
0071 
0072  ##########################
0073 ###########################
0074 ## Look for Qt, KF5 ##
0075 ###########################
0076 ##########################
0077 
0078 set(REQUIRED_KF5_VERSION 5.16.0)
0079 set(REQUIRED_KF5_COMPONENTS
0080     Archive
0081     Codecs
0082     Config
0083     ConfigWidgets
0084     CoreAddons
0085     GuiAddons
0086     I18n
0087     IconThemes
0088     ItemViews
0089     WidgetsAddons
0090     TextWidgets
0091     XmlGui
0092 )
0093 if(SHOULD_BUILD_KEXI_DESKTOP_APP)
0094     list(APPEND REQUIRED_KF5_COMPONENTS
0095         Completion
0096         KIO
0097         TextEditor
0098         TextWidgets
0099     )
0100 endif()
0101 find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS ${REQUIRED_KF5_COMPONENTS})
0102 
0103 find_package(KF5 ${REQUIRED_KF5_VERSION} COMPONENTS Crash)
0104 macro_bool_to_01(KF5Crash_FOUND HAVE_KCRASH)
0105 set_package_properties(KF5Crash PROPERTIES TYPE OPTIONAL
0106                        PURPOSE "Used to provide crash reporting on Linux")
0107 
0108 set(REQUIRED_QT_VERSION 5.4.0)
0109 find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets Xml Network PrintSupport Test)
0110 find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS UiTools WebKit WebKitWidgets)
0111 
0112 # use sane compile flags
0113 add_definitions(
0114   -DQT_NO_CAST_TO_ASCII
0115   -DQT_NO_SIGNALS_SLOTS_KEYWORDS
0116   -DQT_NO_URL_CAST_FROM_STRING
0117   -DQT_STRICT_ITERATORS
0118   -DQT_USE_QSTRINGBUILDER
0119 )
0120 
0121 # set custom KEXI plugin installdir
0122 set(KEXI_PLUGIN_INSTALL_DIR ${KDE_INSTALL_PLUGINDIR}/${KEXI_BASE_PATH})
0123 
0124 simple_option(BUILD_EXAMPLES "Build and install examples" ON)
0125 
0126 macro_bool_to_01(BUILD_EXAMPLES COMPILING_EXAMPLES)
0127 
0128 # set custom KEXI examples installdir
0129 set(KEXI_EXAMPLES_INSTALL_DIR ${KDE_INSTALL_DATAROOTDIR}/${KEXI_BASE_PATH}/examples)
0130 
0131 # TEMPORARY: for initial Qt5/KF5 build porting phase deprecation warnings are only annoying noise
0132 # remove once code porting phase starts, perhaps first locally in product subdirs
0133 #if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
0134 #    add_definitions(-Wno-deprecated -Wno-deprecated-declarations)
0135 #endif ()
0136 
0137  ###########################
0138 ############################
0139 ## Required dependencies  ##
0140 ############################
0141 ###########################
0142 
0143 set(KEXI_FRAMEWORKS_MIN_VERSION ${PROJECT_VERSION})
0144 
0145 ##
0146 ## Test for KDb
0147 ##
0148 simple_option(KEXI_DEBUG_GUI "Debugging GUI for Kexi (requires KDB_DEBUG_GUI to be set too)" OFF)
0149 if(KEXI_DEBUG_GUI)
0150     set(KDB_REQUIRED_COMPONENTS DEBUG_GUI)
0151 endif()
0152 find_package(KDb ${KEXI_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS ${KDB_REQUIRED_COMPONENTS})
0153 set_package_properties(KDb PROPERTIES TYPE REQUIRED
0154                        PURPOSE "Required by Kexi for data handling")
0155 
0156 ##
0157 ## Test for KReport
0158 ##
0159 find_package(KReport ${KEXI_FRAMEWORKS_MIN_VERSION})
0160 set_package_properties(KReport PROPERTIES TYPE REQUIRED
0161                        PURPOSE "Required by Kexi for report handling")
0162 if (KReport_FOUND)
0163     if(NOT KREPORT_SCRIPTING)
0164         message(FATAL_ERROR "Kexi requires KReport package with scripting support enabled (KREPORT_SCRIPTING)")
0165     endif()
0166 endif()
0167 
0168 ##
0169 ## Test for KPropertyWidgets
0170 ##
0171 if(SHOULD_BUILD_KEXI_DESKTOP_APP)
0172     find_package(KPropertyWidgets ${KEXI_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS KF)
0173     set_package_properties(KPropertyWidgets PROPERTIES TYPE REQUIRED
0174                            PURPOSE "Required by Kexi for handling properties")
0175 else() # only KPropertyCore
0176     find_package(KPropertyCore ${KEXI_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS KF)
0177     set_package_properties(KPropertyCore PROPERTIES TYPE REQUIRED
0178                            PURPOSE "Required by Kexi for handling properties")
0179 endif()
0180 include(CheckIfQtGuiCanBeExecuted)
0181 
0182 if(SHOULD_BUILD_KEXI_DESKTOP_APP)
0183 include(CheckGlobalBreezeIcons)
0184 endif()
0185  ###########################
0186 ############################
0187 ## Optional dependencies  ##
0188 ############################
0189 ###########################
0190 
0191 ##
0192 ## Test for marble
0193 ##
0194 set(MARBLE_MIN_VERSION "0.19.2")
0195 find_package(Marble ${MARBLE_MIN_VERSION} CONFIG)
0196 set_package_properties(Marble PROPERTIES
0197     DESCRIPTION "KDE World Globe Widget library"
0198     URL "https://marble.kde.org"
0199     TYPE RECOMMENDED
0200     PURPOSE "Required by Kexi form map widget"
0201 )
0202 if(Marble_FOUND)
0203     set(HAVE_MARBLE TRUE)
0204 endif()
0205 set_package_properties(GLIB2 PROPERTIES TYPE RECOMMENDED PURPOSE "${_REQUIRED_BY_MDB}")
0206 
0207 ##
0208 ## Test for Qt WebKitWidgets
0209 ##
0210 #TODO switch to Qt WebEngine
0211 macro_bool_to_01(Qt5WebKitWidgets_FOUND HAVE_QTWEBKITWIDGETS)
0212 set_package_properties(Qt5WebKit PROPERTIES
0213                        DESCRIPTION "Webkit for Qt, the HTML engine."
0214                        URL "https://qt.io"
0215                        TYPE RECOMMENDED PURPOSE "Required by Kexi web form widget"
0216 )
0217 set_package_properties(Qt5WebKitWidgets PROPERTIES
0218                        DESCRIPTION "QWidgets module for Webkit, the HTML engine."
0219                        URL "https://qt.io"
0220                        TYPE RECOMMENDED PURPOSE "Required by Kexi web form widget"
0221 )
0222 
0223  ##################
0224 ###################
0225 ## Helper macros ##
0226 ###################
0227 ##################
0228 
0229 include(MacroKexiAddBenchmark)
0230 include(MacroKexiAddTest)
0231 
0232 #############################################
0233 ####      Temporarily broken products    ####
0234 #############################################
0235 
0236 # If a product does not build due to some temporary brokeness disable it here,
0237 # by calling calligra_disable_product with the product id and the reason,
0238 # e.g.:
0239 # calligra_disable_product(APP_KEXI "isn't buildable at the moment")
0240 
0241 #############################################
0242 ####     Calculate buildable products    ####
0243 #############################################
0244 
0245 calligra_drop_unbuildable_products()
0246 
0247 
0248 #############################################
0249 ####     Setup product-depending vars    ####
0250 #############################################
0251 
0252  ###################
0253 ####################
0254 ## Subdirectories ##
0255 ####################
0256 ###################
0257 
0258 add_subdirectory(src)
0259 
0260 if(SHOULD_BUILD_DOC)
0261     find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS DocTools)
0262     add_subdirectory(doc)
0263     kdoctools_install(po)
0264 endif()
0265 
0266 # non-app directories are moved here because they can depend on SHOULD_BUILD_{appname} variables set above
0267 add_subdirectory(cmake)
0268 
0269 if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
0270     ki18n_install(po)
0271 endif()
0272 
0273 calligra_product_deps_report("product_deps")
0274 calligra_log_should_build()
0275 
0276 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)