Skip to content

Commit

Permalink
Rewrite quazip detect to exactly match qt version
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellMorgenstern committed Dec 12, 2023
1 parent 86db727 commit af2c566
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 55 deletions.
69 changes: 16 additions & 53 deletions pri/quazipdetect.pri
Original file line number Diff line number Diff line change
@@ -1,66 +1,29 @@
# Copyright (c) 2021 Fritzing GmbH
# Copyright (c) 2021,2023 Fritzing GmbH

message("Using fritzing quazip detect script.")
message("Using Fritzing quazip detect script.")

QUAZIP_VERSION=1.4
QUAZIP_PATH=$$absolute_path($$PWD/../../quazip-$$QT_VERSION-$$QUAZIP_VERSION)
QUAZIP_INCLUDE_PATH=$$QUAZIP_PATH/include/QuaZip-Qt6-$$QUAZIP_VERSION
QUAZIP_LIB_PATH=$$QUAZIP_PATH/lib

SOURCES += \
src/zlibdummy.c \
src/zlibdummy.c \

!macx {
exists($$absolute_path($$PWD/../../quazip_qt$$QT_MAJOR_VERSION)) {
QUAZIPPATH = $$absolute_path($$PWD/../../quazip_qt$$QT_MAJOR_VERSION)
message("found quazip in $${QUAZIPPATH}")
exists($$QUAZIP_PATH) {
message("found quazip in $${QUAZIP_PATH}")
} else {
error("quazip could not be found.")
error("quazip could not be found at $$QUAZIP_PATH")
}

message("including $$absolute_path($${QUAZIPPATH}/include/quazip)")
}
INCLUDEPATH += $$QUAZIP_INCLUDE_PATH
LIBS += -L$$QUAZIP_LIB_PATH -lquazip1-qt$$QT_MAJOR_VERSION

unix:!macx {
message("including quazip library on linux")
INCLUDEPATH += $$absolute_path($${QUAZIPPATH}/include/quazip)
LIBS += -L$$absolute_path($${QUAZIPPATH}/lib) -lquazip1-qt$$QT_MAJOR_VERSION
QMAKE_RPATHDIR += $$absolute_path($${QUAZIPPATH}/lib)
unix {
message("set rpath for quazip")
QMAKE_RPATHDIR += $$QUAZIP_LIB_PATH
}

macx {
QUAZIP_VERSION=1.4
QUAZIP_PATH=$$absolute_path($$PWD/../../quazip-$$QT_VERSION-$$QUAZIP_VERSION)
QUAZIP_INCLUDE_PATH=$$QUAZIP_PATH/include/QuaZip-Qt6-$$QUAZIP_VERSION/quazip
QUAZIP_LIB_PATH=$$QUAZIP_PATH/lib

message("including quazip library on mac os")
INCLUDEPATH += $$QUAZIP_INCLUDE_PATH
LIBS += -L$$QUAZIP_LIB_PATH -lquazip1-qt$$QT_MAJOR_VERSION
QMAKE_RPATHDIR += $$QUAZIP_LIB_PATH
LIBS += -lz
}

win32 {

message("including quazip library on windows")

QUAZIPINCLUDE = $$absolute_path($${QUAZIPPATH}/include/quazip)
exists($$QUAZIPINCLUDE/quazip.h) {
message("found quazip include path at $$QUAZIPINCLUDE")
} else {
message("Fritzing requires quazip")
error("quazip include path not found in $$QUAZIPINCLUDE")
}

INCLUDEPATH += $$QUAZIPINCLUDE

contains(QMAKE_TARGET.arch, x86_64) {
QUAZIPLIB = $$absolute_path($$QUAZIPPATH/build64/Release)
} else {
QUAZIPLIB = $$absolute_path($$QUAZIPPATH/build32/Release)
}

exists($$QUAZIPLIB/quazip1-qt*) {
message("found quazip library in $$QUAZIPLIB")
} else {
error("quazip library not found in $$QUAZIPLIB")
}

LIBS += -L$$QUAZIPLIB -lquazip1-qt$$QT_MAJOR_VERSION
}
4 changes: 2 additions & 2 deletions src/utils/folderutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#include <QStandardPaths>

#include "../debugdialog.h"
#include <quazip.h>
#include <quazipfile.h>
#include <quazip/quazip.h>
#include <quazip/quazipfile.h>


FolderUtils* FolderUtils::singleton = nullptr;
Expand Down

0 comments on commit af2c566

Please sign in to comment.