From 20c1736c1eda1f13f1675b00054ba2f923e3836f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sun, 5 Nov 2023 11:37:42 +0100 Subject: [PATCH 1/5] Require exiv2 0.28.0 Drop auto_ptr support --- src/core/CMakeLists.txt | 4 +-- src/core/implementation/exiv2_exif_reader.hpp | 33 +------------------ 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 1e9bdcfcb1..5a7184a53e 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,7 +1,7 @@ -find_package(OpenCV REQUIRED) +find_package(OpenCV REQUIRED) find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia) -find_package(exiv2 REQUIRED) +find_package(exiv2 0.28.0 REQUIRED ) find_package(Threads REQUIRED) find_package(CsLibGuarded REQUIRED) diff --git a/src/core/implementation/exiv2_exif_reader.hpp b/src/core/implementation/exiv2_exif_reader.hpp index 43b85cef89..a212d40af3 100644 --- a/src/core/implementation/exiv2_exif_reader.hpp +++ b/src/core/implementation/exiv2_exif_reader.hpp @@ -10,37 +10,6 @@ #include "aexif_reader.hpp" -template -struct has_auto_ptr_type : std::false_type -{ - using ptr_type = int; -}; - -template -struct has_auto_ptr_type> : std::true_type -{ - using ptr_type = typename T::AutoPtr; -}; - -template -struct has_unique_ptr_type : std::false_type -{ - using ptr_type = int; -}; - -template -struct has_unique_ptr_type> : std::true_type -{ - using ptr_type = typename T::UniquePtr; -}; - -template -struct Exiv2Helper -{ - using Ptr = typename std::conditional::value, typename has_unique_ptr_type::ptr_type, typename has_auto_ptr_type::ptr_type>::type; -}; - - class Exiv2ExifReader final: public AExifReader { public: @@ -56,7 +25,7 @@ class Exiv2ExifReader final: public AExifReader virtual void collect(const QString &) override; virtual std::optional read(TagType) const override; - Exiv2Helper::Ptr m_exif_data; + Exiv2::Image::UniquePtr m_exif_data; QString m_path; }; From b46b1afcccb6935527e6f63e897850627d6c085d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sun, 3 Dec 2023 11:04:00 +0100 Subject: [PATCH 2/5] Drop workarounds for auto_ptr --- CMakeLists.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a71a607327..94cdf926c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,15 +46,6 @@ include(CTest) include(${PROJECT_SOURCE_DIR}/cmake/functions.cmake) include(${PROJECT_SOURCE_DIR}/cmake_modules/DeveloperTools.cmake) -if(MSVC_VERSION) - #enable auto_ptr. Disabled by VS for c++17 but required by exiv 0.27 - add_definitions(-D_HAS_AUTO_PTR_ETC=1) - add_compile_options(/wd4251) -elseif(APPLE) - #enable auto_ptr. Disabled by clang on MacOS for c++17 but required by exiv 0.27 - add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) -endif() - #objdump if(ENABLE_OBJDUMPING) add_custom_target(DumpObjs ALL) From d688129e89033aee1fdc5762394633bc8cb7ffbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sat, 9 Dec 2023 13:29:16 +0100 Subject: [PATCH 3/5] Fix version For some reason exiv2 config does not consider v0.28.1 to be compatible with 0.28.0 --- src/core/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 5a7184a53e..03b7f972b3 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,7 +1,7 @@ find_package(OpenCV REQUIRED) find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia) -find_package(exiv2 0.28.0 REQUIRED ) +find_package(exiv2 0.28.1 REQUIRED) find_package(Threads REQUIRED) find_package(CsLibGuarded REQUIRED) From ae541f680203bf6b08a40d067358aee770c245a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 10 May 2024 17:00:51 +0200 Subject: [PATCH 4/5] Require 0.28.2 --- src/core/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 03b7f972b3..615dd0cc02 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,7 +1,7 @@ find_package(OpenCV REQUIRED) find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia) -find_package(exiv2 0.28.1 REQUIRED) +find_package(exiv2 0.28.2 REQUIRED) find_package(Threads REQUIRED) find_package(CsLibGuarded REQUIRED) From 1486ee77dc326d400e5498b79e929ecf7bea4094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 10 May 2024 19:14:36 +0200 Subject: [PATCH 5/5] Workaround proper version detection --- src/core/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 615dd0cc02..283c0e9718 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,12 +1,17 @@ find_package(OpenCV REQUIRED) find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia) -find_package(exiv2 0.28.2 REQUIRED) +find_package(exiv2 REQUIRED) find_package(Threads REQUIRED) find_package(CsLibGuarded REQUIRED) include(GenerateExportHeader) +if(exiv2_VERSION VERSION_LESS 0.28.1) + message(FATAL_ERROR "Exiv2 0.28.1 or higher is required") +endif() + + if(TARGET Exiv2::exiv2lib) set(EXIV2_LIB Exiv2::exiv2lib) else()