From af2c5663c4767afaf572963fa0652573575ab1c1 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Tue, 14 Nov 2023 15:24:46 +0100 Subject: [PATCH] Rewrite quazip detect to exactly match qt version --- pri/quazipdetect.pri | 69 +++++++++------------------------------ src/utils/folderutils.cpp | 4 +-- 2 files changed, 18 insertions(+), 55 deletions(-) diff --git a/pri/quazipdetect.pri b/pri/quazipdetect.pri index a44799f15..07bd5621c 100644 --- a/pri/quazipdetect.pri +++ b/pri/quazipdetect.pri @@ -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 -} diff --git a/src/utils/folderutils.cpp b/src/utils/folderutils.cpp index 099e9bfb8..c494ef444 100644 --- a/src/utils/folderutils.cpp +++ b/src/utils/folderutils.cpp @@ -35,8 +35,8 @@ along with Fritzing. If not, see . #include #include "../debugdialog.h" -#include -#include +#include +#include FolderUtils* FolderUtils::singleton = nullptr;