Warning, /office/calligra/cmake/modules/CalligraProductSetMacros.cmake is written in an unsupported language. File is not indexed.
0001 # Copyright (c) 2013-2014 Friedrich W. H. Kossebau <kossebau@kde.org> 0002 # 0003 # Redistribution and use is allowed according to the terms of the BSD license. 0004 # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 0005 0006 # Global variables 0007 # CALLIGRA_SHOULD_BUILD_PRODUCTS - list of requested products by the user 0008 # CALLIGRA_NEEDED_PRODUCTS - list of internal needed products 0009 # CALLIGRA_WANTED_PRODUCTS - list of internal wanted products 0010 # CALLIGRA_STAGING_PRODUCTS - list of products only in staging mode 0011 # CALLIGRA_UNMAINTAINED_PRODUCTS - list of products basically working but without maintainer 0012 # temporary during qt5 port, remove after: 0013 # CALLIGRA_UNPORTED_PRODUCTS - list of products not yet ported 0014 # SHOULD_BUILD_${product_id} - boolean if product should be build 0015 0016 0017 macro(calligra_disable_product _product_id _reason) 0018 if (NOT DEFINED SHOULD_BUILD_${_product_id}) 0019 message(FATAL_ERROR "Unknown product: ${_product_id}") 0020 endif (NOT DEFINED SHOULD_BUILD_${_product_id}) 0021 0022 set(SHOULD_BUILD_${_product_id} FALSE) 0023 if (DEFINED BUILD_${_product_id}_DISABLE_REASON) 0024 set(BUILD_${_product_id}_DISABLE_REASON "${BUILD_${_product_id}_DISABLE_REASON} / ") 0025 endif (DEFINED BUILD_${_product_id}_DISABLE_REASON) 0026 set(BUILD_${_product_id}_DISABLE_REASON "${BUILD_${_product_id}_DISABLE_REASON}${_reason}") 0027 endmacro() 0028 0029 # Usage: 0030 # calligra_drop_product_on_bad_condition(<product_id> 0031 # NAME_OF_BOOL_VAR1 REASON_TEXT_FOR_DROPPING_ON_FALSE1 0032 # NAME_OF_BOOL_VAR2 REASON_TEXT_FOR_DROPPING_ON_FALSE2 0033 # ... 0034 # ) 0035 macro(calligra_drop_product_on_bad_condition _product_id) 0036 if (NOT DEFINED SHOULD_BUILD_${_product_id}) 0037 message(FATAL_ERROR "Unknown product: ${_product_id}") 0038 endif (NOT DEFINED SHOULD_BUILD_${_product_id}) 0039 0040 set(_current_flag) 0041 foreach(_arg ${ARGN}) 0042 if(DEFINED _current_flag) 0043 if(NOT ${_current_flag}) 0044 calligra_disable_product(${_product_id} ${_arg}) 0045 endif() 0046 set(_current_flag) 0047 else() 0048 set(_current_flag ${_arg}) 0049 endif() 0050 endforeach(_arg) 0051 if(DEFINED _current_flag) 0052 message(FATAL_ERROR "Bad number of arguments for calligra_drop_product_on_bad_condition(${_product_id} ...)") 0053 endif() 0054 endmacro() 0055 0056 macro(calligra_set_shouldbuild_dependentproduct _product_id _dep_product_id) 0057 # if not already enabled, enable 0058 if (NOT SHOULD_BUILD_${_dep_product_id}) 0059 list(APPEND CALLIGRA_NEEDED_PRODUCTS ${_dep_product_id}) 0060 set(SHOULD_BUILD_${_dep_product_id} TRUE) 0061 if (DEFINED CALLIGRA_PRODUCT_${_dep_product_id}_needed_dependencies OR 0062 DEFINED CALLIGRA_PRODUCT_${_dep_product_id}_wanted_dependencies) 0063 calligra_set_shouldbuild_productdependencies(${_dep_product_id} 0064 "${CALLIGRA_PRODUCT_${_dep_product_id}_needed_dependencies}" 0065 "${CALLIGRA_PRODUCT_${_dep_product_id}_wanted_dependencies}") 0066 endif (DEFINED CALLIGRA_PRODUCT_${_dep_product_id}_needed_dependencies OR 0067 DEFINED CALLIGRA_PRODUCT_${_dep_product_id}_wanted_dependencies) 0068 endif (NOT SHOULD_BUILD_${_dep_product_id}) 0069 endmacro() 0070 0071 0072 macro(calligra_set_shouldbuild_productdependencies _product_id _productset_id_needed_dependencies _productset_id_wanted_dependencies) 0073 # activate all needed products and note the dependency 0074 foreach(_dep_product_id ${_productset_id_needed_dependencies}) 0075 list(APPEND CALLIGRA_PRODUCT_${_dep_product_id}_dependents ${_product_id}) 0076 calligra_set_shouldbuild_dependentproduct(${_product_id} ${_dep_product_id}) 0077 endforeach(_dep_product_id) 0078 0079 # activate all wanted products 0080 foreach(_dep_product_id ${_productset_id_wanted_dependencies}) 0081 calligra_set_shouldbuild_dependentproduct(${_product_id} ${_dep_product_id}) 0082 endforeach(_dep_product_id) 0083 endmacro() 0084 0085 0086 macro(calligra_drop_unbuildable_products) 0087 # temporary during qt5 port, remove after 0088 if(NOT BUILD_UNPORTED) 0089 foreach(_product_id ${CALLIGRA_UNPORTED_PRODUCTS}) 0090 calligra_disable_product(${_product_id} "Not yet ported to Qt5/KF5") 0091 endforeach(_product_id) 0092 endif(NOT BUILD_UNPORTED) 0093 0094 # first drop all staging products if not enabled 0095 if(NOT CALLIGRA_SHOULD_BUILD_STAGING) 0096 foreach(_product_id ${CALLIGRA_STAGING_PRODUCTS}) 0097 calligra_disable_product(${_product_id} "Not ready for release") 0098 endforeach(_product_id) 0099 endif(NOT CALLIGRA_SHOULD_BUILD_STAGING) 0100 0101 # drop all unmaintainted products if not enabled 0102 if(NOT CALLIGRA_SHOULD_BUILD_UNMAINTAINED) 0103 foreach(_product_id ${CALLIGRA_UNMAINTAINED_PRODUCTS}) 0104 calligra_disable_product(${_product_id} "No maintainer currently") 0105 endforeach(_product_id) 0106 endif() 0107 0108 # can assume calligra_all_products has products in down-up order 0109 # 1. check all wanted products and see if they will be built, 0110 # if not then drop their required products 0111 # TODO! 0112 # 2. check all products if they can be built, if not disable build of depending 0113 foreach(_product_id ${CALLIGRA_ALL_PRODUCTS}) 0114 if(NOT SHOULD_BUILD_${_product_id}) 0115 if(DEFINED CALLIGRA_PRODUCT_${_product_id}_dependents) 0116 foreach(_dependent_product_id ${CALLIGRA_PRODUCT_${_product_id}_dependents}) 0117 calligra_disable_product(${_dependent_product_id} "Required internal dependency missing: ${_product_id}") 0118 endforeach(_dependent_product_id ${CALLIGRA_PRODUCT_${_dep_product_id}_dependents}) 0119 endif(DEFINED CALLIGRA_PRODUCT_${_product_id}_dependents) 0120 endif(NOT SHOULD_BUILD_${_product_id}) 0121 endforeach(_product_id) 0122 endmacro() 0123 0124 # backward compatibility: BUILD_app as option or passed as cmake parameter can overwrite product set 0125 # and disable a product if set to FALSE (TRUE was ignored) 0126 macro(calligra_drop_products_on_old_flag _build_id) 0127 string(TOLOWER "${_build_id}" lowercase_build_id) 0128 if (DEFINED BUILD_${lowercase_build_id} AND NOT BUILD_${lowercase_build_id}) 0129 foreach(_product_id ${ARGN}) 0130 if (NOT DEFINED SHOULD_BUILD_${_product_id}) 0131 message(FATAL_ERROR "Unknown product: ${_product_id}") 0132 endif (NOT DEFINED SHOULD_BUILD_${_product_id}) 0133 calligra_disable_product(${_product_id} "Disabled by cmake parameter") 0134 endforeach(_product_id) 0135 endif (DEFINED BUILD_${lowercase_build_id} AND NOT BUILD_${lowercase_build_id}) 0136 endmacro() 0137 0138 macro(calligra_set_productset _productset_string) 0139 set(CALLIGRA_SHOULD_BUILD_PRODUCTS "") 0140 # turn into list, _productset_string is not yet one 0141 set(_productset_ids ${_productset_string}) 0142 separate_arguments(_productset_ids) 0143 set(_productset_list "") 0144 # _product_id could be a product, feature or product set (predefined or from file) 0145 foreach(_product_id ${_productset_ids}) 0146 # be gracefull and compare the productset id case insensitive 0147 string(TOUPPER "${_product_id}" _uppercase_product_id) 0148 0149 if(_uppercase_product_id STREQUAL "ALL") 0150 list( APPEND CALLIGRA_SHOULD_BUILD_PRODUCTS ${CALLIGRA_ALL_PRODUCTS}) 0151 elseif(DEFINED SHOULD_BUILD_${_uppercase_product_id}) 0152 list( APPEND CALLIGRA_SHOULD_BUILD_PRODUCTS ${_uppercase_product_id}) 0153 else() 0154 # also expects a productset definition filename in all lowercase 0155 string(TOLOWER "${_product_id}" _lowercase_productset_id) 0156 set(_productset_filename "${CMAKE_SOURCE_DIR}/cmake/productsets/${_lowercase_productset_id}.cmake") 0157 0158 if (NOT EXISTS "${_productset_filename}") 0159 message(FATAL_ERROR "Unknown product, feature or product set: ${_product_id}") 0160 endif (NOT EXISTS "${_productset_filename}") 0161 0162 # include the productset definition 0163 include(${_productset_filename}) 0164 if(NOT CALLIGRA_PRODUCTSET_${_uppercase_product_id}) 0165 message(FATAL_ERROR "Product set file \"${_productset_filename}\" did not define a productset named \"${_uppercase_product_id}\".") 0166 endif() 0167 0168 list( APPEND CALLIGRA_SHOULD_BUILD_PRODUCTS ${_uppercase_product_id}) 0169 endif() 0170 list( APPEND _productset_list ${_uppercase_product_id}) 0171 endforeach(_product_id) 0172 0173 string(REPLACE ";" " " _productset_list "${_productset_list}") 0174 set(CALLIGRA_NEEDED_PRODUCTS "") 0175 0176 message(STATUS "-------------------------------------------------------------------" ) 0177 message(STATUS "Configured with product set \"${_productset_list}\"") 0178 message(STATUS "-------------------------------------------------------------------" ) 0179 0180 # backward compatibility: BUILD_app as option or passed as cmake parameter can overwrite product set 0181 # and disable a product if set to FALSE (TRUE was ignored) 0182 foreach(_product_id ${CALLIGRA_ALL_PRODUCTS}) 0183 string(TOLOWER "${_product_id}" lowercase_product_id) 0184 if (DEFINED BUILD_${lowercase_product_id}) 0185 if(NOT BUILD_${lowercase_product_id}) 0186 list(FIND CALLIGRA_SHOULD_BUILD_PRODUCTS ${_product_id} _index) 0187 # remove from product set, if part 0188 if(NOT _index EQUAL -1) 0189 list(REMOVE_AT CALLIGRA_SHOULD_BUILD_PRODUCTS ${_index}) 0190 endif(NOT _index EQUAL -1) 0191 endif(NOT BUILD_${lowercase_product_id}) 0192 endif (DEFINED BUILD_${lowercase_product_id}) 0193 endforeach(_product_id ${CALLIGRA_ALL_PRODUCTS}) 0194 0195 # mark all products of the set as SHOULD_BUILD 0196 foreach(_product_id ${CALLIGRA_SHOULD_BUILD_PRODUCTS}) 0197 # check that this product is actually existing 0198 if (NOT DEFINED SHOULD_BUILD_${_product_id}) 0199 message(FATAL_ERROR "Unknown product: ${_product_id}") 0200 endif (NOT DEFINED SHOULD_BUILD_${_product_id}) 0201 0202 # mark product as should build, also all dependencies 0203 set(SHOULD_BUILD_${_product_id} TRUE) 0204 if (DEFINED CALLIGRA_PRODUCT_${_product_id}_needed_dependencies OR 0205 DEFINED CALLIGRA_PRODUCT_${_product_id}_wanted_dependencies) 0206 calligra_set_shouldbuild_productdependencies(${_product_id} 0207 "${CALLIGRA_PRODUCT_${_product_id}_needed_dependencies}" 0208 "${CALLIGRA_PRODUCT_${_product_id}_wanted_dependencies}") 0209 endif (DEFINED CALLIGRA_PRODUCT_${_product_id}_needed_dependencies OR 0210 DEFINED CALLIGRA_PRODUCT_${_product_id}_wanted_dependencies) 0211 endforeach(_product_id) 0212 endmacro() 0213 0214 0215 # Usage: 0216 # calligra_define_product(<product_id> 0217 # [NAME] <product_name> 0218 # [UNMAINTAINED] 0219 # [STAGING] 0220 # [UNPORTED] 0221 # [REQUIRES <product_id1> <feature_id1> ...] 0222 # ) 0223 macro(calligra_define_product _product_id) 0224 # default product name to id, empty deps 0225 set(_product_name "${_product_id}") 0226 set(_needed_dep_product_ids) 0227 0228 if(DEFINED SHOULD_BUILD_${_product_id}) 0229 message(FATAL_ERROR "Product \"${_product_id}\" already defined, as \"${CALLIGRA_PRODUCT_${_product_id}_name}\".") 0230 endif(DEFINED SHOULD_BUILD_${_product_id}) 0231 0232 # parse arguments: two states, "name" or "requires" 0233 set(_current_arg_type "name") 0234 foreach(_arg ${ARGN}) 0235 if(${_arg} STREQUAL "NAME") 0236 set(_current_arg_type "name") 0237 elseif(${_arg} STREQUAL "REQUIRES") 0238 set(_current_arg_type "requires") 0239 else(${_arg} STREQUAL "NAME") 0240 if(${_current_arg_type} STREQUAL "name") 0241 if(${_arg} STREQUAL "STAGING") 0242 list(APPEND CALLIGRA_STAGING_PRODUCTS ${_product_id}) 0243 elseif(${_arg} STREQUAL "UNMAINTAINED") 0244 list(APPEND CALLIGRA_UNMAINTAINED_PRODUCTS ${_product_id}) 0245 elseif(${_arg} STREQUAL "UNPORTED") 0246 # temporary during qt5 port, remove after 0247 list(APPEND CALLIGRA_UNPORTED_PRODUCTS ${_product_id}) 0248 else(${_arg} STREQUAL "STAGING") 0249 set(_product_name "${_arg}") 0250 endif(${_arg} STREQUAL "STAGING") 0251 elseif(${_current_arg_type} STREQUAL "requires") 0252 # check that the dependency is actually existing 0253 if(NOT DEFINED SHOULD_BUILD_${_arg}) 0254 message(FATAL_ERROR "Unknown product/feature listed as dependency for \"${_product_id}\": \"${_arg}\"") 0255 elseif(CALLIGRA_PRODUCTSET_${_arg}) 0256 message(FATAL_ERROR "Productset cannot be a dependency for \"${_product_id}\": \"${_arg}\"") 0257 endif() 0258 list(APPEND _needed_dep_product_ids "${_arg}") 0259 endif(${_current_arg_type} STREQUAL "name") 0260 endif(${_arg} STREQUAL "NAME") 0261 endforeach(_arg) 0262 0263 # set product vars 0264 set(SHOULD_BUILD_${_product_id} FALSE) 0265 set(CALLIGRA_PRODUCT_${_product_id}_name "${_product_name}") 0266 set(CALLIGRA_PRODUCT_${_product_id}_needed_dependencies ${_needed_dep_product_ids}) 0267 list(APPEND CALLIGRA_ALL_PRODUCTS ${_product_id}) 0268 endmacro(calligra_define_product) 0269 0270 0271 # Usage: 0272 # calligra_define_feature(<feature_id> 0273 # [NAME] <feature_name> 0274 # [UNMAINTAINED] 0275 # [STAGING] 0276 # [UNPORTED] 0277 # [REQUIRES <product_id1> <feature_id1> ...] 0278 # ) 0279 macro(calligra_define_feature _product_id) 0280 # default product name to id, empty deps 0281 set(_product_name "${_product_id}") 0282 set(_needed_dep_product_ids) 0283 0284 if(DEFINED SHOULD_BUILD_${_product_id}) 0285 message(FATAL_ERROR "Feature \"${_product_id}\" already defined, as \"${CALLIGRA_PRODUCT_${_product_id}_name}\".") 0286 endif(DEFINED SHOULD_BUILD_${_product_id}) 0287 0288 # parse arguments: two states, "name" or "requires" 0289 set(_current_arg_type "name") 0290 foreach(_arg ${ARGN}) 0291 if(${_arg} STREQUAL "NAME") 0292 set(_current_arg_type "name") 0293 elseif(${_arg} STREQUAL "REQUIRES") 0294 set(_current_arg_type "requires") 0295 else(${_arg} STREQUAL "NAME") 0296 if(${_current_arg_type} STREQUAL "name") 0297 if(${_arg} STREQUAL "STAGING") 0298 list(APPEND CALLIGRA_STAGING_PRODUCTS ${_product_id}) 0299 elseif(${_arg} STREQUAL "UNMAINTAINED") 0300 list(APPEND CALLIGRA_UNMAINTAINED_PRODUCTS ${_product_id}) 0301 elseif(${_arg} STREQUAL "UNPORTED") 0302 # temporary during qt5 port, remove after 0303 list(APPEND CALLIGRA_UNPORTED_PRODUCTS ${_product_id}) 0304 else(${_arg} STREQUAL "STAGING") 0305 set(_product_name "${_arg}") 0306 endif(${_arg} STREQUAL "STAGING") 0307 elseif(${_current_arg_type} STREQUAL "requires") 0308 # check that the dependency is actually existing 0309 if(NOT DEFINED SHOULD_BUILD_${_arg}) 0310 message(FATAL_ERROR "Unknown product/feature listed as dependency for \"${_product_id}\": \"${_arg}\"") 0311 elseif(CALLIGRA_PRODUCTSET_${_arg}) 0312 message(FATAL_ERROR "Productset cannot be a dependency for \"${_product_id}\": \"${_arg}\"") 0313 endif() 0314 list(APPEND _needed_dep_product_ids "${_arg}") 0315 endif(${_current_arg_type} STREQUAL "name") 0316 endif(${_arg} STREQUAL "NAME") 0317 endforeach(_arg) 0318 0319 # set product vars 0320 set(SHOULD_BUILD_${_product_id} FALSE) 0321 set(CALLIGRA_PRODUCT_${_product_id}_name "${_product_name}") 0322 set(CALLIGRA_PRODUCT_${_product_id}_needed_dependencies ${_needed_dep_product_ids}) 0323 list(APPEND CALLIGRA_ALL_PRODUCTS ${_product_id}) 0324 endmacro(calligra_define_feature) 0325 0326 0327 # Usage: 0328 # calligra_define_productset(<productset_id> 0329 # [NAME] <productset_name> 0330 # [REQUIRES <product_id1> ... <productset_id1> ...] 0331 # [OPTIONAL <product_id2> ... <productset_id2> ...] 0332 # ) 0333 macro(calligra_define_productset _product_id) 0334 # default product name to id, empty deps 0335 set(_product_name "${_product_id}") 0336 set(_needed_dep_product_ids) 0337 set(_wanted_dep_product_ids) 0338 0339 if(DEFINED SHOULD_BUILD_${_product_id}) 0340 message(FATAL_ERROR "Productset \"${_product_id}\" already defined, as \"${CALLIGRA_PRODUCT_${_product_id}_name}\".") 0341 endif(DEFINED SHOULD_BUILD_${_product_id}) 0342 0343 # parse arguments: three states, "name", "requires" or "optional" 0344 set(_current_arg_type "name") 0345 foreach(_arg ${ARGN}) 0346 if(${_arg} STREQUAL "NAME") 0347 set(_current_arg_type "name") 0348 elseif(${_arg} STREQUAL "REQUIRES") 0349 set(_current_arg_type "requires") 0350 elseif(${_arg} STREQUAL "OPTIONAL") 0351 set(_current_arg_type "optional") 0352 else(${_arg} STREQUAL "NAME") 0353 if(${_current_arg_type} STREQUAL "name") 0354 set(_product_name "${_arg}") 0355 elseif(${_current_arg_type} STREQUAL "requires") 0356 # check that the dependency is actually existing 0357 if(NOT DEFINED SHOULD_BUILD_${_arg}) 0358 message(FATAL_ERROR "Unknown product(set)/feature listed as dependency for \"${_product_id}\": \"${_arg}\"") 0359 endif(NOT DEFINED SHOULD_BUILD_${_arg}) 0360 list(APPEND _needed_dep_product_ids "${_arg}") 0361 elseif(${_current_arg_type} STREQUAL "optional") 0362 # check that the dependency is actually existing 0363 if(NOT DEFINED SHOULD_BUILD_${_arg}) 0364 message(FATAL_ERROR "Unknown product(set)/feature listed as dependency for \"${_product_id}\": \"${_arg}\"") 0365 endif(NOT DEFINED SHOULD_BUILD_${_arg}) 0366 list(APPEND _wanted_dep_product_ids "${_arg}") 0367 endif(${_current_arg_type} STREQUAL "name") 0368 endif(${_arg} STREQUAL "NAME") 0369 endforeach(_arg) 0370 0371 # set product(set) vars 0372 set(SHOULD_BUILD_${_product_id} FALSE) 0373 set(CALLIGRA_PRODUCT_${_product_id}_name "${_product_name}") 0374 set(CALLIGRA_PRODUCTSET_${_product_id} TRUE) 0375 set(CALLIGRA_PRODUCT_${_product_id}_needed_dependencies ${_needed_dep_product_ids}) 0376 set(CALLIGRA_PRODUCT_${_product_id}_wanted_dependencies ${_wanted_dep_product_ids}) 0377 list(APPEND CALLIGRA_ALL_PRODUCTS ${_product_id}) 0378 endmacro(calligra_define_productset) 0379 0380 0381 macro(calligra_log_should_build) 0382 # find what products will be built and which not 0383 set(_built_product_ids "") 0384 set(_not_built_product_ids "") 0385 set(_built_dependency_product_ids "") 0386 set(_not_built_dependency_product_ids "") 0387 0388 foreach(_product_id ${CALLIGRA_ALL_PRODUCTS}) 0389 list(FIND CALLIGRA_SHOULD_BUILD_PRODUCTS ${_product_id} _index) 0390 if(NOT _index EQUAL -1) 0391 if(SHOULD_BUILD_${_product_id}) 0392 list(APPEND _built_product_ids ${_product_id}) 0393 else(SHOULD_BUILD_${_product_id}) 0394 list(APPEND _not_built_product_ids ${_product_id}) 0395 endif(SHOULD_BUILD_${_product_id}) 0396 else(NOT _index EQUAL -1) 0397 if(SHOULD_BUILD_${_product_id}) 0398 list(APPEND _built_dependency_product_ids ${_product_id}) 0399 else(SHOULD_BUILD_${_product_id}) 0400 list(FIND CALLIGRA_NEEDED_PRODUCTS ${_product_id} _index2) 0401 if(NOT _index2 EQUAL -1) 0402 list(APPEND _not_built_dependency_product_ids ${_product_id}) 0403 endif(NOT _index2 EQUAL -1) 0404 endif(SHOULD_BUILD_${_product_id}) 0405 endif(NOT _index EQUAL -1) 0406 endforeach(_product_id) 0407 0408 if(NOT _built_dependency_product_ids STREQUAL "") 0409 message(STATUS "------ The following required product(set)s/features will be built -------") 0410 foreach(_product_id ${_built_dependency_product_ids}) 0411 if (DEFINED CALLIGRA_PRODUCT_${_product_id}_dependents) 0412 set(dependents " [[needed by: ${CALLIGRA_PRODUCT_${_product_id}_dependents}]]") 0413 else (DEFINED CALLIGRA_PRODUCT_${_product_id}_dependents) 0414 set(dependents "") 0415 endif (DEFINED CALLIGRA_PRODUCT_${_product_id}_dependents) 0416 0417 message(STATUS "${_product_id}: ${CALLIGRA_PRODUCT_${_product_id}_name}${dependents}" ) 0418 endforeach(_product_id) 0419 message(STATUS "") 0420 endif(NOT _built_dependency_product_ids STREQUAL "") 0421 if(NOT _not_built_dependency_product_ids STREQUAL "") 0422 message(STATUS "---- The following required product(set)s/features can NOT be built ------") 0423 foreach(_product_id ${_not_built_dependency_product_ids}) 0424 if (DEFINED CALLIGRA_PRODUCT_${_product_id}_dependents) 0425 set(dependents " [[needed by: ${CALLIGRA_PRODUCT_${_product_id}_dependents}]]") 0426 else (DEFINED CALLIGRA_PRODUCT_${_product_id}_dependents) 0427 set(dependents "") 0428 endif (DEFINED CALLIGRA_PRODUCT_${_product_id}_dependents) 0429 0430 message(STATUS "${_product_id}: ${CALLIGRA_PRODUCT_${_product_id}_name}${dependents} | ${BUILD_${_product_id}_DISABLE_REASON}" ) 0431 endforeach(_product_id) 0432 message(STATUS "") 0433 endif(NOT _not_built_dependency_product_ids STREQUAL "") 0434 message(STATUS "------ The following product(set)s/features will be built ---------") 0435 foreach(_product_id ${_built_product_ids}) 0436 message(STATUS "${_product_id}: ${CALLIGRA_PRODUCT_${_product_id}_name}" ) 0437 endforeach(_product_id) 0438 if(NOT _not_built_product_ids STREQUAL "") 0439 message(STATUS "\n------ The following product(set)s/features can NOT be built ------") 0440 foreach(_product_id ${_not_built_product_ids}) 0441 message(STATUS "${_product_id}: ${CALLIGRA_PRODUCT_${_product_id}_name} | ${BUILD_${_product_id}_DISABLE_REASON}" ) 0442 endforeach(_product_id) 0443 endif(NOT _not_built_product_ids STREQUAL "") 0444 message(STATUS "-------------------------------------------------------------------" ) 0445 endmacro(calligra_log_should_build) 0446 0447 0448 macro(calligra_product_deps_report_stylebybuild _output _product_id) 0449 if(SHOULD_BUILD_${_product_id}) 0450 set(${_output} "filled") 0451 else() 0452 set(${_output} "solid") 0453 endif() 0454 endmacro(calligra_product_deps_report_stylebybuild) 0455 0456 # Usage: 0457 # calligra_product_deps_report(<filename_without_extension>) 0458 macro(calligra_product_deps_report _filename) 0459 set(_dot "${_dot}# This is a graphviz file. It shows the internal product dependencies of Calligra.\n") 0460 set(_dot "${_dot}# dot -Tsvg ${_filename}.dot > ${_filename}.svg\n") 0461 set(_dot "${_dot}# dot -Tpng ${_filename}.dot > ${_filename}.png\n") 0462 set(_dot "${_dot}digraph calligra {\n") 0463 set(_dot "${_dot}node [colorscheme=set312]\;\n") # pastel19, set312 or accent8 0464 set(_dot "${_dot}rankdir=LR\;\n") 0465 0466 foreach(_product_id ${CALLIGRA_ALL_PRODUCTS}) 0467 set(_color 11) 0468 set(_shape "box") 0469 set(_style "") 0470 0471 if(CALLIGRA_PRODUCTSET_${_product_id}) 0472 set(_color 1) 0473 set(_shape "folder") 0474 elseif(_product_id MATCHES "^LIB_") 0475 set(_color 2) 0476 set(_shape "box") 0477 elseif(_product_id MATCHES "^FILTER_") 0478 set(_color 3) 0479 set(_shape "component") 0480 elseif(_product_id MATCHES "^PLUGIN_") 0481 set(_color 4) 0482 set(_shape "component") 0483 elseif(_product_id MATCHES "^PART_") 0484 set(_color 5) 0485 set(_shape "component") 0486 elseif(_product_id MATCHES "^APP_") 0487 set(_color 6) 0488 set(_shape "box") 0489 set(_style "rounded,") 0490 elseif(_product_id MATCHES "^BUILDUTIL_") 0491 set(_color 7) 0492 set(_shape "diamond") 0493 set(_style "rounded,") 0494 elseif(_product_id MATCHES "^FEATURE_") 0495 set(_color 8) 0496 elseif(_product_id MATCHES "^OKULAR_") 0497 set(_color 9) 0498 set(_shape "component") 0499 elseif(_product_id MATCHES "^FILEMANAGER_") 0500 set(_color 10) 0501 set(_shape "box") 0502 endif() 0503 0504 calligra_product_deps_report_stylebybuild(_stylebybuild ${_product_id}) 0505 0506 set(_dot "${_dot}\"${_product_id}\" [fillcolor=${_color}, shape=${_shape}, style=\"${_style}${_stylebybuild}\"];\n") 0507 0508 foreach(_dependent_product_id ${CALLIGRA_PRODUCT_${_product_id}_needed_dependencies}) 0509 set(_edges "${_edges}\"${_product_id}\" -> \"${_dependent_product_id}\"\;\n") 0510 endforeach(_dependent_product_id) 0511 foreach(_dependent_product_id ${CALLIGRA_PRODUCT_${_product_id}_wanted_dependencies}) 0512 set(_edges "${_edges}\"${_product_id}\" -> \"${_dependent_product_id}\" [style=dashed]\;\n") 0513 endforeach(_dependent_product_id) 0514 endforeach(_product_id) 0515 0516 set(_dot "${_dot}${_edges}") 0517 set(_dot "${_dot}}\n") 0518 file(WRITE ${CMAKE_BINARY_DIR}/${_filename}.dot ${_dot}) 0519 endmacro(calligra_product_deps_report)