digikam/0001-Use-FindLibExiv2.cmake-from-ECM.patch

84 lines
3.3 KiB
Diff

From ed7f587cf43c9f72ca89329a4a51c7e86bfa0824 Mon Sep 17 00:00:00 2001
From: Christophe Marin <christophe@krop.fr>
Date: Tue, 14 Nov 2023 13:31:28 +0100
Subject: [PATCH] Use FindLibExiv2.cmake from ECM
---
core/CMakeLists.txt | 5 ++---
core/app/DigikamCoreTarget.cmake | 2 +-
core/libs/metadataengine/CMakeLists.txt | 8 ++++++--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index c694c4b..fa17f38 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -75,7 +75,8 @@ endif()
# -- Exiv2 checks and adjustements ---------------------------------------------
-include(RulesLibExiv2)
+# include(RulesLibExiv2)
+find_package(LibExiv2 MODULE REQUIRED)
# -- OpenCV checks and adjustements --------------------------------------------
@@ -255,7 +256,6 @@ PRINT_COMPONENT_COMPILE_STATUS("Media Player Support" ENAB
# ==============================================================================
PRINT_LIBRARY_STATUS("libboostgraph" "https://github.com/boostorg/boost" "(version >= 1.43.0)" Boost_FOUND)
-PRINT_LIBRARY_STATUS("libexiv2" "https://github.com/Exiv2/exiv2" "(version >= ${EXIV2_MIN_VERSION}" exiv2_FOUND)
PRINT_LIBRARY_STATUS("libexpat" "https://libexpat.github.io" "(version >= 2.0.0)" EXPAT_FOUND)
PRINT_LIBRARY_STATUS("libjpeg" "https://github.com/libjpeg-turbo/libjpeg-turbo" "(version >= 6b)" JPEG_FOUND)
PRINT_LIBRARY_STATUS("libkde" "https://invent.kde.org/frameworks/" "(version >= ${KF5_MIN_VERSION})" KF5_FOUND)
@@ -306,7 +306,6 @@ endif()
# ==============================================================================
if(Boost_FOUND AND
- exiv2_FOUND AND
EXPAT_FOUND AND
JPEG_FOUND AND
KF5_FOUND AND
diff --git a/core/app/DigikamCoreTarget.cmake b/core/app/DigikamCoreTarget.cmake
index 83fda1b..a0fc151 100644
--- a/core/app/DigikamCoreTarget.cmake
+++ b/core/app/DigikamCoreTarget.cmake
@@ -151,7 +151,7 @@ target_link_libraries(digikamcore
${TIFF_LIBRARIES}
PNG::PNG
${JPEG_LIBRARIES}
- exiv2lib
+ LibExiv2::LibExiv2
${OPENMP_LDFLAGS}
diff --git a/core/libs/metadataengine/CMakeLists.txt b/core/libs/metadataengine/CMakeLists.txt
index 47aa889..e9c01e5 100644
--- a/core/libs/metadataengine/CMakeLists.txt
+++ b/core/libs/metadataengine/CMakeLists.txt
@@ -111,8 +111,6 @@ include_directories(
$<TARGET_PROPERTY:KF5::ConfigCore,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:KF5::I18n,INTERFACE_INCLUDE_DIRECTORIES>
-
- $<TARGET_PROPERTY:exiv2lib,INTERFACE_INCLUDE_DIRECTORIES>
)
# Used by digikamcore
@@ -123,6 +121,12 @@ target_compile_definitions(core_dmetadata_obj
digikamcore_EXPORTS
)
+if (LibExiv2_VERSION VERSION_LESS 0.28.0)
+ set(EXIV2_CXX_STANDARD 11)
+else()
+ set(EXIV2_CXX_STANDARD 17)
+endif()
+
if(NOT Qt6_FOUND)
set_target_properties(core_dmetadata_obj
--
2.42.1