From 9dc0d85c2d656799aab69bf4f8b57bd13501c628 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann <2039670+selmf@users.noreply.github.com> Date: Wed, 29 Apr 2015 13:12:22 +0200 Subject: [PATCH] Add support for libunarr detection and move include/detection logic to unarr-wrapper.pri --- YACReader/YACReader.pro | 7 +---- YACReaderLibrary/YACReaderLibrary.pro | 5 ---- compressed_archive/unarr/unarr-wrapper.pri | 27 ++++++++++++++++--- .../compressed_archive_test.pro | 20 -------------- 4 files changed, 24 insertions(+), 35 deletions(-) diff --git a/YACReader/YACReader.pro b/YACReader/YACReader.pro index 77f21926..b17ffb7f 100644 --- a/YACReader/YACReader.pro +++ b/YACReader/YACReader.pro @@ -223,12 +223,7 @@ exists (../compressed_archive/libp7zip) { Please check the compressed_archive folder for further instructions.) } } -} else { -exists (../compressed_archive/unarr/unarr-master) { - message(Found unarr source-code) - } -} - +} unix:!macx { #set install prefix if it's empty diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index 21265c48..b30f5d57 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -285,11 +285,6 @@ exists (../compressed_archive/libp7zip) { Please check the compressed_archive folder for further instructions.) } } -} else { - exists (../compressed_archive/unarr/unarr-master) { - message(Found unarr source code) - } -} unix:!macx { #set install prefix if it's empty diff --git a/compressed_archive/unarr/unarr-wrapper.pri b/compressed_archive/unarr/unarr-wrapper.pri index f4f630e9..4008abb7 100644 --- a/compressed_archive/unarr/unarr-wrapper.pri +++ b/compressed_archive/unarr/unarr-wrapper.pri @@ -6,8 +6,27 @@ HEADERS += $$PWD/extract_delegate.h \ SOURCES += $$PWD/compressed_archive.cpp \ -#static build (no lib) -include(unarr.pro) +unix:!macx:exists (/usr/include/unarr.h) { + message(Using system provided unarr installation) + LIBS+=-lunarr + } +else:macx:exists (../../dependencies/unarr/libunarr.dynlib) { + LIBS += -L../../dependencies/unarr/ -lunarr + } -#for system libunarr.so -#LIBS+=-lunarr \ No newline at end of file +else:win32:exists (../../dependencies/unarr/unarr.dll) { + LIBS += -L../../dependencies/unarr/ -lunarr + } + +else:exists ($$PWD/unarr-master) { + message(Found unarr source-code) + message(Unarr will be build as a part of YACReader) + + #qmake based unarr build system + #this should only be used for testing or as a last resort + include(unarr.pro) + } + else { + error(Missing dependency: unarr decrompression backend. Please install libunarr on your system\ + or provide a copy of the unarr source code in compressed_archive/unarr/unarr-master) + } \ No newline at end of file diff --git a/tests/compressed_archive_test/compressed_archive_test.pro b/tests/compressed_archive_test/compressed_archive_test.pro index dd9691b0..a6c55cc4 100644 --- a/tests/compressed_archive_test/compressed_archive_test.pro +++ b/tests/compressed_archive_test/compressed_archive_test.pro @@ -13,26 +13,6 @@ win32 { CONFIG -= embed_manifest_exe } -unix { - #these flags are probably redundant - #qmake tends to chose it's own flags and ignores system wide flags on unix - QMAKE_CXXFLAGS+= -std=c++11 -O2 -pipe -Wall -fomit-frame-pointer - QMAKE_CFLAGS+= -O2 -pipe -Wall -fomit-frame-pointer - - #this might need a little tweaking on mac os - !CONFIG(unarr){ - DEFINES += "LIBDIR=\\\"$$/usr/lib\\\"" - } - else{ - #make unarr use system zlib and bzip2 - #these are pretty much standard on unix - DEFINES += HAVE_ZLIB HAVE_BZIP2 NDEBUG - #add zlib and bz2 to libs - #we also need libm for mathematics - LIBS += -lbz2 -lz -lm - } - } - !CONFIG(unarr){ include(../../compressed_archive/wrapper.pri) } else {