7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 18:11:42 +00:00

Rearrange linux resources and translate MIME files

This commit is contained in:
Ian McInerney 2021-01-16 19:15:12 +00:00
parent 43baf2e3f2
commit 2aff8822d6
68 changed files with 20 additions and 13 deletions

3
.gitignore vendored
View File

@ -116,3 +116,6 @@ CMakeSettings.json
*.mo
i18n_status.svg
i18n_status.csv
# Don't actually ignore any of these files, since we need them in the tree
!resources/linux/icons/hicolor/**/**/*

View File

@ -185,14 +185,14 @@ macro( linux_metadata_translation SRC_FILE OUT_FILE PO_DIR )
${OPT_TYPE} --template=${SRC_FILE}
-d ${PO_DIR}
-o ${OUT_FILE}
COMMENT "Translating ${OUT_FNAME}"
COMMENT "Translating file ${OUT_FNAME}"
)
else()
add_custom_command(
OUTPUT ${OUT_FILE}
DEPENDS ${SRC_FILE}
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SRC_FILE}" "${OUT_FILE}"
COMMENT "Copying ${OUT_FNAME}"
COMMENT "Copying file ${OUT_FNAME}"
)
endif()
endmacro()

View File

@ -47,6 +47,15 @@ elseif( UNIX )
${PROJECT_BINARY_DIR}/resources/linux/launchers/pcbnew.desktop
${PROJECT_SOURCE_DIR}/translation/pofiles )
# Translate the MIME info, which are read from the source directory
linux_metadata_translation( ${PROJECT_SOURCE_DIR}/resources/linux/mime/kicad-gerbers.xml.in
${PROJECT_BINARY_DIR}/resources/linux/mime/kicad-gerbers.xml
${PROJECT_SOURCE_DIR}/translation/pofiles )
linux_metadata_translation( ${PROJECT_SOURCE_DIR}/resources/linux/mime/kicad-kicad.xml.in
${PROJECT_BINARY_DIR}/resources/linux/mime/kicad-kicad.xml
${PROJECT_SOURCE_DIR}/translation/pofiles )
add_custom_target( metadata ALL
DEPENDS ${PROJECT_BINARY_DIR}/resources/linux/appdata/kicad.appdata.xml
${PROJECT_BINARY_DIR}/resources/linux/launchers/bitmap2component.desktop
@ -55,21 +64,19 @@ elseif( UNIX )
${PROJECT_BINARY_DIR}/resources/linux/launchers/kicad.desktop
${PROJECT_BINARY_DIR}/resources/linux/launchers/pcbcalculator.desktop
${PROJECT_BINARY_DIR}/resources/linux/launchers/pcbnew.desktop
${PROJECT_BINARY_DIR}/resources/linux/mime/kicad-gerbers.xml
${PROJECT_BINARY_DIR}/resources/linux/mime/kicad-kicad.xml
)
# Set paths
set( UNIX_MIME_DIR linux/mime )
set( UNIX_MIME_FILES ${UNIX_MIME_DIR}/mime )
set( UNIX_ICON_FILES ${UNIX_MIME_DIR}/icons )
# Install Mime directory
install( DIRECTORY ${UNIX_ICON_FILES}
# Install icons
install( DIRECTORY ${PROJECT_SOURCE_DIR}/resources/linux/icons
TYPE DATA
COMPONENT resources
)
# Install Icons
install( DIRECTORY ${UNIX_MIME_FILES}/
# Install MIME type files
install( DIRECTORY ${PROJECT_BINARY_DIR}/resources/linux/mime/
DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages
COMPONENT resources
)

Some files were not shown because too many files have changed in this diff Show More