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
|
From b4a1e98a83598072ea6d720ae4d56d380bee5a75 Mon Sep 17 00:00:00 2001
From: Petr Vanek <petr@yarpen.cz>
Date: Sun, 15 Nov 2020 19:15:59 +0100
Subject: [PATCH] fixed #569 Build fails with quazip 1.0 (#576)
---
cmake/Unix.cmake | 28 +++++++++++++++------
src/DkCore/DkBasicLoader.cpp | 4 +++
src/DkCore/DkImageContainer.cpp | 4 +++
src/DkCore/DkImageLoader.cpp | 6 ++++-
src/DkGui/DkDialog.cpp | 4 +++
5 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/cmake/Unix.cmake b/cmake/Unix.cmake
index 5567084b..c90ba320 100644
--- a/cmake/Unix.cmake
+++ b/cmake/Unix.cmake
@@ -102,14 +102,26 @@ unset(QT_ROOT CACHE)
if(ENABLE_QUAZIP)
if(USE_SYSTEM_QUAZIP)
- SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
-
- find_package(QuaZip5 QUIET)
- if(NOT QUAZIP_FOUND)
- message(FATAL_ERROR "QUAZIP not found. It's mandatory when used with ENABLE_QUAZIP enabled, you can also disable USE_SYSTEM_QUAZIP")
- else()
- add_definitions(-DWITH_QUAZIP)
- endif()
+ # Let's try QuaZip1 first (it's the bright future)
+ find_package(QuaZip-Qt5 QUIET)
+ if (QuaZip-Qt5_FOUND)
+ message(STATUS "QUAZIP: QuaZip-1 for Qt5 found")
+ set(QUAZIP_LIBRARIES QuaZip::QuaZip)
+ add_definitions(-DWITH_QUAZIP1)
+ else ()
+ message(WARNING "QUAZIP: 1.x not found. Trying to find 0.x")
+ # QuaZip < 1.0. This leg can be removed (including cmake/FindQuaZip5.cmake)
+ # ater the final migration to 1.x in Linux distros
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+
+ find_package(QuaZip5 QUIET)
+ if(NOT QUAZIP_FOUND)
+ message(FATAL_ERROR "QUAZIP: even 0.x not found. It's mandatory when used with ENABLE_QUAZIP enabled, you can also disable USE_SYSTEM_QUAZIP")
+ endif()
+
+ endif (QuaZip-Qt5_FOUND)
+ # we have any QuaZip after all
+ add_definitions(-DWITH_QUAZIP)
else()
find_package(ZLIB REQUIRED)
set(QUAZIP_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/quazip-0.7/quazip ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/quazip-0.7/)
diff --git a/src/DkCore/DkBasicLoader.cpp b/src/DkCore/DkBasicLoader.cpp
index 7f9e889c..b7edfd43 100644
--- a/src/DkCore/DkBasicLoader.cpp
+++ b/src/DkCore/DkBasicLoader.cpp
@@ -54,8 +54,12 @@
// quazip
#ifdef WITH_QUAZIP
+#ifdef WITH_QUAZIP1
+#include <quazip/JlCompress.h>
+#else
#include <quazip5/JlCompress.h>
#endif
+#endif
// opencv
#ifdef WITH_OPENCV
diff --git a/src/DkCore/DkImageContainer.cpp b/src/DkCore/DkImageContainer.cpp
index 810994d3..150da9c2 100644
--- a/src/DkCore/DkImageContainer.cpp
+++ b/src/DkCore/DkImageContainer.cpp
@@ -41,8 +41,12 @@
// quazip
#ifdef WITH_QUAZIP
+#ifdef WITH_QUAZIP1
+#include <quazip/JlCompress.h>
+#else
#include <quazip5/JlCompress.h>
#endif
+#endif
#pragma warning(pop) // no warnings from includes - end
#pragma warning(disable: 4251) // TODO: remove
diff --git a/src/DkCore/DkImageLoader.cpp b/src/DkCore/DkImageLoader.cpp
index 09d25d23..e4186f2b 100644
--- a/src/DkCore/DkImageLoader.cpp
+++ b/src/DkCore/DkImageLoader.cpp
@@ -79,8 +79,12 @@
// quazip
#ifdef WITH_QUAZIP
+#ifdef WITH_QUAZIP1
+#include <quazip/JlCompress.h>
+#else
#include <quazip5/JlCompress.h>
#endif
+#endif
// opencv
#ifdef WITH_OPENCV
@@ -2212,4 +2216,4 @@ QString DkImageLoader::fileName() const {
return mCurrentImage->fileName();
}
-}
\ No newline at end of file
+}
diff --git a/src/DkGui/DkDialog.cpp b/src/DkGui/DkDialog.cpp
index 008c9a3b..85842eca 100644
--- a/src/DkGui/DkDialog.cpp
+++ b/src/DkGui/DkDialog.cpp
@@ -97,8 +97,12 @@
// quazip
#ifdef WITH_QUAZIP
+#ifdef WITH_QUAZIP1
+#include <quazip/JlCompress.h>
+#else
#include <quazip5/JlCompress.h>
#endif
+#endif
#pragma warning(pop) // no warnings from includes - end
|