Warning, /games/libkmahjongg/backgrounds/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2021, 2023 Friedrich W. H. Kossebau <kossebau@kde.org>
0002 #
0003 # SPDX-License-Identifier: BSD-3-Clause
0004 
0005 function(list_with_background_rendering_check id old_file new_file)
0006     # symbolic target for cheking this file, always outdated
0007     set(check_rendering_output "check_rendering_${old_file}")
0008     set_property(SOURCE ${check_rendering_output} PROPERTY SYMBOLIC 1)
0009 
0010     add_custom_command(
0011         OUTPUT ${check_rendering_output}
0012         COMMAND ${CMAKE_COMMAND}
0013         ARGS
0014             "-DID=${id}"
0015             "-DWORKING_DIR=${CMAKE_CURRENT_BINARY_DIR}"
0016             "-DRENDERELEMENT=$<TARGET_FILE:renderelement>"
0017             "-DCOMPARE=${ImageMagick_compare_EXECUTABLE}"
0018             "-DOLD_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${old_file}"
0019             "-DNEW_FILE=${new_file}"
0020             -P ${CMAKE_CURRENT_SOURCE_DIR}/CompareBackgroundSVGs.cmake
0021         COMMENT "Checking SVG of ${id}"
0022     )
0023 
0024     # add to general target
0025     set(target_check_rendering_output "check_rendering_background_${id}")
0026     add_custom_target(${target_check_rendering_output} DEPENDS ${check_rendering_output})
0027     add_dependencies(check_rendering ${target_check_rendering_output})
0028 endfunction()
0029 
0030 function(install_svg_background id)
0031     cmake_parse_arguments(ARGS "NO_CLEANING" "" "" ${ARGN})
0032 
0033     set(generate_args)
0034     if (ARGS_NO_CLEANING)
0035         list(APPEND generate_args NO_CLEANING)
0036     endif()
0037 
0038     set(svgz "${CMAKE_CURRENT_BINARY_DIR}/${id}.svgz")
0039     generate_svgz(${id}.svg ${svgz} "background-" ${generate_args})
0040     if(BUILD_SVG_CHECKS)
0041         list_with_background_rendering_check(${id} ${id}.svg ${svgz})
0042     endif()
0043     install(
0044         FILES
0045             ${id}.desktop
0046             ${svgz}
0047         DESTINATION  ${KDE_INSTALL_DATADIR}/kmahjongglib/backgrounds
0048     )
0049 endfunction()
0050 
0051 # svgcleaner seems to remove something needed, not yet investigated
0052 install_svg_background(default NO_CLEANING)
0053 
0054 install_svg_background(chinese_landscape)
0055 
0056 install_svg_background(egyptian)
0057 
0058 install_svg_background(summerfield)
0059 
0060 install_svg_background(wood_light)
0061 
0062 ##plain color
0063 install(FILES color_plain.desktop  DESTINATION  ${KDE_INSTALL_DATADIR}/kmahjongglib/backgrounds)