Add use_unarr define macro to prevent checks for 7z on unarr enabled builds

This commit is contained in:
Felix Kauselmann 2015-04-29 13:49:50 +02:00
parent 9dc0d85c2d
commit 1beb1beb75
4 changed files with 12 additions and 3 deletions

View File

@ -285,6 +285,7 @@ exists (../compressed_archive/libp7zip) {
Please check the compressed_archive folder for further instructions.)
}
}
}
unix:!macx {
#set install prefix if it's empty

View File

@ -122,8 +122,8 @@ void LibraryCreator::processLibrary(const QString & source, const QString & targ
void LibraryCreator::run()
{
stopRunning = false;
//check for 7z lib
#ifndef use_unarr
//check for 7z lib
#if defined Q_OS_UNIX && !defined Q_OS_MAC
QLibrary *sevenzLib = new QLibrary(QString(LIBDIR)+"/p7zip/7z.so");
#else
@ -137,7 +137,7 @@ void LibraryCreator::run()
exit();
}
sevenzLib->deleteLater();
#endif
if(_mode == CREATOR)
{
QLOG_INFO() << "Starting to create new library ( " << _source << "," << _target << ")";

View File

@ -92,6 +92,7 @@ void logSystemAndConfig()
QLOG_INFO() << "SO : Unknown";
#endif
#ifndef use_unarr
#ifdef Q_OS_WIN
if(QLibrary::isLibrary(QApplication::applicationDirPath()+"/utils/7z.dll"))
#elif defined Q_OS_UNIX && !defined Q_OS_MAC
@ -102,6 +103,9 @@ void logSystemAndConfig()
QLOG_INFO() << "7z : found";
else
QLOG_ERROR() << "7z : not found";
#else
QLOG_INFO() << "using unarr decompression backend";
#endif
#if defined Q_OS_UNIX && !defined Q_OS_MAC
if(QFileInfo(QString(BINDIR)+"/qrencode").exists())
#else

View File

@ -9,13 +9,16 @@ SOURCES += $$PWD/compressed_archive.cpp \
unix:!macx:exists (/usr/include/unarr.h) {
message(Using system provided unarr installation)
LIBS+=-lunarr
DEFINES+=use_unarr
}
else:macx:exists (../../dependencies/unarr/libunarr.dynlib) {
LIBS += -L../../dependencies/unarr/ -lunarr
DEFINES+=use_unarr
}
else:win32:exists (../../dependencies/unarr/unarr.dll) {
LIBS += -L../../dependencies/unarr/ -lunarr
DEFINES+=use_unarr
}
else:exists ($$PWD/unarr-master) {
@ -25,6 +28,7 @@ else:exists ($$PWD/unarr-master) {
#qmake based unarr build system
#this should only be used for testing or as a last resort
include(unarr.pro)
DEFINES+=use_unarr
}
else {
error(Missing dependency: unarr decrompression backend. Please install libunarr on your system\