| 1 |
macro(qterm_install_icons _theme) |
| 2 |
|
| 3 |
file(GLOB _icons *.png) |
| 4 |
file(GLOB _svg *svgz) |
| 5 |
set(_icons ${_icons} ${_svg}) |
| 6 |
foreach(_current_ICON ${_icons} ) |
| 7 |
get_filename_component(_ctype ${_current_ICON} EXT) |
| 8 |
|
| 9 |
if (${_ctype} STREQUAL ".png") |
| 10 |
string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size "${_current_ICON}") |
| 11 |
string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}") |
| 12 |
string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name "${_current_ICON}") |
| 13 |
set(_sizestring "${_size}x${_size}") |
| 14 |
endif (${_ctype} STREQUAL ".png") |
| 15 |
|
| 16 |
if (${_ctype} STREQUAL ".svgz") |
| 17 |
string(REGEX REPLACE "^.*/[a-zA-Z]+\\-([a-z]+)\\-(.+\\.svgz)$" "\\1" _group "${_current_ICON}") |
| 18 |
string(REGEX REPLACE "^.*/[a-zA-Z]+\\-([a-z]+)\\-(.+\\.svgz)$" "\\2" _name "${_current_ICON}") |
| 19 |
set(_sizestring "scalable") |
| 20 |
endif (${_ctype} STREQUAL ".svgz") |
| 21 |
|
| 22 |
set(_icon_GROUP "actions") |
| 23 |
|
| 24 |
if(${_group} STREQUAL "mime") |
| 25 |
set(_icon_GROUP "mimetypes") |
| 26 |
endif(${_group} STREQUAL "mime") |
| 27 |
|
| 28 |
if(${_group} STREQUAL "filesys") |
| 29 |
set(_icon_GROUP "filesystems") |
| 30 |
endif(${_group} STREQUAL "filesys") |
| 31 |
|
| 32 |
if(${_group} STREQUAL "device") |
| 33 |
set(_icon_GROUP "devices") |
| 34 |
endif(${_group} STREQUAL "device") |
| 35 |
|
| 36 |
if(${_group} STREQUAL "app") |
| 37 |
set(_icon_GROUP "apps") |
| 38 |
endif(${_group} STREQUAL "app") |
| 39 |
|
| 40 |
if(${_group} STREQUAL "action") |
| 41 |
set(_icon_GROUP "actions") |
| 42 |
endif(${_group} STREQUAL "action") |
| 43 |
|
| 44 |
set(_ICON_INSTALL_DIR share/icons/${_theme}/${_sizestring}/${_icon_GROUP}) |
| 45 |
|
| 46 |
install(FILES ${_current_ICON} DESTINATION ${_ICON_INSTALL_DIR} RENAME ${_name}) |
| 47 |
|
| 48 |
endforeach (_current_ICON) |
| 49 |
endmacro(qterm_install_icons) |
| 50 |
|
| 51 |
if (NOT APPLE) |
| 52 |
qterm_install_icons(hicolor) |
| 53 |
endif () |