| 1 |
# Distributed under the original FontForge BSD 3-clause license |
| 2 |
|
| 3 |
if(UNIX) |
| 4 |
install(FILES org.fontforge.FontForge.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) |
| 5 |
install(FILES fontforge.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages) |
| 6 |
|
| 7 |
foreach(_size 16x16 22x22 24x24 32x32 48x48 64x64 128x128 256x256 512x512) |
| 8 |
install(FILES "${GUI_THEME}/${_size}/org.fontforge.FontForge.png" DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${_size}/apps) |
| 9 |
endforeach() |
| 10 |
install(FILES "${GUI_THEME}/scalable/org.fontforge.FontForge.svg" DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) |
| 11 |
|
| 12 |
file(STRINGS "${PROJECT_SOURCE_DIR}/po/LINGUAS" _langs) |
| 13 |
foreach(_lang ${_langs}) |
| 14 |
list(APPEND _pofiles "${PROJECT_SOURCE_DIR}/po/${_lang}.po") |
| 15 |
endforeach() |
| 16 |
|
| 17 |
macro(msgfmt_desktop_file _mode _file _installdir) |
| 18 |
set(_input "${CMAKE_CURRENT_SOURCE_DIR}/${_file}.in") |
| 19 |
set(_output "${CMAKE_CURRENT_BINARY_DIR}/${_file}") |
| 20 |
add_custom_command(OUTPUT "${_output}" |
| 21 |
COMMAND "${GETTEXT_MSGFMT_EXECUTABLE}" |
| 22 |
--${_mode} --template "${_input}" |
| 23 |
-d "${PROJECT_SOURCE_DIR}/po" |
| 24 |
-o "${_output}" |
| 25 |
DEPENDS "${_input}" ${_pofiles} |
| 26 |
VERBATIM |
| 27 |
) |
| 28 |
install(FILES "${_output}" DESTINATION "${_installdir}") |
| 29 |
list(APPEND _desktop_dependencies "${_output}") |
| 30 |
endmacro() |
| 31 |
|
| 32 |
# This would work, except there's a bug on msgfmt 0.19.7 which causes |
| 33 |
# desktop files to be mis-parsed if there's lines longer than 100 chars |
| 34 |
# msgfmt_desktop_file(desktop org.fontforge.FontForge.desktop "${CMAKE_INSTALL_DATADIR}/applications") |
| 35 |
|
| 36 |
msgfmt_desktop_file(xml org.fontforge.FontForge.appdata.xml "${CMAKE_INSTALL_DATADIR}/metainfo") |
| 37 |
|
| 38 |
add_custom_target(appstream ALL DEPENDS ${_desktop_dependencies}) |
| 39 |
endif() |