summaryrefslogtreecommitdiff
blob: d2b264e0175026dcfef7e3d2bd95ef1df1acbc37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
From 66b2c16c0dec865db9c3d1720385625d22fbf021 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Sat, 19 Jan 2019 23:17:32 +0100
Subject: [PATCH 1/4] Simplify CMakeLists.txt using FeatureSummary

---
 CMakeLists.txt | 192 +++++++++++++++++++------------------------------
 1 file changed, 75 insertions(+), 117 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9af47a75..1ffe7ff3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,8 @@ include(CMake/ListFilesResources.cmake)
 #### OPTIONS THAT CAN BE SET BY THE USER ####
 #############################################
 
+include(FeatureSummary)
+
 option(RAW "Use libraw library" ON)
 option(EXIV2 "Use exiv2 library" ON)
 option(GM "Use graphicsmagick library" ON)
@@ -65,35 +67,37 @@ option(TESTING "Enable some tests" OFF)
 #### FIND REQUIRED PACKAGES ####
 ################################
 
+find_package(Qt5 COMPONENTS Core Quick Svg Sql Xml LinguistTools REQUIRED)
+
 if(WIN32)
-    find_package(Qt5 COMPONENTS Core Quick Svg Sql Xml LinguistTools WinExtras REQUIRED)
-elseif(NOT WIN32)
-    find_package(Qt5 COMPONENTS Core Quick Svg Sql Xml LinguistTools REQUIRED)
-endif(WIN32)
+    find_package(Qt5WinExtras REQUIRED)
+endif()
 
 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
+
+find_package(LibArchive REQUIRED)
+
 if(GM)
-    find_package(Magick)
-endif(GM)
+    find_package(Magick REQUIRED)
+endif()
 if(EXIV2)
-    find_package(Exiv2)
-endif(EXIV2)
+    find_package(Exiv2 REQUIRED)
+endif()
 if(RAW)
-    find_package(LibRaw)
-endif(RAW)
+    find_package(LibRaw REQUIRED)
+endif()
 if(FREEIMAGE)
-    find_package(FreeImage)
-endif(FREEIMAGE)
-find_package(LibArchive)
+    find_package(FreeImage REQUIRED)
+endif()
 
 find_package(ECM REQUIRED NO_MODULE)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_MODULE_PATH}")
 if(POPPLER)
-    find_package(Poppler COMPONENTS Qt5)
-endif(POPPLER)
+    find_package(Poppler COMPONENTS Qt5 REQUIRED)
+endif()
 if(DEVIL)
-    find_package(DevIL)
-endif(DEVIL)
+    find_package(DevIL REQUIRED)
+endif()
 
 ####################################
 #### TRANSLATIONS AND RESOURCES ####
@@ -137,14 +141,14 @@ add_definitions(-DSIMPLECRYPTKEY="${CRYPTKEY}")
 #### Add the executeable ####
 #############################
 
+add_executable(${PROJECT_NAME} ${photoqt_SOURCES} ${photoqt_QML} ${RESOURCES})
+target_link_libraries(${PROJECT_NAME} Qt5::Quick Qt5::Sql Qt5::Svg Qt5::Core Qt5::Xml)
+
 # on windows we add application icons
 if(WIN32)
-    add_executable(${PROJECT_NAME} WIN32 ${photoqt_SOURCES} ${photoqt_QML} ${RESOURCES} windowsicons.rc)
-    target_link_libraries(${PROJECT_NAME} Qt5::Quick Qt5::Sql Qt5::Svg Qt5::Core Qt5::Xml Qt5::WinExtras)
-elseif(NOT WIN32)
-    add_executable(${PROJECT_NAME} ${photoqt_SOURCES} ${photoqt_QML} ${RESOURCES})
-    target_link_libraries(${PROJECT_NAME} Qt5::Quick Qt5::Sql Qt5::Svg Qt5::Core Qt5::Xml)
-endif(WIN32)
+    add_executable(${PROJECT_NAME} WIN32 windowsicons.rc)
+    target_link_libraries(${PROJECT_NAME} Qt5::WinExtras)
+endif()
 
 
 ########################
@@ -171,7 +175,7 @@ if(TESTING)
     # And inform the user
     message("** TESTING ENABLED")
 
-endif(TESTING)
+endif()
 
 
 ##############################################
@@ -186,112 +190,65 @@ composeDesktopFile()
 #### CUSTOM OPTIONS ####
 ########################
 
-if(NOT ${LibArchive_FOUND})
-    message(FATAL_ERROR "** Unable to locate LibArchive... is it installed?")
-elseif(${LibArchive_FOUND})
-    include_directories(${LibArchive_INCLUDE_DIRS})
-    target_link_libraries(${PROJECT_NAME} ${LibArchive_LIBRARIES})
-    message("** Found LibArchive " ${LibArchive_VERSION})
-endif(NOT ${LibArchive_FOUND})
+include_directories(${LibArchive_INCLUDE_DIRS})
+target_link_libraries(${PROJECT_NAME} ${LibArchive_LIBRARIES})
 
 if(POPPLER)
-    if(NOT ${Poppler_FOUND})
-        message(FATAL_ERROR "** Unable to locate Poppler... is it installed?")
-    elseif(${Poppler_FOUND})
-        include_directories(${Poppler_INCLUDE_DIRS})
-        target_link_libraries(${PROJECT_NAME} ${Poppler_LIBRARIES})
-        message("** Poppler enabled")
-        add_definitions(-DPOPPLER)
-    endif(NOT ${Poppler_FOUND})
-elseif(NOT POPPLER)
-    message("** Poppler DISABLED")
-endif(POPPLER)
+    include_directories(${Poppler_INCLUDE_DIRS})
+    target_link_libraries(${PROJECT_NAME} ${Poppler_LIBRARIES})
+    add_definitions(-DPOPPLER)
+endif()
 
 if(DEVIL)
-    if(NOT ${IL_FOUND})
-        message(FATAL_ERROR "** Unable to locate DevIL... is it installed?")
-    elseif(${IL_FOUND})
-        include_directories(${IL_INCLUDE_DIR})
-        target_link_libraries(${PROJECT_NAME} ${IL_LIBRARIES})
-        message("** DevIL enabled")
-        add_definitions(-DDEVIL)
-    endif(NOT ${IL_FOUND})
-elseif(NOT DEVIL)
-    message("** DevIL DISABLED")
-endif(DEVIL)
+    include_directories(${IL_INCLUDE_DIR})
+    target_link_libraries(${PROJECT_NAME} ${IL_LIBRARIES})
+    add_definitions(-DDEVIL)
+endif()
 
 if(FREEIMAGE)
-    if(NOT ${FREEIMAGE_FOUND})
-        message(FATAL_ERROR "** Unable to locate FreeImage... is it installed?")
-    elseif(${FREEIMAGE_FOUND})
-        include_directories(${FREEIMAGE_INCLUDE_DIRS})
-        target_link_libraries(${PROJECT_NAME} ${FREEIMAGE_LIBRARIES})
-        message("** FreeImage enabled")
-        add_definitions(-DFREEIMAGE)
-    endif(NOT ${FREEIMAGE_FOUND})
-elseif(NOT FREEIMAGE)
-    message("** FreeImage DISABLED")
-endif(FREEIMAGE)
+    include_directories(${FREEIMAGE_INCLUDE_DIRS})
+    target_link_libraries(${PROJECT_NAME} ${FREEIMAGE_LIBRARIES})
+    add_definitions(-DFREEIMAGE)
+endif()
 
 if(RAW)
-    if(NOT ${LIBRAW_FOUND})
-        message(FATAL_ERROR "** Unable to locate LibRaw... is it installed?")
-    elseif(${LIBRAW_FOUND})
-        include_directories(${LIBRAW_INCLUDE_DIR})
-        target_link_libraries(${PROJECT_NAME} "raw")
-        message("** LibRaw enabled")
-        add_definitions(-DRAW)
-    endif(NOT ${LIBRAW_FOUND})
-elseif(NOT RAW)
-    message("** LibRaw DISABLED")
-endif(RAW)
+    include_directories(${LIBRAW_INCLUDE_DIR})
+    target_link_libraries(${PROJECT_NAME} "raw")
+    add_definitions(-DRAW)
+endif()
 
 if(EXIV2)
-    if(NOT ${EXIV2_FOUND})
-        message(FATAL_ERROR "** Unable to locate Exiv2... is it installed?")
-    elseif(${EXIV2_FOUND})
-        include_directories(${EXIV2_INCLUDE_DIR})
-        target_link_libraries(${PROJECT_NAME} "exiv2")
+    include_directories(${EXIV2_INCLUDE_DIR})
+    target_link_libraries(${PROJECT_NAME} "exiv2")
+    if(TESTING)
+        target_link_libraries(${PROJECT_TEST_NAME} "exiv2")
+    endif()
+    if(WIN32)
+        target_link_libraries(${PROJECT_NAME} "expat")
+        target_link_libraries(${PROJECT_NAME} "ws2_32")
+        target_link_libraries(${PROJECT_NAME} "wsock32")
+        target_link_libraries(${PROJECT_NAME} "z")
+        target_link_libraries(${PROJECT_NAME} "intl")
+        target_link_libraries(${PROJECT_NAME} "iconv")
+        target_link_libraries(${PROJECT_NAME} "psapi")
         if(TESTING)
-            target_link_libraries(${PROJECT_TEST_NAME} "exiv2")
-        endif(TESTING)
-        if(WIN32)
-            target_link_libraries(${PROJECT_NAME} "expat")
-            target_link_libraries(${PROJECT_NAME} "ws2_32")
-            target_link_libraries(${PROJECT_NAME} "wsock32")
-            target_link_libraries(${PROJECT_NAME} "z")
-            target_link_libraries(${PROJECT_NAME} "intl")
-            target_link_libraries(${PROJECT_NAME} "iconv")
-            target_link_libraries(${PROJECT_NAME} "psapi")
-            if(TESTING)
-                target_link_libraries(${PROJECT_TEST_NAME} "expat")
-                target_link_libraries(${PROJECT_TEST_NAME} "ws2_32")
-                target_link_libraries(${PROJECT_TEST_NAME} "wsock32")
-                target_link_libraries(${PROJECT_TEST_NAME} "z")
-                target_link_libraries(${PROJECT_TEST_NAME} "intl")
-                target_link_libraries(${PROJECT_TEST_NAME} "iconv")
-                target_link_libraries(${PROJECT_TEST_NAME} "psapi")
-            endif(TESTING)
-        endif(WIN32)
-        add_definitions(-DEXIV2)
-        message("** Exiv2 enabled")
-    endif(NOT ${EXIV2_FOUND})
-elseif(NOT EXIV2)
-        message("** Exiv2 DISABLED")
-endif(EXIV2)
+            target_link_libraries(${PROJECT_TEST_NAME} "expat")
+            target_link_libraries(${PROJECT_TEST_NAME} "ws2_32")
+            target_link_libraries(${PROJECT_TEST_NAME} "wsock32")
+            target_link_libraries(${PROJECT_TEST_NAME} "z")
+            target_link_libraries(${PROJECT_TEST_NAME} "intl")
+            target_link_libraries(${PROJECT_TEST_NAME} "iconv")
+            target_link_libraries(${PROJECT_TEST_NAME} "psapi")
+        endif()
+    endif()
+    add_definitions(-DEXIV2)
+endif()
 
 if(GM)
-    if(NOT ${MAGICK++_FOUND})
-        message(FATAL_ERROR "** Unable to locate GraphicsMagick... is it installed?")
-    elseif(${MAGICK++_FOUND})
-        include_directories(${MAGICK++_INCLUDE_DIR})
-        target_link_libraries(${PROJECT_NAME} "GraphicsMagick++")
-        add_definitions(-DGM)
-        message("** Graphicsmagick enabled")
-    endif(NOT ${MAGICK++_FOUND})
-elseif(NOT GM)
-    message("** Graphicsmagick DISABLED")
-endif(GM)
+    include_directories(${MAGICK++_INCLUDE_DIR})
+    target_link_libraries(${PROJECT_NAME} "GraphicsMagick++")
+    add_definitions(-DGM)
+endif()
 
 
 #######################
@@ -339,6 +296,7 @@ if(UNIX)
     )
 endif(UNIX)
 
+feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
 
 ##########################
-- 
2.20.1


From b58268b06eb62de70da3ac751870114b07cd79e3 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Sun, 20 Jan 2019 17:49:09 +0100
Subject: [PATCH 2/4] Switch to FindLibExiv2 from ECM 5.54.0

Fixes detection of exiv2.
---
 CMake/FindLibExiv2.cmake | 115 +++++++++++++++++++++++++++++++++++++++
 CMakeLists.txt           |   7 +--
 create mode 100644 CMake/FindLibExiv2.cmake

diff --git a/CMake/FindLibExiv2.cmake b/CMake/FindLibExiv2.cmake
new file mode 100644
index 00000000..935cee2c
--- /dev/null
+++ b/CMake/FindLibExiv2.cmake
@@ -0,0 +1,115 @@
+#.rst:
+# FindLibExiv2
+# ------------
+#
+# Try to find the Exiv2 library.
+#
+# This will define the following variables:
+#
+# ``LibExiv2_FOUND``
+#     System has LibExiv2.
+#
+# ``LibExiv2_VERSION``
+#     The version of LibExiv2.
+#
+# ``LibExiv2_INCLUDE_DIRS``
+#     This should be passed to target_include_directories() if
+#     the target is not used for linking.
+#
+# ``LibExiv2_LIBRARIES``
+#     The LibExiv2 library.
+#     This can be passed to target_link_libraries() instead of
+#     the ``LibExiv2::LibExiv2`` target
+#
+# If ``LibExiv2_FOUND`` is TRUE, the following imported target
+# will be available:
+#
+# ``LibExiv2::LibExiv2``
+#     The Exiv2 library
+#
+# Since 5.53.0.
+#
+#=============================================================================
+# Copyright (c) 2018, Christophe Giboudeaux, <christophe@krop.fr>
+# Copyright (c) 2010, Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+#    derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#=============================================================================
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_EXIV2 QUIET exiv2)
+
+find_path(LibExiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp
+    HINTS ${PC_EXIV2_INCLUDEDIR}
+)
+
+find_library(LibExiv2_LIBRARIES NAMES exiv2 libexiv2
+    HINTS ${PC_EXIV2_LIBRARY_DIRS}
+)
+
+set(LibExiv2_VERSION ${PC_EXIV2_VERSION})
+
+if(NOT LibExiv2_VERSION AND DEFINED LibExiv2_INCLUDE_DIRS)
+    # With exiv >= 0.27, the version #defines are in exv_conf.h instead of version.hpp
+    foreach(_exiv2_version_file "version.hpp" "exv_conf.h")
+        if(EXISTS "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}")
+            file(READ "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}" _exiv_version_file_content)
+            string(REGEX MATCH "#define EXIV2_MAJOR_VERSION[ ]+\\([0-9]+\\)" EXIV2_MAJOR_VERSION_MATCH ${_exiv_version_file_content})
+            string(REGEX MATCH "#define EXIV2_MINOR_VERSION[ ]+\\([0-9]+\\)" EXIV2_MINOR_VERSION_MATCH ${_exiv_version_file_content})
+            string(REGEX MATCH "#define EXIV2_PATCH_VERSION[ ]+\\([0-9]+\\)" EXIV2_PATCH_VERSION_MATCH ${_exiv_version_file_content})
+            if(EXIV2_MAJOR_VERSION_MATCH)
+                string(REGEX REPLACE ".*_MAJOR_VERSION[ ]+\\((.*)\\)" "\\1" EXIV2_MAJOR_VERSION ${EXIV2_MAJOR_VERSION_MATCH})
+                string(REGEX REPLACE ".*_MINOR_VERSION[ ]+\\((.*)\\)" "\\1" EXIV2_MINOR_VERSION ${EXIV2_MINOR_VERSION_MATCH})
+                string(REGEX REPLACE ".*_PATCH_VERSION[ ]+\\((.*)\\)" "\\1"  EXIV2_PATCH_VERSION  ${EXIV2_PATCH_VERSION_MATCH})
+            endif()
+        endif()
+    endforeach()
+
+    set(LibExiv2_VERSION "${EXIV2_MAJOR_VERSION}.${EXIV2_MINOR_VERSION}.${EXIV2_PATCH_VERSION}")
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibExiv2
+    FOUND_VAR LibExiv2_FOUND
+    REQUIRED_VARS  LibExiv2_LIBRARIES LibExiv2_INCLUDE_DIRS
+    VERSION_VAR  LibExiv2_VERSION
+)
+
+mark_as_advanced(LibExiv2_INCLUDE_DIRS LibExiv2_LIBRARIES)
+
+if(LibExiv2_FOUND AND NOT TARGET LibExiv2::LibExiv2)
+    add_library(LibExiv2::LibExiv2 UNKNOWN IMPORTED)
+    set_target_properties(LibExiv2::LibExiv2 PROPERTIES
+        IMPORTED_LOCATION "${LibExiv2_LIBRARIES}"
+        INTERFACE_INCLUDE_DIRECTORIES "${LibExiv2_INCLUDE_DIRS}"
+    )
+endif()
+
+include(FeatureSummary)
+set_package_properties(LibExiv2 PROPERTIES
+    URL "http://www.exiv2.org"
+    DESCRIPTION "Image metadata support"
+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ffe7ff3..b96b21db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,7 +81,7 @@ if(GM)
     find_package(Magick REQUIRED)
 endif()
 if(EXIV2)
-    find_package(Exiv2 REQUIRED)
+    find_package(LibExiv2 REQUIRED)
 endif()
 if(RAW)
     find_package(LibRaw REQUIRED)
@@ -218,10 +218,9 @@ if(RAW)
 endif()
 
 if(EXIV2)
-    include_directories(${EXIV2_INCLUDE_DIR})
-    target_link_libraries(${PROJECT_NAME} "exiv2")
+    target_link_libraries(${PROJECT_NAME} LibExiv2::LibExiv2)
     if(TESTING)
-        target_link_libraries(${PROJECT_TEST_NAME} "exiv2")
+        target_link_libraries(${PROJECT_TEST_NAME} LibExiv2::LibExiv2)
     endif()
     if(WIN32)
         target_link_libraries(${PROJECT_NAME} "expat")
-- 
2.20.1


From f2a675ea5496febae1daee229ad132086dec24bc Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Sun, 20 Jan 2019 18:25:45 +0100
Subject: [PATCH 3/4] Fix build with exiv2-0.27

---
 cplusplus/scripts/getanddostuff/manipulation.h | 3 +--
 cplusplus/scripts/getmetadata.cpp              | 4 ++--
 cplusplus/scripts/getmetadata.h                | 3 +--
 cplusplus/scripts/managepeopletags.cpp         | 4 ++--
 cplusplus/scripts/managepeopletags.h           | 3 +--
 5 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/cplusplus/scripts/getanddostuff/manipulation.h b/cplusplus/scripts/getanddostuff/manipulation.h
index b3fa9b42..465d9372 100644
--- a/cplusplus/scripts/getanddostuff/manipulation.h
+++ b/cplusplus/scripts/getanddostuff/manipulation.h
@@ -38,8 +38,7 @@
 #include "../../logger.h"
 
 #ifdef EXIV2
-#include <exiv2/image.hpp>
-#include <exiv2/exif.hpp>
+#include <exiv2/exiv2.hpp>
 #endif
 
 class GetAndDoStuffManipulation : public QObject {
diff --git a/cplusplus/scripts/getmetadata.cpp b/cplusplus/scripts/getmetadata.cpp
index deb89a25..df92de6b 100644
--- a/cplusplus/scripts/getmetadata.cpp
+++ b/cplusplus/scripts/getmetadata.cpp
@@ -203,7 +203,7 @@ QVariantMap GetMetaData::getExiv2(QString path) {
                 }
 
             } catch(Exiv2::Error &e) {
-                LOG << CURDATE << "GetMetaData::getExiv2() Unable to read Exif metadata: " << e << " (" << Exiv2::errMsg(e.code()) << ")" << NL;
+                LOG << CURDATE << "GetMetaData::getExiv2() Unable to read Exif metadata: " << e.what() << NL;
             }
 
             // If GPS is set, compose into one string
@@ -246,7 +246,7 @@ QVariantMap GetMetaData::getExiv2(QString path) {
                 }
 
             } catch(Exiv2::Error &e) {
-                LOG << CURDATE << "GetMetaData::getExiv2() ERROR reading IPTC metadata: " << e << " (" << Exiv2::errMsg(e.code()) << ")" << NL;
+                LOG << CURDATE << "GetMetaData::getExiv2() ERROR reading IPTC metadata: " << e.what() << NL;
             }
 
             QString city = returnMap["Iptc.Application2.City"].toString();
diff --git a/cplusplus/scripts/getmetadata.h b/cplusplus/scripts/getmetadata.h
index e427cbc1..c5b99140 100644
--- a/cplusplus/scripts/getmetadata.h
+++ b/cplusplus/scripts/getmetadata.h
@@ -34,8 +34,7 @@
 #include "../logger.h"
 
 #ifdef EXIV2
-#include <exiv2/image.hpp>
-#include <exiv2/exif.hpp>
+#include <exiv2/exiv2.hpp>
 #endif
 
 class GetMetaData : public QObject {
diff --git a/cplusplus/scripts/managepeopletags.cpp b/cplusplus/scripts/managepeopletags.cpp
index 9b8c7503..96baeb9e 100644
--- a/cplusplus/scripts/managepeopletags.cpp
+++ b/cplusplus/scripts/managepeopletags.cpp
@@ -98,7 +98,7 @@ QVariantList ManagePeopleTags::getFaceTags(QString path) {
 
     } catch(Exiv2::Error& e) {
         LOG << CURDATE << "GetPeopleTag::getPeopleLocations() 2 - ERROR reading exiv data (caught exception): "
-            << e << " (" << Exiv2::errMsg(e.code()) << ")" << NL;
+            << e.what() << NL;
         return ret;
     }
 
@@ -201,7 +201,7 @@ void ManagePeopleTags::setFaceTags(QString filename, QVariantList tags) {
 
     } catch(Exiv2::Error& e) {
         LOG << CURDATE << "GetPeopleTag::setFaceTags() - ERROR reading exiv data (caught exception): "
-            << e << " (" << Exiv2::errMsg(e.code()) << ")" << NL;
+            << e.what() << NL;
         return;
     }
 
diff --git a/cplusplus/scripts/managepeopletags.h b/cplusplus/scripts/managepeopletags.h
index 1908ba0a..59686cc1 100644
--- a/cplusplus/scripts/managepeopletags.h
+++ b/cplusplus/scripts/managepeopletags.h
@@ -29,8 +29,7 @@
 #include "../logger.h"
 
 #ifdef EXIV2
-#include <exiv2/image.hpp>
-#include <exiv2/exif.hpp>
+#include <exiv2/exiv2.hpp>
 #endif
 
 class ManagePeopleTags : public QObject {
-- 
2.20.1