Fix mimetype file installation (needs ECM & KDEInstallDirs)

Summary:
find_package( SharedMimeInfo) relies on some FindSharedMimeInfo.cmake file
as sharedmimeinfo does not come itself with cmake config files.
ECM provides a FindSharedMimeInfo.cmake file.
Not sure about platforms without ECM, are there any where the additional
Geo mimetypes should be also registered?

Reviewers: rahn, nienhueser

Reviewed By: nienhueser

Projects: #marble

Differential Revision: https://phabricator.kde.org/D1505
parent bae4b183
......@@ -262,10 +262,16 @@ DESTINATION ${MARBLE_DATA_INSTALL_PATH}/audio)
add_subdirectory(lang)
# shared-mime-info 0.40 is mandatory for generic-icon
set( SHARED_MIME_INFO_MINIMUM_VERSION "0.40" )
find_package( SharedMimeInfo QUIET )
IF( SHAREDMIMEINFO_FOUND )
install( FILES mimetypes/geo.xml DESTINATION ${XDG_MIME_INSTALL_DIR} )
update_xdg_mimetypes( ${XDG_MIME_INSTALL_DIR} )
ENDIF()
set(KDE_SKIP_UNINSTALL_TARGET ON CACHE BOOL "KDE uninstall target must be disabled")
find_package(ECM QUIET) # for FindSharedMimeInfo
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
if(ECM_FOUND)
include(KDEInstallDirs) # for XDG_MIME_INSTALL_DIR
# shared-mime-info 0.40 is mandatory for generic-icon
set( SHARED_MIME_INFO_MINIMUM_VERSION "0.40" )
find_package( SharedMimeInfo QUIET )
IF( SHAREDMIMEINFO_FOUND )
install( FILES mimetypes/geo.xml DESTINATION ${XDG_MIME_INSTALL_DIR} )
update_xdg_mimetypes( ${XDG_MIME_INSTALL_DIR} )
ENDIF()
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment