Skip to content

Commit

Permalink
pkg-config workaround for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kaniol-lck committed Jun 11, 2024
1 parent 67d6cfe commit 7eeb45b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 64 deletions.
73 changes: 13 additions & 60 deletions modmanager.pro
Original file line number Diff line number Diff line change
Expand Up @@ -411,37 +411,6 @@ win32: RC_ICONS = package/modmanager.ico
#dependencies
unix {
message("unix-like build")
equals(QT_MAJOR_VERSION,5){
exists(/usr/lib/x86_64-linux-gnu/libquazip5.a) {
LIBS += -L$$quote(/usr/lib/x86_64-linux-gnu) -lquazip5
} else {
LIBS += -lquazip1-qt5
}
INCLUDEPATH += \
/usr/include/QuaZip-Qt5-1.4/quazip \
/usr/include/QuaZip-Qt5-1.3/quazip \
/usr/include/QuaZip-Qt5-1.2/quazip \
/usr/include/QuaZip-Qt5-1.1/quazip \
/usr/include/quazip \
/usr/include/quazip5
}
equals(QT_MAJOR_VERSION,6){
exists(/usr/lib/x86_64-linux-gnu/libquazip6.a) {
LIBS += -L$$quote(/usr/lib/x86_64-linux-gnu) -lquazip6
} else {
LIBS += -lquazip1-qt6
}
INCLUDEPATH += \
/usr/include/QuaZip-Qt6-1.4/quazip \
/usr/include/QuaZip-Qt6-1.3/quazip \
/usr/include/QuaZip-Qt6-1.2/quazip \
/usr/include/QuaZip-Qt6-1.1/quazip \
/usr/include/quazip \
/usr/include/quazip6
}

INCLUDEPATH += /usr/include/aria2
LIBS += -L$$quote(/usr/local/lib) -laria2

message(HEADERS)
exists(/usr/include/KF5/KWindowSystem){
Expand All @@ -450,39 +419,23 @@ unix {
LIBS += -lKF5WindowSystem
INCLUDEPATH += /usr/include/KF5/KWindowSystem
}
}

macx {
message("macos build")
INCLUDEPATH += /usr/include/aria2
LIBS += -L$$quote(/usr/local/lib) -laria2
equals(QT_MAJOR_VERSION,5):INCLUDEPATH += /usr/include/QuaZip-Qt5-1.4/quazip
equals(QT_MAJOR_VERSION,6):INCLUDEPATH += /usr/include/QuaZip-Qt6-1.4/quazip
INCLUDEPATH += /usr/include/quazip
CONFIG += link_pkgconfig
equals(QT_MAJOR_VERSION, 5): PKGCONFIG += libaria2 quazip1-qt5
equals(QT_MAJOR_VERSION, 6): PKGCONFIG += libaria2 quazip1-qt6
}

win32 {
#native blur
LIBS += -ldwmapi
contains(QMAKE_HOST.arch, x86_64) {
message("win32 x86_64 build")
#For Qt5
equals(QT_MAJOR_VERSION,5): INCLUDEPATH += \
C:/msys64/mingw64/include/QuaZip-Qt5-1.4/quazip \
C:/msys64/mingw64/include/aria2
equals(QT_MAJOR_VERSION,5):LIBS += -L$$quote(C:/msys64/mingw64/bin) -laria2-0 -lquazip1-qt5

#For Qt6
equals(QT_MAJOR_VERSION,6): INCLUDEPATH += \
C:/msys64/mingw64/include/QuaZip-Qt6-1.4/quazip \
C:/msys64/mingw64/include/aria2

equals(QT_MAJOR_VERSION,6):LIBS += -L$$quote(C:/msys64/mingw64/bin) -laria2-0 -lquazip1-qt6

} else {
#Deprecated
message("win32 x86 build")
INCLUDEPATH += C:/msys64/mingw32/include
INCLUDEPATH += C:/msys64/mingw32/include/QuaZip-Qt5-1.4/quazip
LIBS += -L$$quote(C:/msys64/mingw32/bin) -laria2 -lquazip5
QMAKE_CXXFLAGS += $$system($$pkgConfigExecutable() --cflags libaria)
LIBS += $$system($$pkgConfigExecutable() --libs libaria2 | sed 's/\/lib\b/\/bin/' | sed 's/-laria2/-laria2-0/')
equals(QT_MAJOR_VERSION, 5){
QMAKE_CXXFLAGS += $$system($$pkgConfigExecutable() --cflags quazip1-qt5)
LIBS += $$system($$pkgConfigExecutable() --libs quazip1-qt5)
}
equals(QT_MAJOR_VERSION, 6){
QMAKE_CXXFLAGS += $$system($$pkgConfigExecutable() --cflags quazip1-qt6)
LIBS += $$system($$pkgConfigExecutable() --libs quazip1-qt6)
}
}
3 changes: 1 addition & 2 deletions src/download/qaria2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#include <QObject>
#include <QTimer>
#include <QUrl>
//#include <aria2/aria2.h>
#include<aria2.h>
#include <aria2/aria2.h>

class QAria2Downloader;

Expand Down
3 changes: 1 addition & 2 deletions src/download/qaria2downloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

#include "abstractdownloader.h"

//#include <aria2/aria2.h>
#include <aria2.h>
#include <aria2/aria2.h>

class QAria2Downloader : public AbstractDownloader
{
Expand Down

0 comments on commit 7eeb45b

Please sign in to comment.