Chris@2: Chris@2: ### Chris@2: ### BEGIN CONFIGURABLE STUFF Chris@2: ### Chris@2: Chris@2: CONFIG += release Chris@2: Chris@2: Chris@2: # Put your favourite optimization flags here. Chris@2: # Chris@2: # Don't use -ffast-math -- it does make things faster, but it Chris@2: # prevents isnan and isinf from working, and we need those. Chris@2: # Chris@2: # SV benefits a bit from SSE, but not from SSE2 (it doesn't do Chris@2: # very much in double precision). Chris@2: # Chris@2: # Always define NDEBUG and NO_TIMING for release builds. Chris@2: # Chris@2: QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -DNO_TIMING -O3 Chris@2: #linux-g++:QMAKE_CXXFLAGS_RELEASE += -march=pentium3 -msse -mmmx -ftree-vectorize -fomit-frame-pointer Chris@2: Chris@2: # To do a static build with gcc on Linux Chris@2: # Chris@2: linux-g++:LIBS += -Wl,-Bstatic Chris@2: linux-g++:DEFINES += BUILD_STATIC Chris@2: Chris@2: Chris@2: LIBPATH += /usr/local/lib Chris@2: INCLUDEPATH += /usr/local/include Chris@2: Chris@2: DEFINES += NO_SV_GUI # avoid inclusion of widgets/ in transform library (bad!) Chris@2: Chris@2: Chris@2: # These are testable on platforms with pkg-config. If you don't have Chris@2: # pkg-config, edit the "If you don't have pkg-config" block below (see Chris@2: # comments). Chris@2: # Chris@2: PKGCONFIG_PACKAGES = vamp vamp-hostsdk oggz fishsound mad id3tag fftw3 fftw3f sndfile samplerate lrdf redland rasqal raptor Chris@2: Chris@2: Chris@2: # No pkg-config test for QuickTime. This library is optional, for Chris@2: # audio file import. Note that if you compile in support for either Chris@2: # or both of libmad and libsndfile as well as for QuickTime, libmad Chris@2: # and libsndfile will be used in preference to QuickTime where Chris@2: # applicable. For licensing reasons you may not redistribute binaries Chris@2: # of Sonic Visualiser built with QuickTime support, except for Chris@2: # platforms which include QuickTime as a standard part of the platform Chris@2: # (i.e. OS/X). Chris@2: # Chris@2: #DEFINES += HAVE_QUICKTIME Chris@2: #LIBS += -framework QuickTime Chris@2: Chris@2: Chris@2: !system(pkg-config --atleast-pkgconfig-version=0) { Chris@2: Chris@2: # If you don't have pkg-config, or want to overrule it, comment Chris@2: # out (or install) any of the following that you lack. If you Chris@2: # have pkg-config, you should be able to ignore all this provided Chris@2: # the right symbols are defined in PKGCONFIG_PACKAGES above. Chris@2: # Chris@2: DEFINES += HAVE_OGGZ # Optional -- to import .ogg files Chris@2: DEFINES += HAVE_FISHSOUND # Optional -- to import .ogg files Chris@2: DEFINES += HAVE_MAD # Optional -- to import .mp3 files Chris@2: DEFINES += HAVE_ID3TAG # Optional -- to import .mp3 file tags Chris@2: DEFINES += HAVE_FFTW3F # Optional -- but SV will be slower without it Chris@2: DEFINES += HAVE_FFTW3 # Optional -- used by Rubber Band Chris@2: # Chris@2: LIBS += -loggz -lfishsound Chris@2: LIBS += -lmad -lid3tag Chris@2: LIBS += -lfftw3f Chris@2: LIBS += -lfftw3 Chris@2: Chris@2: # These ones are mandatory. Chris@2: # If you don't have them, you'll have to find them. Chris@2: # Chris@2: DEFINES += HAVE_VAMP # Required -- for analysis plugins Chris@2: DEFINES += HAVE_VAMP_HOSTSDK # Required -- for analysis plugins Chris@2: DEFINES += HAVE_SNDFILE # Required -- to import and export .wav files Chris@2: DEFINES += HAVE_SAMPLERATE # Required -- for resampling Chris@2: DEFINES += HAVE_RASQAL # Required -- for RDF Chris@2: DEFINES += HAVE_REDLAND # Required -- for RDF Chris@2: # Chris@2: LIBS += -lvamp-hostsdk -lsndfile -lrdf -lrasqal -lraptor -lsamplerate Chris@2: Chris@2: } Chris@2: Chris@2: ### Chris@2: ### END CONFIGURABLE STUFF Chris@2: ### Chris@2: Chris@2: system(pkg-config --atleast-pkgconfig-version=0) { Chris@2: Chris@2: # If you have pkg-config, this block should locate all packages Chris@2: # for you provided they have .pc files and are listed in Chris@2: # PKGCONFIG_PACKAGES. Chris@2: # Chris@2: for(PKG, PKGCONFIG_PACKAGES) { Chris@2: contains(SV_UNIT_PACKAGES, $$PKG) { Chris@2: system(pkg-config --exists $$PKG) { Chris@2: VERSION = $$system(pkg-config --modversion $$PKG) Chris@2: PACKAGE_SYMBOL = $$system(echo $$PKG | tr '[a-z-]' '[A-Z_]' | tr '.' '_') Chris@2: VERSION_SYMBOL = $$PACKAGE_SYMBOL'_VERSION' Chris@2: DEFINES += HAVE_$$PACKAGE_SYMBOL Chris@2: QMAKE_CXXFLAGS += -D"'"$$VERSION_SYMBOL='"'$$VERSION'"'"'" Chris@2: QMAKE_CXXFLAGS += $$system(pkg-config --cflags $$PKG) Chris@2: LIBS += $$system(pkg-config --libs $$PKG) Chris@2: message("Using pkg-config package $$PKG with version $$VERSION") Chris@2: } else { Chris@2: message("WARNING: Failed to find pkg-config package $$PKG") Chris@2: } Chris@2: } Chris@2: } Chris@2: } Chris@2: Chris@2: contains(SV_UNIT_PACKAGES, oggz) { Chris@2: contains(DEFINES, HAVE_OGGZ) { Chris@2: contains(DEFINES, HAVE_FISHSOUND) { Chris@2: message("Including .ogg file import") Chris@2: } else { Chris@2: message("WARNING: .ogg file import will not be included") Chris@2: } Chris@2: } else { Chris@2: message("WARNING: .ogg file import will not be included") Chris@2: } Chris@2: } Chris@2: Chris@2: contains(SV_UNIT_PACKAGES, mad) { Chris@2: contains(DEFINES, HAVE_MAD) { Chris@2: message("Including .mp3 file import") Chris@2: } else { Chris@2: message("WARNING: .mp3 file import will not be included") Chris@2: } Chris@2: } Chris@2: Chris@2: contains(SV_UNIT_PACKAGES, id3tag) { Chris@2: contains(DEFINES, HAVE_ID3TAG) { Chris@2: message("Including .mp3 file tag support") Chris@2: } else { Chris@2: message("WARNING: .mp3 file tag support will not be included") Chris@2: } Chris@2: } Chris@2: Chris@2: contains(SV_UNIT_PACKAGES, fftw3f) { Chris@2: contains(DEFINES, HAVE_FFTW3F) { Chris@2: message("Using FFTW3f") Chris@2: } else { Chris@2: message("WARNING: FFTW3f not available, using slower FFT implementation") Chris@2: } Chris@2: } Chris@2: Chris@2: contains(SV_UNIT_PACKAGES, vamp):!contains(DEFINES, HAVE_VAMP):error("Vamp plugin API required") Chris@2: contains(SV_UNIT_PACKAGES, vamp-hostsdk):!contains(DEFINES, HAVE_VAMP_HOSTSDK):error("Vamp plugin host SDK required") Chris@2: contains(SV_UNIT_PACKAGES, sndfile):!contains(DEFINES, HAVE_SNDFILE):error("sndfile library required") Chris@2: contains(SV_UNIT_PACKAGES, samplerate):!contains(DEFINES, HAVE_SAMPLERATE):error("libsamplerate required") Chris@2: contains(SV_UNIT_PACKAGES, rasqal):!contains(DEFINES, HAVE_RASQAL):error("Rasqal RDF query library required") Chris@2: contains(SV_UNIT_PACKAGES, redland):!contains(DEFINES, HAVE_REDLAND):error("Redland RDF datastore required") Chris@2: Chris@2: VERSION_CFLAGS += -D"'"SVNREV='"'$$system(svnversion -n .)'"'"'" Chris@2: Chris@2: QMAKE_CXXFLAGS_DEBUG += -DBUILD_DEBUG $$VERSION_CFLAGS Chris@2: QMAKE_CXXFLAGS_RELEASE += -DBUILD_RELEASE $$VERSION_CFLAGS Chris@2: Chris@2: LIBS -= -lpthread Chris@2: Chris@2: linux-g++ { Chris@2: contains(DEFINES, BUILD_STATIC) { Chris@2: LIBS += -lFLAC -lxml2 Chris@2: } Chris@2: } Chris@2: Chris@2: # Restore dynamic linkage, in case we went static earlier Chris@2: linux-g++:LIBS += -Wl,-Bdynamic -lpthread -ldl Chris@2: