kicad/resources/CMakeLists.txt

108 lines
5.9 KiB
CMake
Raw Normal View History

2021-01-16 18:09:59 +00:00
#################################################
# Generate platform metadata files
#################################################
if( APPLE )
#TODO Generate this at runtime as well
include( ${KICAD_CMAKE_MODULE_PATH}/WritePlatformMetadata_macos.cmake )
2021-01-16 18:09:59 +00:00
elseif( UNIX )
# Add the command to configure the linux metainfo file with the version information
2021-01-16 18:09:59 +00:00
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/resources/linux/metainfo/org.kicad.kicad.metainfo.xml.in
2021-01-16 18:09:59 +00:00
COMMAND ${CMAKE_COMMAND}
-DSRC_PATH=${PROJECT_SOURCE_DIR}
-DBUILD_PATH=${PROJECT_BINARY_DIR}
2023-01-04 01:23:39 +00:00
-DKICAD_CMAKE_MODULE_PATH=${PROJECT_SOURCE_DIR}/cmake
-P ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/WritePlatformMetadata_linux.cmake
DEPENDS ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/WritePlatformMetadata_linux.cmake
COMMENT "Configuring Linux metainfo"
2021-01-16 18:09:59 +00:00
)
# Read the metainfo from the binary directory because it has been configured by Cmake already
2021-01-16 18:09:59 +00:00
# to have the version string in it
linux_metadata_translation( ${PROJECT_BINARY_DIR}/resources/linux/metainfo/org.kicad.kicad.metainfo.xml.in
${PROJECT_BINARY_DIR}/resources/linux/metainfo/org.kicad.kicad.metainfo.xml
2021-01-16 18:09:59 +00:00
${PROJECT_SOURCE_DIR}/translation/pofiles )
# All the desktop files are read from the source directory
linux_metadata_translation( ${PROJECT_SOURCE_DIR}/resources/linux/launchers/org.kicad.bitmap2component.desktop.in
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.bitmap2component.desktop
2021-01-16 18:09:59 +00:00
${PROJECT_SOURCE_DIR}/translation/pofiles )
linux_metadata_translation( ${PROJECT_SOURCE_DIR}/resources/linux/launchers/org.kicad.eeschema.desktop.in
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.eeschema.desktop
2021-01-16 18:09:59 +00:00
${PROJECT_SOURCE_DIR}/translation/pofiles )
linux_metadata_translation( ${PROJECT_SOURCE_DIR}/resources/linux/launchers/org.kicad.gerbview.desktop.in
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.gerbview.desktop
2021-01-16 18:09:59 +00:00
${PROJECT_SOURCE_DIR}/translation/pofiles )
linux_metadata_translation( ${PROJECT_SOURCE_DIR}/resources/linux/launchers/org.kicad.kicad.desktop.in
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.kicad.desktop
2021-01-16 18:09:59 +00:00
${PROJECT_SOURCE_DIR}/translation/pofiles )
linux_metadata_translation( ${PROJECT_SOURCE_DIR}/resources/linux/launchers/org.kicad.pcbcalculator.desktop.in
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.pcbcalculator.desktop
2021-01-16 18:09:59 +00:00
${PROJECT_SOURCE_DIR}/translation/pofiles )
linux_metadata_translation( ${PROJECT_SOURCE_DIR}/resources/linux/launchers/org.kicad.pcbnew.desktop.in
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.pcbnew.desktop
2021-01-16 18:09:59 +00:00
${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 )
2021-01-16 18:09:59 +00:00
add_custom_target( metadata ALL
DEPENDS ${PROJECT_BINARY_DIR}/resources/linux/metainfo/org.kicad.kicad.metainfo.xml
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.bitmap2component.desktop
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.eeschema.desktop
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.gerbview.desktop
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.kicad.desktop
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.pcbcalculator.desktop
${PROJECT_BINARY_DIR}/resources/linux/launchers/org.kicad.pcbnew.desktop
${PROJECT_BINARY_DIR}/resources/linux/mime/kicad-gerbers.xml
${PROJECT_BINARY_DIR}/resources/linux/mime/kicad-kicad.xml
2021-01-16 18:09:59 +00:00
)
# Install icons
install( DIRECTORY ${PROJECT_SOURCE_DIR}/resources/linux/icons/
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons
2021-01-16 18:09:59 +00:00
COMPONENT resources
)
# Install MIME type files
install( DIRECTORY ${PROJECT_BINARY_DIR}/resources/linux/mime/
2021-01-16 18:09:59 +00:00
DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages
COMPONENT resources
FILES_MATCHING
PATTERN "*.xml"
PATTERN "*.in" EXCLUDE
2021-01-16 18:09:59 +00:00
)
# Install application launchers (.desktop files)
install( DIRECTORY ${PROJECT_BINARY_DIR}/resources/linux/launchers/
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
COMPONENT resources
FILES_MATCHING
PATTERN "*.desktop"
PATTERN "*.in" EXCLUDE
)
# Install appstream metadata (app store entry)
install( DIRECTORY ${PROJECT_BINARY_DIR}/resources/linux/metainfo/
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo
2021-01-16 18:09:59 +00:00
COMPONENT resources
FILES_MATCHING
PATTERN "*metainfo.xml"
2021-01-16 18:09:59 +00:00
PATTERN "*.in" EXCLUDE
)
endif()
2022-07-21 23:32:44 +00:00
add_subdirectory(bitmaps_png)
add_subdirectory(project_template)