Disable the DDS and JPEG-2000 plugins when Qt version is 5.3 or later

QtImageFormats 5.3 comes with DDS and JPEG-2000 plugins that support
more options and are generally better than our plugins. The only
advantage our plugins offer is that the Qt DDS plugin does not work on
sequential devices, while ours does. This is outweighed by other
improvements, though, such as supporting more variants.

REVIEW: 119590
This commit is contained in:
Alex Merry 2014-08-03 18:18:10 +01:00
parent c9ca1f1862
commit 3d45b270ea
3 changed files with 29 additions and 11 deletions

View File

@ -30,13 +30,17 @@ if (UNIX)
endif() endif()
endif() endif()
find_package(Jasper) # QtImageFormats 5.3 comes with a JPEG-2000 plugin; don't duplicate it here
set_package_properties(Jasper PROPERTIES # TODO: remove our JPEG-2000 plugin when we depend on Qt 5.3.
DESCRIPTION "A library for handling JPEG-2000 images" if (Qt5Gui_VERSION VERSION_LESS 5.3.0)
PURPOSE "Required for the QImage plugin for JPEG-2000 images" find_package(Jasper)
URL "http://www.ece.uvic.ca/~mdadams/jasper" set_package_properties(Jasper PROPERTIES
TYPE OPTIONAL DESCRIPTION "A library for handling JPEG-2000 images"
) PURPOSE "Required for the QImage plugin for JPEG-2000 images"
URL "http://www.ece.uvic.ca/~mdadams/jasper"
TYPE OPTIONAL
)
endif()
find_package(OpenEXR) find_package(OpenEXR)
set_package_properties(OpenEXR PROPERTIES set_package_properties(OpenEXR PROPERTIES

View File

@ -2,11 +2,15 @@
################################## ##################################
add_library(kimg_dds MODULE dds.cpp) if (Qt5Gui_VERSION VERSION_LESS 5.3.0)
target_link_libraries(kimg_dds Qt5::Gui) add_library(kimg_dds MODULE dds.cpp)
target_link_libraries(kimg_dds Qt5::Gui)
install(TARGETS kimg_dds DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/) install(TARGETS kimg_dds DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/)
install(FILES dds.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/) install(FILES dds.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/)
else()
install(FILES dds-qt.desktop RENAME dds.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/)
endif()
################################## ##################################
@ -34,6 +38,9 @@ if(JASPER_FOUND)
install(TARGETS kimg_jp2 DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/) install(TARGETS kimg_jp2 DESTINATION ${QT_PLUGIN_INSTALL_DIR}/imageformats/)
install(FILES jp2.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/) install(FILES jp2.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/)
elseif (NOT Qt5Gui_VERSION VERSION_LESS 5.3.0)
# need this for Qt's version of the plugin
install(FILES jp2.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/)
endif() endif()
################################## ##################################

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=QImageIOPlugins
X-KDE-ImageFormat=dds
X-KDE-MimeType=image/x-dds
X-KDE-Read=true
X-KDE-Write=true