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

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