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