From 4254c20edad247a5a326638faceb5f631e20e231 Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Wed, 2 Nov 2022 10:46:38 +0800 Subject: [PATCH] experimental: install mime info in CMake Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com> --- CMakeLists.txt | 6 ++++++ program_info/CMakeLists.txt | 1 + 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 131d3e53..73b1d5b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,6 +205,8 @@ add_subdirectory(program_info) ####################################### Install layout ####################################### +find_package(SharedMimeInfo) + if(NOT (UNIX AND APPLE)) # Install "portable.txt" if selected component is "portable" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Portable_File}" DESTINATION "." COMPONENT portable EXCLUDE_FROM_ALL) @@ -262,6 +264,10 @@ elseif(UNIX) SET(Launcher_BINARY_RPATH "$ORIGIN/") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_Desktop} DESTINATION ${LAUNCHER_DESKTOP_DEST_DIR}) + if(SharedMimeInfo_FOUND) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_mrpack_MIMEInfo} DESTINATION ${KDE_INSTALL_MIMEDIR}) + update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR}) + endif(SharedMimeInfo_FOUND) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_MetaInfo} DESTINATION ${LAUNCHER_METAINFO_DEST_DIR}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_SVG} DESTINATION ${LAUNCHER_ICON_DEST_DIR}) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index f6e2ea84..3c8cad0f 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -23,6 +23,7 @@ set(Launcher_Git "https://github.com/PrismLauncher/PrismLauncher" PARENT_SCOPE) set(Launcher_DesktopFileName "org.prismlauncher.PrismLauncher.desktop" PARENT_SCOPE) set(Launcher_Desktop "program_info/org.prismlauncher.PrismLauncher.desktop" PARENT_SCOPE) +set(Launcher_mrpack_MIMEInfo "program_info/modrinth-mrpack-mime.xml" PARENT_SCOPE) set(Launcher_MetaInfo "program_info/org.prismlauncher.PrismLauncher.metainfo.xml" PARENT_SCOPE) set(Launcher_SVG "program_info/org.prismlauncher.PrismLauncher.svg" PARENT_SCOPE) set(Launcher_Branding_ICNS "program_info/prismlauncher.icns" PARENT_SCOPE)