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) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 1e9bdcfcb1..283c0e9718 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,5 +1,5 @@ -find_package(OpenCV REQUIRED) +find_package(OpenCV REQUIRED) find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia) find_package(exiv2 REQUIRED) find_package(Threads REQUIRED) @@ -7,6 +7,11 @@ 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() 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; };