demos/spectrum/app/app.pro
changeset 25 e24348a560a6
child 29 b72c6db6890b
equal deleted inserted replaced
23:89e065397ea6 25:e24348a560a6
       
     1 include(../spectrum.pri)
       
     2 
       
     3 TEMPLATE = app
       
     4 
       
     5 TARGET = spectrum
       
     6 unix: !macx: !symbian: TARGET = spectrum.bin
       
     7 
       
     8 QT       += multimedia
       
     9 
       
    10 SOURCES  += main.cpp \
       
    11             engine.cpp \
       
    12             frequencyspectrum.cpp \
       
    13             levelmeter.cpp \
       
    14             mainwidget.cpp \
       
    15             progressbar.cpp \
       
    16             settingsdialog.cpp \
       
    17             spectrograph.cpp \
       
    18             spectrumanalyser.cpp \
       
    19             tonegenerator.cpp \
       
    20             tonegeneratordialog.cpp \
       
    21             utils.cpp \
       
    22             waveform.cpp \
       
    23             wavfile.cpp
       
    24 
       
    25 HEADERS  += engine.h \
       
    26             frequencyspectrum.h \
       
    27             levelmeter.h \
       
    28             mainwidget.h \
       
    29             progressbar.h \
       
    30             settingsdialog.h \
       
    31             spectrograph.h \
       
    32             spectrum.h \
       
    33             spectrumanalyser.h \
       
    34             tonegenerator.h \
       
    35             tonegeneratordialog.h \
       
    36             utils.h \
       
    37             waveform.h \
       
    38             wavfile.h
       
    39 
       
    40 fftreal_dir = ../3rdparty/fftreal
       
    41 
       
    42 INCLUDEPATH += $${fftreal_dir}
       
    43 
       
    44 RESOURCES = spectrum.qrc
       
    45 
       
    46 symbian {
       
    47     # Platform security capability required to record audio on Symbian
       
    48     TARGET.CAPABILITY += UserEnvironment
       
    49 
       
    50     # Provide unique ID for the generated binary, required by Symbian OS
       
    51     TARGET.UID3 = 0xA000E3FA
       
    52 }
       
    53 
       
    54 
       
    55 # Dynamic linkage against FFTReal DLL
       
    56 !contains(DEFINES, DISABLE_FFT) {
       
    57     symbian {
       
    58         # Must explicitly add the .dll suffix to ensure dynamic linkage
       
    59         LIBS += -lfftreal.dll
       
    60     } else {
       
    61         macx {
       
    62             # Link to fftreal framework
       
    63             LIBS += -F$${fftreal_dir}
       
    64             LIBS += -framework fftreal
       
    65         } else {
       
    66             # Link to dynamic library which is written to ../bin
       
    67             LIBS += -L../bin
       
    68             LIBS += -lfftreal
       
    69         }
       
    70     }
       
    71 }
       
    72 
       
    73 
       
    74 # Deployment
       
    75 
       
    76 symbian {
       
    77     include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
       
    78 
       
    79     !contains(DEFINES, DISABLE_FFT) {
       
    80         # Include FFTReal DLL in the SIS file
       
    81         fftreal.sources = $${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/fftreal.dll
       
    82         fftreal.path = !:/sys/bin
       
    83         DEPLOYMENT += fftreal
       
    84     }
       
    85 } else {
       
    86     macx {
       
    87         # Specify directory in which to create spectrum.app bundle
       
    88         DESTDIR = ..
       
    89 
       
    90         !contains(DEFINES, DISABLE_FFT) {
       
    91             # Relocate fftreal.framework into spectrum.app bundle
       
    92             framework_dir = ../spectrum.app/Contents/Frameworks
       
    93             framework_name = fftreal.framework/Versions/1/fftreal
       
    94             QMAKE_POST_LINK = \
       
    95                 mkdir -p $${framework_dir} &&\
       
    96                 rm -rf $${framework_dir}/fftreal.framework &&\
       
    97                 cp -R $${fftreal_dir}/fftreal.framework $${framework_dir} &&\
       
    98                 install_name_tool -id @executable_path/../Frameworks/$${framework_name} \
       
    99                                   $${framework_dir}/$${framework_name} &&\
       
   100                 install_name_tool -change $${framework_name} \
       
   101                                   @executable_path/../Frameworks/$${framework_name} \
       
   102                                   ../spectrum.app/Contents/MacOS/spectrum
       
   103         }
       
   104     } else {
       
   105         # Specify directory in which to create spectrum application
       
   106         DESTDIR = ../bin
       
   107 
       
   108         unix: !symbian {
       
   109             # On unices other than Mac OSX, we copy a shell script into the bin directory.
       
   110             # This script takes care of correctly setting the LD_LIBRARY_PATH so that
       
   111             # the dynamic library can be located.
       
   112             copy_launch_script.target = copy_launch_script
       
   113             copy_launch_script.commands = \
       
   114                 install -m 0555 spectrum.sh ../bin/spectrum
       
   115             QMAKE_EXTRA_TARGETS += copy_launch_script
       
   116             POST_TARGETDEPS += copy_launch_script
       
   117         }
       
   118     }
       
   119 }
       
   120 
       
   121