From f3f72580799213261fdd30cc623dfa57cd957af7 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Thu, 25 Aug 2022 21:16:15 +0200 Subject: Work around exiv2 still using std::auto_ptr std::auto_ptr is being removed when building with newer C++ standards. Our consumers so far work around that by reducing the C++ standard for files or targets using exiv2. That however no longer works with Qt 6, which insists on C++17 at least. Instead, we now make std::auto_ptr visible again in libc++ for exiv2 users. This should fix the FreeBSD Qt 6 build of KFileMetaData. --- find-modules/FindLibExiv2.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/find-modules/FindLibExiv2.cmake b/find-modules/FindLibExiv2.cmake index fa1bc6b8..290538cd 100644 --- a/find-modules/FindLibExiv2.cmake +++ b/find-modules/FindLibExiv2.cmake @@ -86,6 +86,13 @@ if(LibExiv2_FOUND AND NOT TARGET LibExiv2::LibExiv2) IMPORTED_LOCATION "${LibExiv2_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES "${LibExiv2_INCLUDE_DIRS}" ) + if (LibExiv2_VERSION VERSION_LESS 0.28.0) + # exiv2 0.27 or older still uses std::auto_ptr, which is no longer available + # by default when using newer C++ versions + set_target_properties(LibExiv2::LibExiv2 PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR=1" + ) + endif() endif() include(FeatureSummary) -- cgit v1.2.1