Changeset View
Changeset View
Standalone View
Standalone View
src/desktoptheme/CMakeLists.txt
1 | 1 | | |||
---|---|---|---|---|---|
2 | option(GZIP_DESKTOPTHEME_SVG "Install Desktop Theme SVG files as .svgz." ON) | 2 | option(GZIP_DESKTOPTHEME_SVG "Install Desktop Theme SVG files as .svgz." ON) | ||
3 | 3 | | |||
4 | if (GZIP_DESKTOPTHEME_SVG) | 4 | if (GZIP_DESKTOPTHEME_SVG) | ||
5 | if(WIN32) | ||||
6 | find_package(7z) | ||||
7 | set_package_properties(7z PROPERTIES | ||||
8 | TYPE REQUIRED | ||||
9 | ) | ||||
10 | else() | ||||
5 | find_package(gzip) | 11 | find_package(gzip) | ||
6 | set_package_properties(gzip PROPERTIES | 12 | set_package_properties(gzip PROPERTIES | ||
7 | TYPE REQUIRED | 13 | TYPE REQUIRED | ||
8 | ) | 14 | ) | ||
9 | endif() | 15 | endif() | ||
16 | endif() | ||||
10 | 17 | | |||
11 | # Helper function, private for now | 18 | # Helper function, private for now | ||
12 | # Once it has matured and proven, add to public macros | 19 | # Once it has matured and proven, add to public macros | ||
13 | function(PLASMA_INSTALL_DESKTOPTHEME_SVGS theme_name) | 20 | function(PLASMA_INSTALL_DESKTOPTHEME_SVGS theme_name) | ||
14 | set(options | 21 | set(options | ||
15 | ) | 22 | ) | ||
16 | set(oneValueArgs | 23 | set(oneValueArgs | ||
17 | SUBPATH | 24 | SUBPATH | ||
Show All 32 Lines | 53 | foreach(_src_file ${PIDS_FILES}) | |||
50 | if (NOT EXISTS ${_src_file}) | 57 | if (NOT EXISTS ${_src_file}) | ||
51 | message(FATAL_ERROR "No such file found: ${_src_file}") | 58 | message(FATAL_ERROR "No such file found: ${_src_file}") | ||
52 | endif() | 59 | endif() | ||
53 | get_filename_component(_fileName "${_src_file}" NAME) | 60 | get_filename_component(_fileName "${_src_file}" NAME) | ||
54 | 61 | | |||
55 | if (GZIP_DESKTOPTHEME_SVG) | 62 | if (GZIP_DESKTOPTHEME_SVG) | ||
56 | set(_gzipped_file_displayname "${desktoptheme_COMPONENTDIR}/${_fileName}z") | 63 | set(_gzipped_file_displayname "${desktoptheme_COMPONENTDIR}/${_fileName}z") | ||
57 | set(_gzipped_file "${CMAKE_CURRENT_BINARY_DIR}/${desktoptheme_GZIPDIR}/${_fileName}z") | 64 | set(_gzipped_file "${CMAKE_CURRENT_BINARY_DIR}/${desktoptheme_GZIPDIR}/${_fileName}z") | ||
65 | if(WIN32) | ||||
66 | add_custom_command( | ||||
67 | OUTPUT ${_gzipped_file} | ||||
68 | COMMAND ${7z_EXECUTABLE} | ||||
69 | ARGS | ||||
70 | a | ||||
71 | -tgzip | ||||
72 | ${_gzipped_file} ${_src_file} | ||||
73 | DEPENDS ${_src_file} | ||||
74 | COMMENT "Gzipping ${_gzipped_file_displayname}" | ||||
75 | ) | ||||
76 | else() | ||||
58 | add_custom_command( | 77 | add_custom_command( | ||
59 | OUTPUT ${_gzipped_file} | 78 | OUTPUT ${_gzipped_file} | ||
60 | COMMAND ${gzip_EXECUTABLE} | 79 | COMMAND ${gzip_EXECUTABLE} | ||
61 | ARGS | 80 | ARGS | ||
62 | -9 | 81 | -9 | ||
63 | -c | 82 | -c | ||
64 | ${_src_file} > ${_gzipped_file} | 83 | ${_src_file} > ${_gzipped_file} | ||
65 | DEPENDS ${_src_file} | 84 | DEPENDS ${_src_file} | ||
66 | COMMENT "Gzipping ${_gzipped_file_displayname}" | 85 | COMMENT "Gzipping ${_gzipped_file_displayname}" | ||
67 | ) | 86 | ) | ||
87 | endif() | ||||
68 | else() | 88 | else() | ||
69 | set(_gzipped_file "${_src_file}") | 89 | set(_gzipped_file "${_src_file}") | ||
70 | endif() | 90 | endif() | ||
71 | 91 | | |||
72 | list(APPEND _install_files "${_gzipped_file}") | 92 | list(APPEND _install_files "${_gzipped_file}") | ||
73 | endforeach() | 93 | endforeach() | ||
74 | 94 | | |||
75 | add_custom_target(${_target_name} ALL DEPENDS ${_install_files}) | 95 | add_custom_target(${_target_name} ALL DEPENDS ${_install_files}) | ||
Show All 10 Lines |