From 559846c16409e7ccda7c1ead773dbdf477e998cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Novomesk=C3=BD?= Date: Fri, 9 Feb 2024 15:23:47 +0100 Subject: [PATCH] Update build scripts --- CMakeLists.txt | 1 + appveyor.yml | 7 ++++--- qt-jpegxl-image-plugin.pro | 4 ++-- qt-jpegxl-image-plugin_appveyor.pro | 2 +- .../qt-jpegxl-image-plugin_alternative_appveyor.pro | 4 ++-- src/CMakeLists.txt | 7 +++++++ 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 415efe9..89d2809 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ find_package(Qt${QT_MAJOR_VERSION}Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) include(FindPkgConfig) pkg_check_modules(LibJXL REQUIRED IMPORTED_TARGET libjxl>=0.7.0) pkg_check_modules(LibJXLThreads REQUIRED IMPORTED_TARGET libjxl_threads>=0.7.0) +pkg_check_modules(LibJXLCMS IMPORTED_TARGET libjxl_cms>=0.9.0) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02) add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055900) diff --git a/appveyor.yml b/appveyor.yml index a06f518..e46cd20 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,10 +1,11 @@ -version: 0.5.1.{build} +version: 0.6.0.{build} +image: Visual Studio 2022 environment: CC: cl.exe CXX: cl.exe install: - cmd: >- - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" git clone --depth 1 -b v0.9.x https://github.com/libjxl/libjxl.git --recursive --shallow-submodules @@ -14,7 +15,7 @@ install: cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_DOXYGEN=OFF -DJPEGXL_ENABLE_MANPAGES=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_EXAMPLES=OFF -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_ENABLE_SKCMS=ON -DJPEGXL_WARNINGS_AS_ERRORS=OFF -DJPEGXL_ENABLE_JPEGLI=OFF -DJPEGXL_ENABLE_JPEGLI_LIBJPEG=OFF -DCMAKE_C_FLAGS="-DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE" -DCMAKE_CXX_FLAGS="-DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE" .. + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_DOXYGEN=OFF -DJPEGXL_ENABLE_MANPAGES=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_EXAMPLES=OFF -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_ENABLE_SKCMS=ON -DJPEGXL_WARNINGS_AS_ERRORS=OFF -DJPEGXL_ENABLE_JPEGLI=OFF -DJPEGXL_ENABLE_JPEGLI_LIBJPEG=OFF -DCMAKE_C_FLAGS="-DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE -DJXL_CMS_STATIC_DEFINE" -DCMAKE_CXX_FLAGS="-DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE -DJXL_CMS_STATIC_DEFINE" .. ninja jxl jxl_cms jxl_threads hwy brotlicommon brotlidec brotlienc diff --git a/qt-jpegxl-image-plugin.pro b/qt-jpegxl-image-plugin.pro index eacbfea..89764b5 100644 --- a/qt-jpegxl-image-plugin.pro +++ b/qt-jpegxl-image-plugin.pro @@ -6,7 +6,7 @@ OTHER_FILES = src/jpegxl.json SOURCES += src/main.cpp -LIBS += -ljxl -ljxl_threads -lbrotlicommon -lbrotlienc -lbrotlidec +LIBS += -ljxl -ljxl_threads -ljxl_cms -lbrotlicommon -lbrotlienc -lbrotlidec PLUGIN_TYPE = imageformats PLUGIN_CLASS_NAME = QJpegXLPlugin @@ -18,4 +18,4 @@ CONFIG -= separate_debug_info debug debug_and_release force_debug_info QMAKE_TARGET_COMPANY = "Daniel Novomesky" QMAKE_TARGET_PRODUCT = "qt-jpegxl-image-plugin" QMAKE_TARGET_DESCRIPTION = "Qt plug-in to allow Qt and KDE based applications to read/write JPEG XL images." -QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2020-2023 Daniel Novomesky" +QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2020-2024 Daniel Novomesky" diff --git a/qt-jpegxl-image-plugin_appveyor.pro b/qt-jpegxl-image-plugin_appveyor.pro index ad4f551..76f1e83 100644 --- a/qt-jpegxl-image-plugin_appveyor.pro +++ b/qt-jpegxl-image-plugin_appveyor.pro @@ -22,4 +22,4 @@ CONFIG -= separate_debug_info debug debug_and_release force_debug_info QMAKE_TARGET_COMPANY = "Daniel Novomesky" QMAKE_TARGET_PRODUCT = "qt-jpegxl-image-plugin" QMAKE_TARGET_DESCRIPTION = "Qt plug-in to allow Qt and KDE based applications to read/write JPEG XL images." -QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2020-2023 Daniel Novomesky" +QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2020-2024 Daniel Novomesky" diff --git a/qtbuild_6.5.3/qt-jpegxl-image-plugin_alternative_appveyor.pro b/qtbuild_6.5.3/qt-jpegxl-image-plugin_alternative_appveyor.pro index 1465695..d1817fd 100644 --- a/qtbuild_6.5.3/qt-jpegxl-image-plugin_alternative_appveyor.pro +++ b/qtbuild_6.5.3/qt-jpegxl-image-plugin_alternative_appveyor.pro @@ -17,9 +17,9 @@ TEMPLATE = lib CONFIG += release skip_target_version_ext c++14 warn_on plugin CONFIG -= separate_debug_info debug debug_and_release force_debug_info -win32:VERSION = 0.5.0 +win32:VERSION = 0.6.0 QMAKE_TARGET_COMPANY = "Daniel Novomesky" QMAKE_TARGET_PRODUCT = "qt-jpegxl-image-plugin" QMAKE_TARGET_DESCRIPTION = "Qt plug-in to allow Qt and KDE based applications to read/write JPEG XL images." -QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2020-2023 Daniel Novomesky" +QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2020-2024 Daniel Novomesky" QMAKE_TARGET_COMMENTS = "Build using Qt 6.5.3" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 59ee01d..38f318e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,6 +21,13 @@ endfunction() if (LibJXL_FOUND AND LibJXLThreads_FOUND) kimageformats_add_plugin("libqjpegxl${QT_MAJOR_VERSION}" SOURCES "main.cpp" "qjpegxlhandler.cpp") target_link_libraries("libqjpegxl${QT_MAJOR_VERSION}" PkgConfig::LibJXL PkgConfig::LibJXLThreads) + if(LibJXL_VERSION VERSION_GREATER_EQUAL "0.9.0") + if(LibJXLCMS_FOUND) + target_link_libraries("libqjpegxl${QT_MAJOR_VERSION}" PkgConfig::LibJXLCMS) + else() + message(SEND_ERROR "libjxl_cms was not found!") + endif() + endif() #install(FILES jxl.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR}/qimageioplugins/) endif()