Enable support for AVIF, HEIF and JPEG XL on Windows
This commit is contained in:
parent
c84790f978
commit
af37d955bb
2 changed files with 43 additions and 3 deletions
42
external/kimageformats/CMakeLists.txt
vendored
42
external/kimageformats/CMakeLists.txt
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
# For license and copyright information please follow this link:
|
# For license and copyright information please follow this link:
|
||||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||||
|
|
||||||
if ((DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY) OR NOT LINUX) # should work on non-Linux, but cmake rules aren't implemented yet
|
if ((DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY) OR APPLE) # should work on macOS, but cmake rules aren't implemented yet
|
||||||
add_library(external_kimageformats INTERFACE IMPORTED GLOBAL)
|
add_library(external_kimageformats INTERFACE IMPORTED GLOBAL)
|
||||||
add_library(desktop-app::external_kimageformats ALIAS external_kimageformats)
|
add_library(desktop-app::external_kimageformats ALIAS external_kimageformats)
|
||||||
return()
|
return()
|
||||||
|
|
@ -17,7 +17,18 @@ init_target(external_kimageformats "(external)")
|
||||||
set(kimageformats_loc ${third_party_loc}/kimageformats)
|
set(kimageformats_loc ${third_party_loc}/kimageformats)
|
||||||
set(kimageformats_src ${kimageformats_loc}/src/imageformats)
|
set(kimageformats_src ${kimageformats_loc}/src/imageformats)
|
||||||
|
|
||||||
set_target_properties(external_kimageformats PROPERTIES AUTOMOC ON)
|
set(kimageformats_srcs)
|
||||||
|
qt_wrap_cpp(kimageformats_srcs
|
||||||
|
${kimageformats_src}/avif_p.h
|
||||||
|
${kimageformats_src}/heif_p.h
|
||||||
|
${kimageformats_src}/jxl_p.h
|
||||||
|
TARGET
|
||||||
|
external_kimageformats
|
||||||
|
DEPENDS
|
||||||
|
${kimageformats_src}/avif.json
|
||||||
|
${kimageformats_src}/heif.json
|
||||||
|
${kimageformats_src}/jxl.json
|
||||||
|
)
|
||||||
|
|
||||||
nice_target_sources(external_kimageformats ${kimageformats_src}
|
nice_target_sources(external_kimageformats ${kimageformats_src}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|
@ -25,6 +36,7 @@ PRIVATE
|
||||||
heif.cpp
|
heif.cpp
|
||||||
jxl.cpp
|
jxl.cpp
|
||||||
)
|
)
|
||||||
|
target_sources(external_kimageformats PRIVATE ${kimageformats_srcs})
|
||||||
|
|
||||||
target_compile_definitions(external_kimageformats
|
target_compile_definitions(external_kimageformats
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|
@ -51,6 +63,32 @@ if (DESKTOP_APP_USE_PACKAGED)
|
||||||
PkgConfig::LIBJXL
|
PkgConfig::LIBJXL
|
||||||
PkgConfig::LIBJXL_THREADS
|
PkgConfig::LIBJXL_THREADS
|
||||||
)
|
)
|
||||||
|
elseif (WIN32)
|
||||||
|
target_compile_definitions(external_kimageformats
|
||||||
|
PRIVATE
|
||||||
|
JXL_STATIC_DEFINE
|
||||||
|
JXL_THREADS_STATIC_DEFINE
|
||||||
|
LIBHEIF_STATIC_BUILD
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(external_kimageformats SYSTEM
|
||||||
|
PRIVATE
|
||||||
|
${libs_loc}/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(external_kimageformats
|
||||||
|
PRIVATE
|
||||||
|
${libs_loc}/libavif/$<IF:$<CONFIG:Debug>,Debug,Release>/avif.lib
|
||||||
|
${libs_loc}/libheif/libheif/$<IF:$<CONFIG:Debug>,Debug,Release>/heif.lib
|
||||||
|
${libs_loc}/libde265/libde265/$<IF:$<CONFIG:Debug>,Debug,Release>/de265.lib
|
||||||
|
${libs_loc}/dav1d/builddir-$<IF:$<CONFIG:Debug>,debug,release>/src/libdav1d.a
|
||||||
|
${libs_loc}/libjxl/lib/$<IF:$<CONFIG:Debug>,Debug,Release>/jxl-static.lib
|
||||||
|
${libs_loc}/libjxl/lib/$<IF:$<CONFIG:Debug>,Debug,Release>/jxl_threads-static.lib
|
||||||
|
${libs_loc}/libjxl/third_party/highway/$<IF:$<CONFIG:Debug>,Debug,Release>/hwy.lib
|
||||||
|
${libs_loc}/libjxl/third_party/brotli/$<IF:$<CONFIG:Debug>,Debug,Release>/brotlidec-static.lib
|
||||||
|
${libs_loc}/libjxl/third_party/brotli/$<IF:$<CONFIG:Debug>,Debug,Release>/brotlienc-static.lib
|
||||||
|
${libs_loc}/libjxl/third_party/brotli/$<IF:$<CONFIG:Debug>,Debug,Release>/brotlicommon-static.lib
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
target_link_static_libraries(external_kimageformats
|
target_link_static_libraries(external_kimageformats
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|
|
||||||
|
|
@ -55,11 +55,13 @@ Q_IMPORT_PLUGIN(QGtk3ThemePlugin)
|
||||||
#endif // !DESKTOP_APP_USE_PACKAGED
|
#endif // !DESKTOP_APP_USE_PACKAGED
|
||||||
|
|
||||||
#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY
|
#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY
|
||||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
#if defined Q_OS_WIN || (defined Q_OS_UNIX && !defined Q_OS_MAC)
|
||||||
Q_IMPORT_PLUGIN(QAVIFPlugin)
|
Q_IMPORT_PLUGIN(QAVIFPlugin)
|
||||||
Q_IMPORT_PLUGIN(HEIFPlugin)
|
Q_IMPORT_PLUGIN(HEIFPlugin)
|
||||||
Q_IMPORT_PLUGIN(QJpegXLPlugin)
|
Q_IMPORT_PLUGIN(QJpegXLPlugin)
|
||||||
|
#endif // Q_OS_WIN || (Q_OS_UNIX && !Q_OS_MAC)
|
||||||
|
|
||||||
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
|
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
|
||||||
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||||
Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin)
|
Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue