From 4b52b7be7f49830fbe59e7ea27e27b9e9b069e68 Mon Sep 17 00:00:00 2001 From: nirvn Date: Wed, 7 Jul 2021 09:50:07 +0700 Subject: [PATCH] Move QgsExifTools utility class to core --- CMakeLists.txt | 2 ++ python/analysis/analysis_auto.sip | 1 - .../auto_generated/raster/qgsexiftools.sip.in | 4 ++-- python/core/core_auto.sip | 1 + src/analysis/CMakeLists.txt | 9 --------- src/core/CMakeLists.txt | 4 ++++ src/{analysis => core}/raster/qgsexiftools.cpp | 0 src/{analysis => core}/raster/qgsexiftools.h | 4 ++-- 8 files changed, 11 insertions(+), 14 deletions(-) rename python/{analysis => core}/auto_generated/raster/qgsexiftools.sip.in (95%) rename src/{analysis => core}/raster/qgsexiftools.cpp (100%) rename src/{analysis => core}/raster/qgsexiftools.h (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b0351eeb56..2f15a56eb76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -356,6 +356,8 @@ if(WITH_CORE) find_package(ZLIB REQUIRED) # for decompression of vector tiles in MBTiles file message(STATUS "Found zlib: ${ZLIB_LIBRARIES}") + find_package(EXIV2 REQUIRED) + # optional if (WITH_POSTGRESQL) find_package(Postgres) # PostgreSQL provider diff --git a/python/analysis/analysis_auto.sip b/python/analysis/analysis_auto.sip index 3d60027a390..39cc162c4ef 100644 --- a/python/analysis/analysis_auto.sip +++ b/python/analysis/analysis_auto.sip @@ -22,7 +22,6 @@ %Include auto_generated/raster/qgsalignraster.sip %Include auto_generated/raster/qgsaspectfilter.sip %Include auto_generated/raster/qgsderivativefilter.sip -%Include auto_generated/raster/qgsexiftools.sip %Include auto_generated/raster/qgshillshadefilter.sip %Include auto_generated/raster/qgskde.sip %Include auto_generated/raster/qgsninecellfilter.sip diff --git a/python/analysis/auto_generated/raster/qgsexiftools.sip.in b/python/core/auto_generated/raster/qgsexiftools.sip.in similarity index 95% rename from python/analysis/auto_generated/raster/qgsexiftools.sip.in rename to python/core/auto_generated/raster/qgsexiftools.sip.in index 34d272d7aee..1e5941062df 100644 --- a/python/analysis/auto_generated/raster/qgsexiftools.sip.in +++ b/python/core/auto_generated/raster/qgsexiftools.sip.in @@ -1,7 +1,7 @@ /************************************************************************ * This file has been generated automatically from * * * - * src/analysis/raster/qgsexiftools.h * + * src/core/raster/qgsexiftools.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/ @@ -80,7 +80,7 @@ Returns ``True`` if writing was successful. /************************************************************************ * This file has been generated automatically from * * * - * src/analysis/raster/qgsexiftools.h * + * src/core/raster/qgsexiftools.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/ diff --git a/python/core/core_auto.sip b/python/core/core_auto.sip index 01b1eba3a9f..49711d3f18f 100644 --- a/python/core/core_auto.sip +++ b/python/core/core_auto.sip @@ -528,6 +528,7 @@ %Include auto_generated/raster/qgscontrastenhancement.sip %Include auto_generated/raster/qgscontrastenhancementfunction.sip %Include auto_generated/raster/qgscubicrasterresampler.sip +%Include auto_generated/raster/qgsexiftools.sip %Include auto_generated/raster/qgshillshaderenderer.sip %Include auto_generated/raster/qgshuesaturationfilter.sip %Include auto_generated/raster/qgslinearminmaxenhancement.sip diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt index cc05dc8b349..1efc1557397 100644 --- a/src/analysis/CMakeLists.txt +++ b/src/analysis/CMakeLists.txt @@ -229,7 +229,6 @@ set(QGIS_ANALYSIS_SRCS processing/qgsreclassifyutils.cpp raster/qgsalignraster.cpp - raster/qgsexiftools.cpp raster/qgsninecellfilter.cpp raster/qgsruggednessfilter.cpp raster/qgsderivativefilter.cpp @@ -341,7 +340,6 @@ set(QGIS_ANALYSIS_HDRS raster/qgsalignraster.h raster/qgsaspectfilter.h raster/qgsderivativefilter.h - raster/qgsexiftools.h raster/qgshillshadefilter.h raster/qgskde.h raster/qgsninecellfilter.h @@ -404,8 +402,6 @@ if(TARGET Qt5::PrintSupport) ) endif() -find_package(EXIV2 REQUIRED) - include_directories(SYSTEM ${SPATIALITE_INCLUDE_DIR}) include_directories(SYSTEM ${SPATIALINDEX_INCLUDE_DIR}) include_directories(SYSTEM ${SQLITE3_INCLUDE_DIR}) @@ -481,10 +477,6 @@ target_include_directories(qgis_analysis PUBLIC ${CMAKE_BINARY_DIR}/src/analysis ) -target_include_directories(qgis_analysis SYSTEM PUBLIC - ${EXIV2_INCLUDE_DIR} -) - GENERATE_EXPORT_HEADER( qgis_analysis BASE_NAME ANALYSIS @@ -529,7 +521,6 @@ endif() target_link_libraries( qgis_analysis qgis_core - ${EXIV2_LIBRARY} ) if(HAVE_GSL) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 86ce378395f..8de50614ee0 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -615,6 +615,7 @@ set(QGIS_CORE_SRCS raster/qgscolorrampshader.cpp raster/qgscontrastenhancement.cpp raster/qgscontrastenhancementfunction.cpp + raster/qgsexiftools.cpp raster/qgslinearminmaxenhancement.cpp raster/qgslinearminmaxenhancementwithclip.cpp raster/qgsraster.cpp @@ -1561,6 +1562,7 @@ set(QGIS_CORE_HDRS raster/qgscontrastenhancement.h raster/qgscontrastenhancementfunction.h raster/qgscubicrasterresampler.h + raster/qgsexiftools.h raster/qgshillshaderenderer.h raster/qgshuesaturationfilter.h raster/qgslinearminmaxenhancement.h @@ -1883,6 +1885,7 @@ target_include_directories(qgis_core SYSTEM PUBLIC ${${QT_VERSION_BASE}SerialPort_INCLUDE_DIRS} ${Protobuf_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} + ${EXIV2_INCLUDE_DIR} ) if (WITH_SPATIALITE) @@ -2052,6 +2055,7 @@ target_link_libraries(qgis_core ${LIBZIP_LIBRARY} ${Protobuf_LITE_LIBRARY} ${ZLIB_LIBRARIES} + ${EXIV2_LIBRARY} ) if (WITH_SPATIALITE) diff --git a/src/analysis/raster/qgsexiftools.cpp b/src/core/raster/qgsexiftools.cpp similarity index 100% rename from src/analysis/raster/qgsexiftools.cpp rename to src/core/raster/qgsexiftools.cpp diff --git a/src/analysis/raster/qgsexiftools.h b/src/core/raster/qgsexiftools.h similarity index 97% rename from src/analysis/raster/qgsexiftools.h rename to src/core/raster/qgsexiftools.h index cd215b58549..16c3d568b88 100644 --- a/src/analysis/raster/qgsexiftools.h +++ b/src/core/raster/qgsexiftools.h @@ -16,7 +16,7 @@ #ifndef QGSEXIFTOOLS_H #define QGSEXIFTOOLS_H -#include "qgis_analysis.h" +#include "qgis_core.h" #include "qgspointxy.h" #include @@ -29,7 +29,7 @@ * \ingroup analysis * \since QGIS 3.6 */ -class ANALYSIS_EXPORT QgsExifTools +class CORE_EXPORT QgsExifTools { Q_GADGET