Commit 4149ec68 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Store theme SVGs uncompressed in repo, install as SVGZs

parent 2eb3bd34
Pipeline #191623 passed with stage
in 1 minute and 49 seconds
......@@ -16,7 +16,7 @@ set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.90.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
......@@ -54,6 +54,8 @@ add_definitions(
-DKF_DEPRECATED_WARNINGS_SINCE=0x060000
)
include(InternalMacros)
add_subdirectory(icons)
add_subdirectory(themes)
add_subdirectory(doc)
......
# SPDX-FileCopyrightText: 2021-2022 Friedrich W. H. Kossebau <kossebau@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
if(WIN32)
find_package(7z)
set_package_properties(7z PROPERTIES
TYPE REQUIRED
PURPOSE "For installing SVG files as SVGZ"
)
else()
find_package(gzip)
set_package_properties(gzip PROPERTIES
TYPE REQUIRED
PURPOSE "For installing SVG files as SVGZ"
)
endif()
function(generate_svgz svg_file svgz_file target_prefix)
if (NOT IS_ABSOLUTE ${svg_file})
set(svg_file "${CMAKE_CURRENT_SOURCE_DIR}/${svg_file}")
endif()
if (NOT EXISTS ${svg_file})
message(FATAL_ERROR "No such file found: ${svg_file}")
endif()
get_filename_component(_fileName "${svg_file}" NAME)
if(WIN32)
add_custom_command(
OUTPUT ${svgz_file}
COMMAND 7z::7z
ARGS
a
-tgzip
${svgz_file} ${svg_file}
DEPENDS ${svg_file}
COMMENT "Gzipping ${_fileName}"
)
else()
add_custom_command(
OUTPUT ${svgz_file}
COMMAND ${gzip_EXECUTABLE}
ARGS
-9n
-c
${svg_file} > ${svgz_file}
DEPENDS ${svg_file}
COMMENT "Gzipping ${_fileName}"
)
endif()
add_custom_target("${target_prefix}${_fileName}z" ALL DEPENDS ${svgz_file})
endfunction()
set(ksnakeduel_THEME_SRCS
default.desktop
default.png
default.svgz
neon.desktop
neon.svg
neon.png
)
install(FILES ${ksnakeduel_THEME_SRCS} DESTINATION ${KDE_INSTALL_DATADIR}/ksnakeduel/themes)
# SPDX-FileCopyrightText: 2022 Friedrich W. H. Kossebau <kossebau@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
function(install_theme id)
set(svgz "${CMAKE_CURRENT_BINARY_DIR}/${id}.svgz")
generate_svgz(${id}.svg ${svgz} "theme-")
install(
FILES
${id}.desktop
${id}.png
${svgz}
DESTINATION ${KDE_INSTALL_DATADIR}/ksnakeduel/themes
)
endfunction()
install_theme(default)
install_theme(neon)
......@@ -93,7 +93,7 @@ Description[uk]=Ретро-тема з невловимим присмаком
Description[x-test]=xxA retro theme with a distinctive touch of early 50s.xx
Description[zh_CN]=加上了 50 年代早期的风韵的重制版主题。
Description[zh_TW]=Neon 外觀主題,加上 50 年代早期的特色。
FileName=neon.svg
FileName=neon.svgz
Author=Eugene Trounev
AuthorEmail=eugene.trounev@gmail.com
Preview=neon.png
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment