Fixed qwt and qwtplot3d includes.

Fixed qwt and qwtplot3d includes.

# Begin CVS Header
#   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/common.pri,v $
#   $Revision: 1.135 $
#   $Name:  $
# End CVS Header

# Copyright (C) 2012 - 2010 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc., University of Heidelberg, and The University
# of Manchester.
# All rights reserved.

# Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc., EML Research, gGmbH, University of Heidelberg,
# and The University of Manchester.
# All rights reserved.

# Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc. and EML Research, gGmbH.
# All rights reserved.

######################################################################
# $Revision: 1.135 $ $Author: shoops $ $Date: 2012/03/09 13:05:34 $
######################################################################

# In the case the BUILD_OS is not specified we make a guess.
isEmpty(BUILD_OS) {
  win32 {
    BUILD_OS = WIN32

    MY_QT4DIR = $$system(echo %QT4DIR%)
    contains(MY_QT4DIR, %QT4DIR%) {
      MY_QTDIR = $$system(echo %QTDIR%)
      contains(MY_QTDIR, %QTDIR%) {
        QMAKE_QMAKE = qmake.exe
        !build_pass: message("Configuring for $${BUILD_OS}.")
      } else {
        QMAKE_QMAKE = $(QTDIR)/bin/qmake.exe
        !build_pass: message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")
      }
	} else {
      QMAKE_QMAKE = $(QT4DIR)/bin/qmake.exe
      !build_pass: message("Configuring for $${BUILD_OS} with QTDIR=$(QT4DIR).")
	}

  } else {
    BUILD_OS = $$system(uname)
    MY_QTDIR = $$system(echo _$QTDIR)
    contains(MY_QTDIR, _) {
      message("Configuring for $${BUILD_OS}.")
    } else {
      message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")
    }
  }
}
DEFINES += $$BUILD_OS

POST_TARGETDEPS += Makefile

# Common configuration settings
CONFIG += exceptions
CONFIG += rtti
CONFIG += thread

contains(CONFIG, qt) {
    QT += webkit
}

INCLUDEPATH += $${BUILD_ROOT}
QMAKE_CFLAGS   += $$(CFLAGS)
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_LFLAGS  += $$(LDFLAGS)

DEFINES += WITH_CSPMETHOD

# the following flag enables Svens unit indentification code
# right now this still has some bugs and has to be disabled
# for releases
# DEFINES += USE_SBMLUNIT

# enable this to build support for the render extension
# DEFINES += USE_CRENDER_EXTENSION

# enable this to build with Svens layout generation code.
# This allows users to create new layouts for their models.
# This is not finished yet and should not be enabled per default
# DEFINES += COPASI_AUTOLAYOUT
#
# This enables the code for displaying elementary mode analysis results
# in the graph.
# This needs some more testing, but it should be quite stable.
# Since this depends heavily on the existence of layouts, I would only enable it
# once the autolayout has been finished.
#DEFINES += ELEMENTARY_MODE_DISPLAY

# This enables the code for the animation of flux data
# When this is enabled, the time course task will collect data
# on species concentrations or amounts as well as concentration
# or particle fluxes when a time course simulation is run.
# This data can be used by the layout windows to display animations
# of changing species concentrations and/or changing fluxes.
#DEFINES += FLUX_ANIMATION

# this flag enables new code to import layout information from
# CellDesigner annotations
# Right now this is pretty much limited to the bare layout stuff.
#DEFINES += CELLDESIGNER_IMPORT

# enable this to get screenshots from the OpenGL
# framebuffer. These should provide higher quality
# anitaliasing and they should work on more systems
#DEFINES += FRAMEBUFFER_SCREENSHOTS

# flag to use Svens SBML unit identification framework
#define USE_SBMLUNIT

debug {
  DEFINES += COPASI_DEBUG
  DEFINES += COPASI_EXTUNIT
  # DEFINES += WITH_MERGEMODEL
  DEFINES += COPASI_NONLIN_DYN
  }

win32: STATIC_LINKAGE = yes

contains(STATIC_LINKAGE, yes) {
  DEFINES += XML_STATIC
  DEFINES += LIBSBML_STATIC
  DEFINES += LIBLAX_STATIC
  DEFINES += RAPTOR_STATIC
  DEFINES += SBW_STATIC
}

!contains(BUILD_OS, WIN32) {
  #Release code optimization
  QMAKE_CFLAGS_RELEASE -= -O1
  QMAKE_CFLAGS_RELEASE -= -O2
  QMAKE_CFLAGS_RELEASE -= -O4
  QMAKE_CFLAGS_RELEASE += -O3

  QMAKE_CXXFLAGS_RELEASE -= -O1
  QMAKE_CXXFLAGS_RELEASE -= -O2
  QMAKE_CXXFLAGS_RELEASE -= -O4
  QMAKE_CXXFLAGS_RELEASE += -O3

  QMAKE_LEX = $${BUILD_ROOT}/admin/flex.sh
  QMAKE_YACC = $${BUILD_ROOT}/admin/yacc.sh

  # The character # (hex 23) can not be escaped we therefore create
  # a variable containing it
  # HASH = $$system(echo "\\043")
  # contains(HASH, \\043){
  #   HASH = $$system(echo -e "\\043")
  # }
}

contains(BUILD_OS, Darwin) {
  release {
    contains(TEMPLATE, app) {
      QMAKE_POST_LINK = strip $(TARGET)
    }

    MY_UNIVERSAL = $$system(echo $UNIVERSAL)
    contains(MY_UNIVERSAL, yes) {
       message("Creating universal 32 bit binaries.")
       CONFIG += x86 ppc
       QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk
    }
  }
  # on Mac OS X 10.6 x86 has to be added to config to make sure COPASI is build
  # as a 32 bit version, gcc on 10.6 builds 64 bit binaries by default
  #CONFIG += x86

  INCLUDEPATH += /System/Library/Frameworks/Accelerate.framework/Headers
  INCLUDEPATH += /System/Library/Frameworks/Carbon.framework/Headers

  !isEmpty(SBML_PATH){
    LIBS +=  $${SBML_PATH}/lib/libsbml.a
    INCLUDEPATH += $${SBML_PATH}/include
  } else {
    LIBS += -lsbml
  }

  !isEmpty(EXPAT_PATH){
    LIBS +=  $${EXPAT_PATH}/lib/libexpat.a
    INCLUDEPATH += $${EXPAT_PATH}/include
  } else {
    LIBS += -lexpat
  }

  !isEmpty(RAPTOR_PATH){
    LIBS +=  $${RAPTOR_PATH}/lib/libraptor.a
    LIBS += -lcurl -liconv -lxml2 -lxslt -lssl -lz
    INCLUDEPATH += $${RAPTOR_PATH}/include
  } else {
    LIBS += -lraptor -lcurl -liconv -lxml2 -lxslt -lssl -lz
  }

  contains(CONFIG, qt) {
    !isEmpty(SBW_PATH) {
      contains(SBW_PATH, yes) {
        LIBS += -lSBW
      } else {
        LIBS += $${SBW_PATH}/lib/libSBW.a
        INCLUDEPATH += $${SBW_PATH}/include
      }
      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES += LINUX DARWIN
    }

    !isEmpty(QWT_PATH) {
       LIBS+=  $${QWT_PATH}/lib/libqwt.a
       INCLUDEPATH += $${QWT_PATH}/include
    } else {
      LIBS += -lqwt
    }

    !isEmpty(QWT3D_PATH) {
      LIBS +=  $${QWT3D_PATH}/lib/libqwtplot3d.a
      INCLUDEPATH += $${QWT3D_PATH}/include
    } else {
      LIBS += -lqwtplot3d
    }

    !isEmpty(QTMML_PATH) {
      contains(QTMML_PATH, yes) {
        release: LIBS += -lQtSolutions_MMLWidget-2.4
        debug:   LIBS += -lQtSolutions_MMLWidget-2.4_debug
      } else {
        release: LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4.a
        debug:   LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4_debug.a
        INCLUDEPATH += $${QTMML_PATH}/include
      }

      DEFINES += HAVE_MML
    }
  }

  LIBS += -framework Accelerate
  LIBS += -framework Carbon
  LIBS += -framework QuickTime
  LIBS += -lz

# only needed for the class CLSimpleImageTexturizer which is only
# needed if we want to create bitmaps from layouts in the backend
#  contains(DEFINES, USE_CRENDER_EXTENSION){
#    INCLUDEPATH += /opt/local/include
#    LIBS += -L/opt/local/lib -lpng
#    LIBS += -ljpeg
#  }
}

contains(BUILD_OS, WIN32) {
  CONFIG += debug_and_release

  win32-icc: {
    !build_pass: message("Using Intel Compiler.")
  }

  !contains(QMAKE_HOST.arch, x86_64) {
    !build_pass: message("x86 build")
    COPASI_ARCH = 32
    QMAKE_LFLAGS += /MACHINE:X86
  } else {
    !build_pass: message("x86_64 build")
    COPASI_ARCH = 64
    QMAKE_CFLAGS += /Wp64
    QMAKE_LFLAGS += /MACHINE:X64
  }

  !isEmpty(INTELRD_PATH) {
    QMAKE_LFLAGS   += /LIBPATH:\""$${INTELRD_PATH}"\"
  }

  QMAKE_LEX = C:/cygwin/bin/bash $${BUILD_ROOT}/admin/flex.sh
  QMAKE_YACC = C:/cygwin/bin/bash $${BUILD_ROOT}/admin/yacc.sh

  DEFINES -= UNICODE
  DEFINES += _CRT_SECURE_NO_WARNINGS

  #Release code optimization
  QMAKE_CFLAGS_RELEASE   -= -O1
  QMAKE_CFLAGS_RELEASE   *= -O2

  QMAKE_CXXFLAGS_RELEASE -= -O1
  QMAKE_CXXFLAGS_RELEASE *= -O2

  contains(RUNTIME, MT) {
    release: RUNTIME = MT
    debug:   RUNTIME = MTd

    QMAKE_CFLAGS_RELEASE   -= -MD
    QMAKE_CFLAGS_RELEASE   *= -MT
    QMAKE_CFLAGS_DEBUG     -= -MDd
    QMAKE_CFLAGS_DEBUG     *= -MTd

    QMAKE_CXXFLAGS_RELEASE -= -MD
    QMAKE_CXXFLAGS_RELEASE *= -MT
    QMAKE_CXXFLAGS_DEBUG   -= -MDd
    QMAKE_CXXFLAGS_DEBUG   *= -MTd

    QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcrt.lib"
    QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcrtd.lib"
    QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcprt.lib"
    QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcprtd.lib"

    release: QMAKE_LFLAGS *= /NODEFAULTLIB:"libcmtd.lib"

    debug: QMAKE_LFLAGS *= /NODEFAULTLIB:"libcmt.lib"
  } else {
    release: RUNTIME = MD
    debug:   RUNTIME = MDd

    QMAKE_CFLAGS_RELEASE   -= -MT
    QMAKE_CFLAGS_RELEASE   *= -MD
    QMAKE_CFLAGS_DEBUG     -= -MTd
    QMAKE_CFLAGS_DEBUG     *= -MDd

    QMAKE_CXXFLAGS_RELEASE -= -MT
    QMAKE_CXXFLAGS_RELEASE *= -MD
    QMAKE_CXXFLAGS_DEBUG   -= -MTd
    QMAKE_CXXFLAGS_DEBUG   *= -MDd

    QMAKE_LFLAGS *= /NODEFAULTLIB:"libcmt.lib"
    QMAKE_LFLAGS *= /NODEFAULTLIB:"libcmtd.lib"

    release {
      QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcrtd.lib"
      QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcprtd.lib"
    }

    debug {
      QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcrt.lib"
      QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcprt.lib"
    }
  }

  LIBS += shell32.lib

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    QMAKE_CXXFLAGS += -I\""$${MKL_PATH}"/include\"

    contains(COPASI_ARCH, 32) {
      QMAKE_LFLAGS += /LIBPATH:\""$${MKL_PATH}"/ia32/lib\"
      QMAKE_LFLAGS += /LIBPATH:\""$${MKL_PATH}"/../lib/ia32\"
      LIBS += mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib -Qopenmp libguide.lib
    } else {
      QMAKE_LFLAGS += /LIBPATH:\""$${MKL_PATH}"/em64t/lib\"
      QMAKE_LFLAGS += /LIBPATH:\""$${MKL_PATH}"/../lib/intel64\"
      LIBS += mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib -Qopenmp libguide.lib
    }
  } else {
    !isEmpty(LAPACK_PATH) {
      DEFINES += USE_LAPACK
      QMAKE_CXXFLAGS   += -I\""$${LAPACK_PATH}"/include\"
      QMAKE_LFLAGS += /LIBPATH:\""$${LAPACK_PATH}/lib/$${COPASI_ARCH}"\"
      debug {
        LIBS += blasD.lib lapackD.lib
      }
      release {
        LIBS += blas.lib lapack.lib ifconsol.lib libifcoremt.lib libifport.lib libirc.lib libmmt.lib svml_dispmt.lib
      }
      LIBS += ifconsol.lib libifcoremt.lib libifport.lib libirc.lib libmmt.lib svml_dispmt.lib
    } else {
      !isEmpty(CLAPACK_PATH) {
        DEFINES += USE_CLAPACK
        QMAKE_CXXFLAGS   += -I\""$${CLAPACK_PATH}"/include\"
        QMAKE_LFLAGS += /LIBPATH:\""$${CLAPACK_PATH}"/lib\"
        QMAKE_LFLAGS += /LIBPATH:\""$${CLAPACK_PATH}/lib/$${COPASI_ARCH}"\"
        LIBS += clapack.lib
      } else {
        error( "Either MKL_PATH, LPACK_PATH, or CLAPACK_PATH must be specified" )
      }
    }
  }

#expat library
  LIBS += libexpat$${RUNTIME}.lib

  !isEmpty(EXPAT_PATH) {
    QMAKE_CXXFLAGS += -I\""$${EXPAT_PATH}"/Source/lib\"
    QMAKE_CXXFLAGS += -I\""$${EXPAT_PATH}"/include\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${EXPAT_PATH}"/StaticLibs\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${EXPAT_PATH}"/bin\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${EXPAT_PATH}"/lib\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${EXPAT_PATH}/lib/$${COPASI_ARCH}"\"
  } else {
    error( "EXPAT_PATH must be specified" )
  }

  LIBS += libsbml$${RUNTIME}.lib

  !isEmpty(SBML_PATH) {
    QMAKE_CXXFLAGS += -I\""$${SBML_PATH}"/include\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${SBML_PATH}"/lib\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${SBML_PATH}/lib/$${COPASI_ARCH}"\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${SBML_PATH}"/bin\"
  } else {
    error( "SBML_PATH must be specified" )
  }

# The raptor library
  LIBS += raptor$${RUNTIME}.lib

  !isEmpty(RAPTOR_PATH) {
    QMAKE_CXXFLAGS += -I\""$${RAPTOR_PATH}"/include\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${RAPTOR_PATH}"/lib\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${RAPTOR_PATH}/lib/$${COPASI_ARCH}"\"
  } else {
    error( "RAPTOR_PATH must be specified" )
  }

  contains(CONFIG, qt) {
    !isEmpty(SBW_PATH){
      QMAKE_CXXFLAGS += -I\""$${SBW_PATH}"/include\"
      QMAKE_LFLAGS   += /LIBPATH:\""$${SBW_PATH}"/lib\"
      QMAKE_LFLAGS   += /LIBPATH:\""$${SBW_PATH}/lib/$${COPASI_ARCH}"\"

      LIBS    += SBW$${RUNTIME}.lib ws2_32.lib

      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES *= WIN32
    }

    !isEmpty(QWT_PATH){
       LIBS+=  -L\""$${QWT_PATH}"/lib\"
       INCLUDEPATH += \""$${QWT_PATH}"/include\"
    }

    release: LIBS += -lqwt
    debug: LIBS += -lqwtD

    !isEmpty(QWT3D_PATH){
      LIBS += -L\""$${QWT3D_PATH}"/lib\"
      INCLUDEPATH += \""$${QWT3D_PATH}"/include\"
    }

    release: LIBS += -lqwtplot3d
    debug: LIBS += -lqwtplot3dD

    !isEmpty(QTMML_PATH) {
      QMAKE_CXXFLAGS += -I\""$${QTMML_PATH}"/include\"
      QMAKE_LFLAGS   += /LIBPATH:\""$${QTMML_PATH}"/lib\"
      QMAKE_LFLAGS   += /LIBPATH:\""$${QTMML_PATH}/lib/$${COPASI_ARCH}"\"

      release: LIBS +=  -lQtSolutions_MMLWidget-2.4
      debug:   LIBS +=  -lQtSolutions_MMLWidget-2.4d

      DEFINES += HAVE_MML
    }

  }
}

contains(BUILD_OS, SunOS) {
contains(STATIC_LINKAGE, yes) {
# :TODO: This should be set through configure.
  LIBS += -L/export/home/shoops/copasi/gcc/lib
}

  release {
    contains(TEMPLATE, app) {
# Note: This must be the SunOS strip command.
      QMAKE_POST_LINK = /usr/ccs/bin/strip $(TARGET)
    }
  }

  !isEmpty(CLAPACK_PATH) {
    DEFINES += USE_CLAPACK
    INCLUDEPATH += $${CLAPACK_PATH}/include
#    LIBS += -llapack -lblas -lF77 -lfl
    LIBS += -llapack -lblas -lF77
    LIBS += -L$${CLAPACK_PATH}/lib
  } else {
    !isEmpty(LAPACK_PATH) {
      message("Using lapack.")
      DEFINES += USE_LAPACK
      INCLUDEPATH += $${LAPACK_PATH}/include
      LIBS += -llapack -lblas  -lg2c
      LIBS += -L$${LAPACK_PATH}/lib
    } else {
      message("Using sunperf.")
      DEFINES += USE_SUNPERF
      LIBS += -lsunperf
      QMAKE_CFLAGS   += -dalign
      QMAKE_CXXFLAGS   += -dalign
    }
  }
  !isEmpty(EXPAT_PATH){
      LIBS+=  -L$${EXPAT_PATH}/lib
      INCLUDEPATH += $${EXPAT_PATH}/include
  }
  !isEmpty(SBML_PATH){
      LIBS+=  -L$${SBML_PATH}/lib
      INCLUDEPATH += $${SBML_PATH}/include
  }

  LIBS += -lsbml -lexpat

# The raptor library
  LIBS += -lraptor
  !isEmpty(RAPTOR_PATH){
      LIBS+=  -L$${RAPTOR_PATH}/lib
      INCLUDEPATH += $${RAPTOR_PATH}/include
  }

  contains(CONFIG, qt) {
    !isEmpty(SBW_PATH){
      LIBS+=  $${SBW_PATH}/lib/libSBW.a
      INCLUDEPATH += $${SBW_PATH}/include
      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES += LINUX SOLARIS
    }

    !isEmpty(QWT_PATH){
       LIBS+=  -L$${QWT_PATH}/lib
       INCLUDEPATH += $${QWT_PATH}/include
    }
    LIBS += -lqwt

    !isEmpty(QWT3D_PATH){
      LIBS += -L$${QWT3D_PATH}/lib/
      INCLUDEPATH += $${QWT3D_PATH}/include
    }
    LIBS += -lqwtplot3d

    !isEmpty(QTMML_PATH) {
      contains(QTMML_PATH, yes) {
        release: LIBS += -lQtSolutions_MMLWidget-2.4
        debug:   LIBS += -lQtSolutions_MMLWidget-2.4_debug
      } else {
        release: LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4.a
        debug:   LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4_debug.a
        INCLUDEPATH += $${QTMML_PATH}/include
      }

      DEFINES += HAVE_MML
    }

    LIBS += -lSM
  } else {
    QMAKE_LIBS_THREAD -= -lpthread
    QMAKE_LIBS_THREAD -= -lrt
  }
}

contains(BUILD_OS, Linux) {

  TARGET_64 = $$system($${QMAKE_CC} -dM -E - < /dev/null | grep -q __x86_64__ && echo true)

  contains(TARGET_64, true) {
    message("Creating 64 bit binaries.")
  }

  INTEL_COMPILER = $$system($${QMAKE_CC} -dM -E - < /dev/null | grep -q __INTEL_COMPILER && echo true)

  contains(INTEL_COMPILER, true) {
    message("Linking statically against Intel libraries.")
    QMAKE_LFLAGS *= -static-intel
  }

  release {
    contains(TEMPLATE, app) {
      QMAKE_POST_LINK = strip $(TARGET)
    }
  }

  contains(PACKAGE, yes) {
    QMAKE_LFLAGS -= -static
  }
  else {
    contains(STATIC_LINKAGE, yes) {
      QMAKE_LFLAGS *= -static
    }
    else {
      QMAKE_LFLAGS -= -static
    }
  }

  !isEmpty(SBML_PATH){
    INCLUDEPATH *= $${SBML_PATH}/include
    INCLUDEPATH *= $${SBML_PATH}/include/sbml

    contains(PACKAGE, yes) {
      LIBS += $${SBML_PATH}/lib/libsbml.a
    }
    else {
      LIBS += -L$${SBML_PATH}/lib
      LIBS += -lsbml
    }
  }
  else {
    contains(PACKAGE, yes) {
      error("SBML_PATH must be given.")
    }
    else {
      LIBS += -lsbml
    }
  }

  !isEmpty(EXPAT_PATH){
    INCLUDEPATH *= $${EXPAT_PATH}/include

    contains(PACKAGE, yes) {
      LIBS += $${EXPAT_PATH}/lib/libexpat.a
    }
    else {
      LIBS += -L$${EXPAT_PATH}/lib
      LIBS += -lexpat
    }
  }
  else {
    contains(PACKAGE, yes) {
      error("EXPAT_PATH must be given.")
    }
    else {
      LIBS += -lexpat
    }
  }

# The raptor library
  !isEmpty(RAPTOR_PATH){
      LIBS +=  -L$${RAPTOR_PATH}/lib
      INCLUDEPATH *= $${RAPTOR_PATH}/include

    contains(PACKAGE, yes) {
      LIBS += $${RAPTOR_PATH}/lib/libraptor.a
    }
    else {
      LIBS += -L$${RAPTOR_PATH}/lib
      LIBS += -lraptor
    }
  }
  else {
    contains(PACKAGE, yes) {
      error("RAPTOR_PATH must be given.")
    }
    else {
      LIBS += -lraptor
    }
  }

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    INCLUDEPATH *= $${MKL_PATH}/include

    contains(TARGET_64, true) {
      LIBS += -Wl,--start-group \
                $${MKL_PATH}/lib/em64t/libmkl_intel_lp64.a \
                $${MKL_PATH}/lib/em64t/libmkl_sequential.a \
                $${MKL_PATH}/lib/em64t/libmkl_core.a \
              -Wl,--end-group \
              -lpthread
    } else {
      LIBS += $${MKL_PATH}/lib/32/libmkl_solver.a \
              -Wl,--start-group \
                $${MKL_PATH}/lib/32/libmkl_intel.a \
                $${MKL_PATH}/lib/32/libmkl_sequential.a \
                $${MKL_PATH}/lib/32/libmkl_core.a \
              -Wl,--end-group \
              -lpthread
    }

  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      INCLUDEPATH += $${CLAPACK_PATH}/include
#      LIBS += -llapack -lblas -lF77 -lfl
      LIBS += -llapack -lblas -lF77
      LIBS += -L$${CLAPACK_PATH}/lib
    } else {
      !isEmpty(LAPACK_PATH) {
        message("Using lapack.")
        DEFINES += USE_LAPACK

        !contains(LAPACK_PATH, yes) {
          INCLUDEPATH *= $${LAPACK_PATH}/include

          contains(PACKAGE, yes) {
            LIBS += $${LAPACK_PATH}/lib/liblapack.a
            LIBS += $${LAPACK_PATH}/lib/libblas.a
            LIBS += $$system(locate libg2c.a)
          }
          else {
            LIBS += -L$${LAPACK_PATH}/lib
            LIBS += -llapack
            LIBS += -lblas
            HAVE_G2C = $$system(locate libg2c)
            !isEmpty(HAVE_G2C) LIBS += -lg2c
          }
        } else {
          LIBS += -llapack
          LIBS += -lblas
          HAVE_G2C = $$system(locate libg2c)
          !isEmpty(HAVE_G2C) LIBS += -lg2c
        }
      } else {
        error( "Either MKL_PATH, CLAPACK_PATH, or LAPACK_PATH must be specified" )
      }
    }
  }

  contains(CONFIG, qt) {
    !isEmpty(SBW_PATH) {
      contains(SBW_PATH, yes) {
        LIBS += -lSBW
      } else {
        LIBS += $${SBW_PATH}/lib/libSBW.a
        INCLUDEPATH *= $${SBW_PATH}/include
      }
      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES += LINUX
    }

    !isEmpty(QWT_PATH):!contains(QWT_PATH, yes) {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh -i $${QWT_PATH}/include qwt-qt4 qwt)
      LIBS *= -L$${QWT_PATH}/lib
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT_PATH}/lib qwt-qt4 qwt)
    } else {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh qwt-qt4 qwt)
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh qwt-qt4 qwt)
    }

    !isEmpty(QWT3D_PATH):!contains(QWT_PATH, yes) {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh -i $${QWT3D_PATH}/include qwtplot3d-qt4 qwtplt3d)
      LIBS *= -L$${QWT3D_PATH}/lib
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT3D_PATH}/lib qwtplot3d-qt4 qwtplt3d)
    } else {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh qwtplot3d-qt4 qwtplt3d)
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh qwtplot3d-qt4 qwtplt3d)
    }

    !isEmpty(QTMML_PATH) {
      contains(QTMML_PATH, yes) {
        LIBS += -lQtSolutions_MMLWidget-2.4
      } else {
        LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4.a
        INCLUDEPATH *= $${QTMML_PATH}/include
      }

      DEFINES += HAVE_MML
    }

# only needed for the class CLSimpleImageTexturizer which is only
# needed if we want to create bitmaps from layouts in the backend
#contains(DEFINES,USE_CRENDER_EXTENSION) {
#	LIBS += -lpng
#       LIBS += -ljpeg
#}
  }
}

DEP1.target   = depend
DEP1.depends  = qmake

QMAKE_EXTRA_TARGETS += DEP1

# addSubdirs(subdirs,deps): Adds directories to the project that depend on
# other directories
defineTest(addSubdirs) {
    for(subdirs, 1) {
        entries = $$files($$subdirs)
        for(entry, entries) {
            name = $$replace(entry, [/\\\\], _)
            SUBDIRS += $$name
            eval ($${name}.subdir = $$entry)
            for(dep, 2):eval ($${name}.depends += $$replace(dep, [/\\\\], _))
            export ($${name}.subdir)
            export ($${name}.depends)
        }
    }
    export (SUBDIRS)
}

# Begin CVS Header
#   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/common.pri,v $
#   $Revision: 1.134 $
#   $Name:  $
# End CVS Header

# Copyright (C) 2012 - 2010 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc., University of Heidelberg, and The University
# of Manchester.
# All rights reserved.

# Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc., EML Research, gGmbH, University of Heidelberg,
# and The University of Manchester.
# All rights reserved.

# Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc. and EML Research, gGmbH.
# All rights reserved.

######################################################################
# $Revision: 1.134 $ $Author: shoops $ $Date: 2012/03/09 04:21:14 $
######################################################################

# In the case the BUILD_OS is not specified we make a guess.
isEmpty(BUILD_OS) {
  win32 {
    BUILD_OS = WIN32

    MY_QT4DIR = $$system(echo %QT4DIR%)
    contains(MY_QT4DIR, %QT4DIR%) {
      MY_QTDIR = $$system(echo %QTDIR%)
      contains(MY_QTDIR, %QTDIR%) {
        QMAKE_QMAKE = qmake.exe
        !build_pass: message("Configuring for $${BUILD_OS}.")
      } else {
        QMAKE_QMAKE = $(QTDIR)/bin/qmake.exe
        !build_pass: message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")
      }
	} else {
      QMAKE_QMAKE = $(QT4DIR)/bin/qmake.exe
      !build_pass: message("Configuring for $${BUILD_OS} with QTDIR=$(QT4DIR).")
	}

  } else {
    BUILD_OS = $$system(uname)
    MY_QTDIR = $$system(echo _$QTDIR)
    contains(MY_QTDIR, _) {
      message("Configuring for $${BUILD_OS}.")
    } else {
      message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")
    }
  }
}
DEFINES += $$BUILD_OS

POST_TARGETDEPS += Makefile

# Common configuration settings
CONFIG += exceptions
CONFIG += rtti
CONFIG += thread

contains(CONFIG, qt) {
    QT += webkit
}

INCLUDEPATH += $${BUILD_ROOT}
QMAKE_CFLAGS   += $$(CFLAGS)
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_LFLAGS  += $$(LDFLAGS)

DEFINES += WITH_CSPMETHOD

# the following flag enables Svens unit indentification code
# right now this still has some bugs and has to be disabled
# for releases
# DEFINES += USE_SBMLUNIT

# enable this to build support for the render extension
# DEFINES += USE_CRENDER_EXTENSION

# enable this to build with Svens layout generation code.
# This allows users to create new layouts for their models.
# This is not finished yet and should not be enabled per default
# DEFINES += COPASI_AUTOLAYOUT
#
# This enables the code for displaying elementary mode analysis results
# in the graph.
# This needs some more testing, but it should be quite stable.
# Since this depends heavily on the existence of layouts, I would only enable it
# once the autolayout has been finished.
#DEFINES += ELEMENTARY_MODE_DISPLAY

# This enables the code for the animation of flux data
# When this is enabled, the time course task will collect data
# on species concentrations or amounts as well as concentration
# or particle fluxes when a time course simulation is run.
# This data can be used by the layout windows to display animations
# of changing species concentrations and/or changing fluxes.
#DEFINES += FLUX_ANIMATION

# this flag enables new code to import layout information from
# CellDesigner annotations
# Right now this is pretty much limited to the bare layout stuff.
#DEFINES += CELLDESIGNER_IMPORT

# enable this to get screenshots from the OpenGL
# framebuffer. These should provide higher quality
# anitaliasing and they should work on more systems
#DEFINES += FRAMEBUFFER_SCREENSHOTS

# flag to use Svens SBML unit identification framework
#define USE_SBMLUNIT

debug {
  DEFINES += COPASI_DEBUG
  DEFINES += COPASI_EXTUNIT
  # DEFINES += WITH_MERGEMODEL
  DEFINES += COPASI_NONLIN_DYN
  }

win32: STATIC_LINKAGE = yes

contains(STATIC_LINKAGE, yes) {
  DEFINES += XML_STATIC
  DEFINES += LIBSBML_STATIC
  DEFINES += LIBLAX_STATIC
  DEFINES += RAPTOR_STATIC
  DEFINES += SBW_STATIC
}

!contains(BUILD_OS, WIN32) {
  #Release code optimization
  QMAKE_CFLAGS_RELEASE -= -O1
  QMAKE_CFLAGS_RELEASE -= -O2
  QMAKE_CFLAGS_RELEASE -= -O4
  QMAKE_CFLAGS_RELEASE += -O3

  QMAKE_CXXFLAGS_RELEASE -= -O1
  QMAKE_CXXFLAGS_RELEASE -= -O2
  QMAKE_CXXFLAGS_RELEASE -= -O4
  QMAKE_CXXFLAGS_RELEASE += -O3

  QMAKE_LEX = $${BUILD_ROOT}/admin/flex.sh
  QMAKE_YACC = $${BUILD_ROOT}/admin/yacc.sh

  # The character # (hex 23) can not be escaped we therefore create
  # a variable containing it
  # HASH = $$system(echo "\\043")
  # contains(HASH, \\043){
  #   HASH = $$system(echo -e "\\043")
  # }
}

contains(BUILD_OS, Darwin) {
  release {
    contains(TEMPLATE, app) {
      QMAKE_POST_LINK = strip $(TARGET)
    }

    MY_UNIVERSAL = $$system(echo $UNIVERSAL)
    contains(MY_UNIVERSAL, yes) {
       message("Creating universal 32 bit binaries.")
       CONFIG += x86 ppc
       QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk
    }
  }
  # on Mac OS X 10.6 x86 has to be added to config to make sure COPASI is build
  # as a 32 bit version, gcc on 10.6 builds 64 bit binaries by default
  #CONFIG += x86

  INCLUDEPATH += /System/Library/Frameworks/Accelerate.framework/Headers
  INCLUDEPATH += /System/Library/Frameworks/Carbon.framework/Headers

  !isEmpty(SBML_PATH){
    LIBS +=  $${SBML_PATH}/lib/libsbml.a
    INCLUDEPATH += $${SBML_PATH}/include
  } else {
    LIBS += -lsbml
  }

  !isEmpty(EXPAT_PATH){
    LIBS +=  $${EXPAT_PATH}/lib/libexpat.a
    INCLUDEPATH += $${EXPAT_PATH}/include
  } else {
    LIBS += -lexpat
  }

  !isEmpty(RAPTOR_PATH){
    LIBS +=  $${RAPTOR_PATH}/lib/libraptor.a
    LIBS += -lcurl -liconv -lxml2 -lxslt -lssl -lz
    INCLUDEPATH += $${RAPTOR_PATH}/include
  } else {
    LIBS += -lraptor -lcurl -liconv -lxml2 -lxslt -lssl -lz
  }

  contains(CONFIG, qt) {
    !isEmpty(SBW_PATH) {
      contains(SBW_PATH, yes) {
        LIBS += -lSBW
      } else {
        LIBS += $${SBW_PATH}/lib/libSBW.a
        INCLUDEPATH += $${SBW_PATH}/include
      }
      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES += LINUX DARWIN
    }

    !isEmpty(QWT_PATH) {
       LIBS+=  $${QWT_PATH}/lib/libqwt.a
       INCLUDEPATH += $${QWT_PATH}/include
    } else {
      LIBS += -lqwt
    }

    !isEmpty(QWT3D_PATH) {
      LIBS +=  $${QWT3D_PATH}/lib/libqwtplot3d.a
      INCLUDEPATH += $${QWT3D_PATH}/include
    } else {
      LIBS += -lqwtplot3d
    }

    !isEmpty(QTMML_PATH) {
      contains(QTMML_PATH, yes) {
        release: LIBS += -lQtSolutions_MMLWidget-2.4
        debug:   LIBS += -lQtSolutions_MMLWidget-2.4_debug
      } else {
        release: LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4.a
        debug:   LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4_debug.a
        INCLUDEPATH += $${QTMML_PATH}/include
      }

      DEFINES += HAVE_MML
    }
  }

  LIBS += -framework Accelerate
  LIBS += -framework Carbon
  LIBS += -framework QuickTime
  LIBS += -lz

# only needed for the class CLSimpleImageTexturizer which is only
# needed if we want to create bitmaps from layouts in the backend
#  contains(DEFINES, USE_CRENDER_EXTENSION){
#    INCLUDEPATH += /opt/local/include
#    LIBS += -L/opt/local/lib -lpng
#    LIBS += -ljpeg
#  }
}

contains(BUILD_OS, WIN32) {
  CONFIG += debug_and_release

  win32-icc: {
    !build_pass: message("Using Intel Compiler.")
  }

  !contains(QMAKE_HOST.arch, x86_64) {
    !build_pass: message("x86 build")
    COPASI_ARCH = 32
    QMAKE_LFLAGS += /MACHINE:X86
  } else {
    !build_pass: message("x86_64 build")
    COPASI_ARCH = 64
    QMAKE_CFLAGS += /Wp64
    QMAKE_LFLAGS += /MACHINE:X64
  }

  !isEmpty(INTELRD_PATH) {
    QMAKE_LFLAGS   += /LIBPATH:\""$${INTELRD_PATH}"\"
  }

  QMAKE_LEX = C:/cygwin/bin/bash $${BUILD_ROOT}/admin/flex.sh
  QMAKE_YACC = C:/cygwin/bin/bash $${BUILD_ROOT}/admin/yacc.sh

  DEFINES -= UNICODE
  DEFINES += _CRT_SECURE_NO_WARNINGS

  #Release code optimization
  QMAKE_CFLAGS_RELEASE   -= -O1
  QMAKE_CFLAGS_RELEASE   *= -O2

  QMAKE_CXXFLAGS_RELEASE -= -O1
  QMAKE_CXXFLAGS_RELEASE *= -O2

  contains(RUNTIME, MT) {
    release: RUNTIME = MT
    debug:   RUNTIME = MTd

    QMAKE_CFLAGS_RELEASE   -= -MD
    QMAKE_CFLAGS_RELEASE   *= -MT
    QMAKE_CFLAGS_DEBUG     -= -MDd
    QMAKE_CFLAGS_DEBUG     *= -MTd

    QMAKE_CXXFLAGS_RELEASE -= -MD
    QMAKE_CXXFLAGS_RELEASE *= -MT
    QMAKE_CXXFLAGS_DEBUG   -= -MDd
    QMAKE_CXXFLAGS_DEBUG   *= -MTd

    QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcrt.lib"
    QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcrtd.lib"
    QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcprt.lib"
    QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcprtd.lib"

    release: QMAKE_LFLAGS *= /NODEFAULTLIB:"libcmtd.lib"

    debug: QMAKE_LFLAGS *= /NODEFAULTLIB:"libcmt.lib"
  } else {
    release: RUNTIME = MD
    debug:   RUNTIME = MDd

    QMAKE_CFLAGS_RELEASE   -= -MT
    QMAKE_CFLAGS_RELEASE   *= -MD
    QMAKE_CFLAGS_DEBUG     -= -MTd
    QMAKE_CFLAGS_DEBUG     *= -MDd

    QMAKE_CXXFLAGS_RELEASE -= -MT
    QMAKE_CXXFLAGS_RELEASE *= -MD
    QMAKE_CXXFLAGS_DEBUG   -= -MTd
    QMAKE_CXXFLAGS_DEBUG   *= -MDd

    QMAKE_LFLAGS *= /NODEFAULTLIB:"libcmt.lib"
    QMAKE_LFLAGS *= /NODEFAULTLIB:"libcmtd.lib"

    release {
      QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcrtd.lib"
      QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcprtd.lib"
    }

    debug {
      QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcrt.lib"
      QMAKE_LFLAGS *= /NODEFAULTLIB:"msvcprt.lib"
    }
  }

  LIBS += shell32.lib

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    QMAKE_CXXFLAGS += -I\""$${MKL_PATH}"/include\"

    contains(COPASI_ARCH, 32) {
      QMAKE_LFLAGS += /LIBPATH:\""$${MKL_PATH}"/ia32/lib\"
      QMAKE_LFLAGS += /LIBPATH:\""$${MKL_PATH}"/../lib/ia32\"
      LIBS += mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib -Qopenmp libguide.lib
    } else {
      QMAKE_LFLAGS += /LIBPATH:\""$${MKL_PATH}"/em64t/lib\"
      QMAKE_LFLAGS += /LIBPATH:\""$${MKL_PATH}"/../lib/intel64\"
      LIBS += mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib -Qopenmp libguide.lib
    }
  } else {
    !isEmpty(LAPACK_PATH) {
      DEFINES += USE_LAPACK
      QMAKE_CXXFLAGS   += -I\""$${LAPACK_PATH}"/include\"
      QMAKE_LFLAGS += /LIBPATH:\""$${LAPACK_PATH}/lib/$${COPASI_ARCH}"\"
      debug {
        LIBS += blasD.lib lapackD.lib
      }
      release {
        LIBS += blas.lib lapack.lib ifconsol.lib libifcoremt.lib libifport.lib libirc.lib libmmt.lib svml_dispmt.lib
      }
      LIBS += ifconsol.lib libifcoremt.lib libifport.lib libirc.lib libmmt.lib svml_dispmt.lib
    } else {
      !isEmpty(CLAPACK_PATH) {
        DEFINES += USE_CLAPACK
        QMAKE_CXXFLAGS   += -I\""$${CLAPACK_PATH}"/include\"
        QMAKE_LFLAGS += /LIBPATH:\""$${CLAPACK_PATH}"/lib\"
        QMAKE_LFLAGS += /LIBPATH:\""$${CLAPACK_PATH}/lib/$${COPASI_ARCH}"\"
        LIBS += clapack.lib
      } else {
        error( "Either MKL_PATH, LPACK_PATH, or CLAPACK_PATH must be specified" )
      }
    }
  }

#expat library
  LIBS += libexpat$${RUNTIME}.lib

  !isEmpty(EXPAT_PATH) {
    QMAKE_CXXFLAGS += -I\""$${EXPAT_PATH}"/Source/lib\"
    QMAKE_CXXFLAGS += -I\""$${EXPAT_PATH}"/include\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${EXPAT_PATH}"/StaticLibs\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${EXPAT_PATH}"/bin\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${EXPAT_PATH}"/lib\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${EXPAT_PATH}/lib/$${COPASI_ARCH}"\"
  } else {
    error( "EXPAT_PATH must be specified" )
  }

  LIBS += libsbml$${RUNTIME}.lib

  !isEmpty(SBML_PATH) {
    QMAKE_CXXFLAGS += -I\""$${SBML_PATH}"/include\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${SBML_PATH}"/lib\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${SBML_PATH}/lib/$${COPASI_ARCH}"\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${SBML_PATH}"/bin\"
  } else {
    error( "SBML_PATH must be specified" )
  }

# The raptor library
  LIBS += raptor$${RUNTIME}.lib

  !isEmpty(RAPTOR_PATH) {
    QMAKE_CXXFLAGS += -I\""$${RAPTOR_PATH}"/include\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${RAPTOR_PATH}"/lib\"
    QMAKE_LFLAGS   += /LIBPATH:\""$${RAPTOR_PATH}/lib/$${COPASI_ARCH}"\"
  } else {
    error( "RAPTOR_PATH must be specified" )
  }

  contains(CONFIG, qt) {
    !isEmpty(SBW_PATH){
      QMAKE_CXXFLAGS += -I\""$${SBW_PATH}"/include\"
      QMAKE_LFLAGS   += /LIBPATH:\""$${SBW_PATH}"/lib\"
      QMAKE_LFLAGS   += /LIBPATH:\""$${SBW_PATH}/lib/$${COPASI_ARCH}"\"

      LIBS    += SBW$${RUNTIME}.lib ws2_32.lib

      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES *= WIN32
    }

    !isEmpty(QWT_PATH){
       LIBS+=  -L\""$${QWT_PATH}"/lib\"
       INCLUDEPATH += \""$${QWT_PATH}"/include\"
    }

    release: LIBS += -lqwt
    debug: LIBS += -lqwtD

    !isEmpty(QWT3D_PATH){
      LIBS += -L\""$${QWT3D_PATH}"/lib\"
      INCLUDEPATH += \""$${QWT3D_PATH}"/include\"
    }

    release: LIBS += -lqwtplot3d
    debug: LIBS += -lqwtplot3dD

    !isEmpty(QTMML_PATH) {
      QMAKE_CXXFLAGS += -I\""$${QTMML_PATH}"/include\"
      QMAKE_LFLAGS   += /LIBPATH:\""$${QTMML_PATH}"/lib\"
      QMAKE_LFLAGS   += /LIBPATH:\""$${QTMML_PATH}/lib/$${COPASI_ARCH}"\"

      release: LIBS +=  -lQtSolutions_MMLWidget-2.4
      debug:   LIBS +=  -lQtSolutions_MMLWidget-2.4d

      DEFINES += HAVE_MML
    }

  }
}

contains(BUILD_OS, SunOS) {
contains(STATIC_LINKAGE, yes) {
# :TODO: This should be set through configure.
  LIBS += -L/export/home/shoops/copasi/gcc/lib
}

  release {
    contains(TEMPLATE, app) {
# Note: This must be the SunOS strip command.
      QMAKE_POST_LINK = /usr/ccs/bin/strip $(TARGET)
    }
  }

  !isEmpty(CLAPACK_PATH) {
    DEFINES += USE_CLAPACK
    INCLUDEPATH += $${CLAPACK_PATH}/include
#    LIBS += -llapack -lblas -lF77 -lfl
    LIBS += -llapack -lblas -lF77
    LIBS += -L$${CLAPACK_PATH}/lib
  } else {
    !isEmpty(LAPACK_PATH) {
      message("Using lapack.")
      DEFINES += USE_LAPACK
      INCLUDEPATH += $${LAPACK_PATH}/include
      LIBS += -llapack -lblas  -lg2c
      LIBS += -L$${LAPACK_PATH}/lib
    } else {
      message("Using sunperf.")
      DEFINES += USE_SUNPERF
      LIBS += -lsunperf
      QMAKE_CFLAGS   += -dalign
      QMAKE_CXXFLAGS   += -dalign
    }
  }
  !isEmpty(EXPAT_PATH){
      LIBS+=  -L$${EXPAT_PATH}/lib
      INCLUDEPATH += $${EXPAT_PATH}/include
  }
  !isEmpty(SBML_PATH){
      LIBS+=  -L$${SBML_PATH}/lib
      INCLUDEPATH += $${SBML_PATH}/include
  }

  LIBS += -lsbml -lexpat

# The raptor library
  LIBS += -lraptor
  !isEmpty(RAPTOR_PATH){
      LIBS+=  -L$${RAPTOR_PATH}/lib
      INCLUDEPATH += $${RAPTOR_PATH}/include
  }

  contains(CONFIG, qt) {
    !isEmpty(SBW_PATH){
      LIBS+=  $${SBW_PATH}/lib/libSBW.a
      INCLUDEPATH += $${SBW_PATH}/include
      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES += LINUX SOLARIS
    }

    !isEmpty(QWT_PATH){
       LIBS+=  -L$${QWT_PATH}/lib
       INCLUDEPATH += $${QWT_PATH}/include
    }
    LIBS += -lqwt

    !isEmpty(QWT3D_PATH){
      LIBS += -L$${QWT3D_PATH}/lib/
      INCLUDEPATH += $${QWT3D_PATH}/include
    }
    LIBS += -lqwtplot3d

    !isEmpty(QTMML_PATH) {
      contains(QTMML_PATH, yes) {
        release: LIBS += -lQtSolutions_MMLWidget-2.4
        debug:   LIBS += -lQtSolutions_MMLWidget-2.4_debug
      } else {
        release: LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4.a
        debug:   LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4_debug.a
        INCLUDEPATH += $${QTMML_PATH}/include
      }

      DEFINES += HAVE_MML
    }

    LIBS += -lSM
  } else {
    QMAKE_LIBS_THREAD -= -lpthread
    QMAKE_LIBS_THREAD -= -lrt
  }
}

contains(BUILD_OS, Linux) {

  TARGET_64 = $$system($${QMAKE_CC} -dM -E - < /dev/null | grep -q __x86_64__ && echo true)

  contains(TARGET_64, true) {
    message("Creating 64 bit binaries.")
  }

  INTEL_COMPILER = $$system($${QMAKE_CC} -dM -E - < /dev/null | grep -q __INTEL_COMPILER && echo true)

  contains(INTEL_COMPILER, true) {
    message("Linking statically against Intel libraries.")
    QMAKE_LFLAGS *= -static-intel
  }

  release {
    contains(TEMPLATE, app) {
      QMAKE_POST_LINK = strip $(TARGET)
    }
  }

  contains(PACKAGE, yes) {
    QMAKE_LFLAGS -= -static
  }
  else {
    contains(STATIC_LINKAGE, yes) {
      QMAKE_LFLAGS *= -static
    }
    else {
      QMAKE_LFLAGS -= -static
    }
  }

  !isEmpty(SBML_PATH){
    INCLUDEPATH *= $${SBML_PATH}/include
    INCLUDEPATH *= $${SBML_PATH}/include/sbml

    contains(PACKAGE, yes) {
      LIBS += $${SBML_PATH}/lib/libsbml.a
    }
    else {
      LIBS += -L$${SBML_PATH}/lib
      LIBS += -lsbml
    }
  }
  else {
    contains(PACKAGE, yes) {
      error("SBML_PATH must be given.")
    }
    else {
      LIBS += -lsbml
    }
  }

  !isEmpty(EXPAT_PATH){
    INCLUDEPATH *= $${EXPAT_PATH}/include

    contains(PACKAGE, yes) {
      LIBS += $${EXPAT_PATH}/lib/libexpat.a
    }
    else {
      LIBS += -L$${EXPAT_PATH}/lib
      LIBS += -lexpat
    }
  }
  else {
    contains(PACKAGE, yes) {
      error("EXPAT_PATH must be given.")
    }
    else {
      LIBS += -lexpat
    }
  }

# The raptor library
  !isEmpty(RAPTOR_PATH){
      LIBS +=  -L$${RAPTOR_PATH}/lib
      INCLUDEPATH *= $${RAPTOR_PATH}/include

    contains(PACKAGE, yes) {
      LIBS += $${RAPTOR_PATH}/lib/libraptor.a
    }
    else {
      LIBS += -L$${RAPTOR_PATH}/lib
      LIBS += -lraptor
    }
  }
  else {
    contains(PACKAGE, yes) {
      error("RAPTOR_PATH must be given.")
    }
    else {
      LIBS += -lraptor
    }
  }

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    INCLUDEPATH *= $${MKL_PATH}/include

    contains(TARGET_64, true) {
      LIBS += -Wl,--start-group \
                $${MKL_PATH}/lib/em64t/libmkl_intel_lp64.a \
                $${MKL_PATH}/lib/em64t/libmkl_sequential.a \
                $${MKL_PATH}/lib/em64t/libmkl_core.a \
              -Wl,--end-group \
              -lpthread
    } else {
      LIBS += $${MKL_PATH}/lib/32/libmkl_solver.a \
              -Wl,--start-group \
                $${MKL_PATH}/lib/32/libmkl_intel.a \
                $${MKL_PATH}/lib/32/libmkl_sequential.a \
                $${MKL_PATH}/lib/32/libmkl_core.a \
              -Wl,--end-group \
              -lpthread
    }

  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      INCLUDEPATH += $${CLAPACK_PATH}/include
#      LIBS += -llapack -lblas -lF77 -lfl
      LIBS += -llapack -lblas -lF77
      LIBS += -L$${CLAPACK_PATH}/lib
    } else {
      !isEmpty(LAPACK_PATH) {
        message("Using lapack.")
        DEFINES += USE_LAPACK

        !contains(LAPACK_PATH, yes) {
          INCLUDEPATH *= $${LAPACK_PATH}/include

          contains(PACKAGE, yes) {
            LIBS += $${LAPACK_PATH}/lib/liblapack.a
            LIBS += $${LAPACK_PATH}/lib/libblas.a
            LIBS += $$system(locate libg2c.a)
          }
          else {
            LIBS += -L$${LAPACK_PATH}/lib
            LIBS += -llapack
            LIBS += -lblas
            HAVE_G2C = $$system(locate libg2c)
            !isEmpty(HAVE_G2C) LIBS += -lg2c
          }
        } else {
          LIBS += -llapack
          LIBS += -lblas
          HAVE_G2C = $$system(locate libg2c)
          !isEmpty(HAVE_G2C) LIBS += -lg2c
        }
      } else {
        error( "Either MKL_PATH, CLAPACK_PATH, or LAPACK_PATH must be specified" )
      }
    }
  }

  contains(CONFIG, qt) {
    !isEmpty(SBW_PATH) {
      contains(SBW_PATH, yes) {
        LIBS += -lSBW
      } else {
        LIBS += $${SBW_PATH}/lib/libSBW.a
        INCLUDEPATH *= $${SBW_PATH}/include
      }
      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES += LINUX
    }

    !isEmpty(QWT_PATH):!contains(QWT_PATH, yes) {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh -i $${QWT_PATH}/include qwt-qt4 qwt)
      LIBS *= -L$${QWT_PATH}/lib
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT_PATH}/lib qwt-qt4 qwt)
    } else {
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh qwt-qt4 qwt)
    }

    LIBS += -lqwt

    !isEmpty(QWT3D_PATH):!contains(QWT_PATH, yes) {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh -i $${QWT3D_PATH}/include qwtplot3d-qt4 qwtplt3d)
      LIBS *= -L$${QWT3D_PATH}/lib
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT3D_PATH}/lib qwtplot3d-qt4 qwtplt3d)
    } else {
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh qwtplot3d-qt4 qwtplt3d)
    }

    !isEmpty(QTMML_PATH) {
      contains(QTMML_PATH, yes) {
        LIBS += -lQtSolutions_MMLWidget-2.4
      } else {
        LIBS +=  $${QTMML_PATH}/lib/libQtSolutions_MMLWidget-2.4.a
        INCLUDEPATH *= $${QTMML_PATH}/include
      }

      DEFINES += HAVE_MML
    }

# only needed for the class CLSimpleImageTexturizer which is only
# needed if we want to create bitmaps from layouts in the backend
#contains(DEFINES,USE_CRENDER_EXTENSION) {
#	LIBS += -lpng
#       LIBS += -ljpeg
#}
  }
}

DEP1.target   = depend
DEP1.depends  = qmake

QMAKE_EXTRA_TARGETS += DEP1

# addSubdirs(subdirs,deps): Adds directories to the project that depend on
# other directories
defineTest(addSubdirs) {
    for(subdirs, 1) {
        entries = $$files($$subdirs)
        for(entry, entries) {
            name = $$replace(entry, [/\\\\], _)
            SUBDIRS += $$name
            eval ($${name}.subdir = $$entry)
            for(dep, 2):eval ($${name}.depends += $$replace(dep, [/\\\\], _))
            export ($${name}.subdir)
            export ($${name}.depends)
        }
    }
    export (SUBDIRS)
}


Bump image size

Bump image size

# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# License terms set in COPYING.md
# -------------------------------------------------

installer {
    DEFINES += QGC_INSTALL_RELEASE
    MacBuild {
        VideoEnabled {
            # Install the gstreamer framework
            # This will:
            # Copy from the original distibution into DESTDIR/gstwork (if not already there)
            # Prune the framework, removing stuff we don't need
            # Relocate all dylibs so they can work under @executable_path/...
            # Copy the result into the app bundle
            # Make sure qgroundcontrol can find them
            message("Preparing GStreamer Framework")
            QMAKE_POST_LINK += && $$BASEDIR/tools/prepare_gstreamer_framework.sh $${OUT_PWD}/gstwork/ $${DESTDIR}/$${TARGET}.app $${TARGET}
        } else {
            message("Skipping GStreamer Framework")
        }
        # We cd to release directory so we can run macdeployqt without a path to the
        # qgroundcontrol.app file. If you specify a path to the .app file the symbolic
        # links to plugins will not be created correctly.
        QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
        QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt QGroundControl.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src
        QMAKE_POST_LINK += && cd $${OUT_PWD}
        QMAKE_POST_LINK += && hdiutil create -verbose -stretch 3g -layout SPUD -srcfolder $${DESTDIR}/QGroundControl.app -volname QGroundControl $${DESTDIR}/package/QGroundControl.dmg
    }
    WindowsBuild {
        # The pdb moving command are commented out for now since we are including the .pdb in the installer. This makes it much
        # easier to debug user crashes.
        #QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY $${DESTDIR_WIN}\\qgroundcontrol.pdb
        #QMAKE_POST_LINK += $$escape_expand(\\n) del $${DESTDIR_WIN}\\qgroundcontrol.pdb
        QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\QGroundControl-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
        #QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY qgroundcontrol.pdb $${DESTDIR_WIN}
        #QMAKE_POST_LINK += $$escape_expand(\\n) del qgroundcontrol.pdb
        OTHER_FILES += deploy/qgroundcontrol_installer.nsi
    }
    LinuxBuild {
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
        QMAKE_POST_LINK += && mkdir -p release/package
        QMAKE_POST_LINK += && tar -cjf release/package/QGroundControl.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/'
    }
    AndroidBuild {
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
        QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
        QMAKE_POST_LINK += && make install INSTALL_ROOT=$${DESTDIR}/android-build/
        QMAKE_POST_LINK += && androiddeployqt --input android-libQGroundControl.so-deployment-settings.json --output $${DESTDIR}/android-build --deployment bundled --gradle --sign $${BASEDIR}/android/android_release.keystore dagar --storepass $$(ANDROID_STOREPASS)
        QMAKE_POST_LINK += && cp $${DESTDIR}/android-build/build/outputs/apk/android-build-release-signed.apk $${DESTDIR}/package/QGroundControl.apk
    }
}

# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# License terms set in COPYING.md
# -------------------------------------------------

installer {
    DEFINES += QGC_INSTALL_RELEASE
    MacBuild {
        VideoEnabled {
            # Install the gstreamer framework
            # This will:
            # Copy from the original distibution into DESTDIR/gstwork (if not already there)
            # Prune the framework, removing stuff we don't need
            # Relocate all dylibs so they can work under @executable_path/...
            # Copy the result into the app bundle
            # Make sure qgroundcontrol can find them
            message("Preparing GStreamer Framework")
            QMAKE_POST_LINK += && $$BASEDIR/tools/prepare_gstreamer_framework.sh $${OUT_PWD}/gstwork/ $${DESTDIR}/$${TARGET}.app $${TARGET}
        } else {
            message("Skipping GStreamer Framework")
        }
        # We cd to release directory so we can run macdeployqt without a path to the
        # qgroundcontrol.app file. If you specify a path to the .app file the symbolic
        # links to plugins will not be created correctly.
        QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
        QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt QGroundControl.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src
        QMAKE_POST_LINK += && cd $${OUT_PWD}
        QMAKE_POST_LINK += && hdiutil create -verbose -stretch 2g -layout SPUD -srcfolder $${DESTDIR}/QGroundControl.app -volname QGroundControl $${DESTDIR}/package/QGroundControl.dmg
    }
    WindowsBuild {
        # The pdb moving command are commented out for now since we are including the .pdb in the installer. This makes it much
        # easier to debug user crashes.
        #QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY $${DESTDIR_WIN}\\qgroundcontrol.pdb
        #QMAKE_POST_LINK += $$escape_expand(\\n) del $${DESTDIR_WIN}\\qgroundcontrol.pdb
        QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\QGroundControl-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
        #QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY qgroundcontrol.pdb $${DESTDIR_WIN}
        #QMAKE_POST_LINK += $$escape_expand(\\n) del qgroundcontrol.pdb
        OTHER_FILES += deploy/qgroundcontrol_installer.nsi
    }
    LinuxBuild {
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
        QMAKE_POST_LINK += && mkdir -p release/package
        QMAKE_POST_LINK += && tar -cjf release/package/QGroundControl.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/'
    }
    AndroidBuild {
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
        QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
        QMAKE_POST_LINK += && make install INSTALL_ROOT=$${DESTDIR}/android-build/
        QMAKE_POST_LINK += && androiddeployqt --input android-libQGroundControl.so-deployment-settings.json --output $${DESTDIR}/android-build --deployment bundled --gradle --sign $${BASEDIR}/android/android_release.keystore dagar --storepass $$(ANDROID_STOREPASS)
        QMAKE_POST_LINK += && cp $${DESTDIR}/android-build/build/outputs/apk/android-build-release-signed.apk $${DESTDIR}/package/QGroundControl.apk
    }
}


Fix convenience .qmake.cache to actually function

at the cost of legibility

QMAKE_CACHE=$${OUT_PWD}/.qmake.cache
BASE_NAME=$$PWD

# Detect stale .qmake.cache
exists($$QMAKE_CACHE) {
    !equals(PROJECTROOT, $$BASE_NAME): system(rm $$QMAKE_CACHE)
}

linux* {
    # If you change the defaults here, fix src/common.pri
    message(We set these variables in the toplevel .qmake.cache file)
    message(that qmake ascends to in perpetuity)
    message()
    message(Linux specific options: ('*' indicates that option is enabled by default))
    message(Use CONFIG+=<option> to enable and CONFIG-=<option> to disable)
    message(avahi* - Enabled Avahi support)
    message(glviewport* - Render using a GL Viewport)
    message(glgs - Render using GL graphics system (Avoid like the plague!))
}

isEmpty(PROJECTROOT) {
    message()
    system(echo "PROJECTROOT=$$BASE_NAME" > $$QMAKE_CACHE)
#$$LITERAL_HASH is not jiving in system( calls fine in echo(
    system(echo "false: CONFIG+=no-pkg-cfg no-avahi" >> $$QMAKE_CACHE)
    system(echo "CONFIG-=qt_framework" >> $$QMAKE_CACHE)
    system(echo "CONFIG+=cache-exists" >> $$QMAKE_CACHE)
    message(Cache created)
    message(Please rerun qmake)
    system(echo "equals\\(QT_MAJOR_VERSION, \\\"5\\\"\\) CONFIG+=qt5" >> $$QMAKE_CACHE)
}

QMAKE_CACHE=$${OUT_PWD}/.qmake.cache
BASE_NAME=$$PWD

# Detect stale .qmake.cache
exists($$QMAKE_CACHE) {
    !equals(PROJECTROOT, $$BASE_NAME): system(rm $$QMAKE_CACHE)
}

linux* {
    # If you change the defaults here, fix src/common.pri
    message(We set these variables in the toplevel .qmake.cache file)
    message(that qmake ascends to in perpetuity)
    message()
    message(Linux specific options: ('*' indicates that option is enabled by default))
    message(Use CONFIG+=<option> to enable and CONFIG-=<option> to disable)
    message(avahi* - Enabled Avahi support)
    message(glviewport* - Render using a GL Viewport)
    message(glgs - Render using GL graphics system (Avoid like the plague!))
}

isEmpty(PROJECTROOT) {
    message()
    system(echo "PROJECTROOT=$$BASE_NAME" > $$QMAKE_CACHE)
    system(echo "#minimal config useful for bare bones targets" >> $$QMAKE_CACHE)
    system(echo "#CONFIG+=no-pkg-cfg no-avahi" >> $$QMAKE_CACHE)
    system(echo "CONFIG-=qt_framework" >> $$QMAKE_CACHE)
    system(echo "CONFIG+=cache-exists" >> $$QMAKE_CACHE)
    message(Cache created)
    message(Please rerun qmake)
    system(echo "equals\\(QT_MAJOR_VERSION, \\\"5\\\"\\) CONFIG+=qt5" >> $$QMAKE_CACHE)
}


version 2.4

version 2.4

#
# This sets the version string for all Drishti executables.
#

DEFINES += DRISHTI_VERSION='\\"2.4\\"'

#
# This sets the version string for all Drishti executables.
#

DEFINES += DRISHTI_VERSION='\\"2.3.3\\"'


use master branch of binary artifacts

use master branch of binary artifacts

Change-Id: I25a7c780df5d6ddec5984be0e753d68c0bb79b63
Reviewed-by: David Schulz <f07954e8cc0c222cd136162588d217f330598215@digia.com>

!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
QTCREATOR_PRI_INCLUDED = 1

QTCREATOR_VERSION = 2.8.81
BINARY_ARTIFACTS_BRANCH = master

isEqual(QT_MAJOR_VERSION, 5) {

defineReplace(cleanPath) {
    return($$clean_path($$1))
}

defineReplace(targetPath) {
    return($$shell_path($$1))
}

} else { # qt5

defineReplace(cleanPath) {
    win32:1 ~= s|\\\\|/|g
    contains(1, ^/.*):pfx = /
    else:pfx =
    segs = $$split(1, /)
    out =
    for(seg, segs) {
        equals(seg, ..):out = $$member(out, 0, -2)
        else:!equals(seg, .):out += $$seg
    }
    return($$join(out, /, $$pfx))
}

defineReplace(targetPath) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}

} # qt5

defineReplace(qtLibraryName) {
   unset(LIBRARY_NAME)
   LIBRARY_NAME = $$1
   CONFIG(debug, debug|release) {
      !debug_and_release|build_pass {
          mac:RET = $$member(LIBRARY_NAME, 0)_debug
              else:win32:RET = $$member(LIBRARY_NAME, 0)d
      }
   }
   isEmpty(RET):RET = $$LIBRARY_NAME
   return($$RET)
}

defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
    return(false)
}

isEqual(QT_MAJOR_VERSION, 5) {

# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
    return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}

} else { # qt5

# For use in custom compilers which just copy files
win32:i_flag = i
defineReplace(stripSrcDir) {
    win32 {
        !contains(1, ^.:.*):1 = $$OUT_PWD/$$1
    } else {
        !contains(1, ^/.*):1 = $$OUT_PWD/$$1
    }
    out = $$cleanPath($$1)
    out ~= s|^$$re_escape($$_PRO_FILE_PWD_/)||$$i_flag
    return($$out)
}

} # qt5

!isEmpty(BUILD_TESTS):TEST = 1

isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
        TEST = 1
    }
}

isEmpty(IDE_LIBRARY_BASENAME) {
    IDE_LIBRARY_BASENAME = lib
}

equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
}

IDE_SOURCE_TREE = $$PWD
isEmpty(IDE_BUILD_TREE) {
    sub_dir = $$_PRO_FILE_PWD_
    sub_dir ~= s,^$$re_escape($$PWD),,
    IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
    IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
macx {
    IDE_APP_TARGET   = "Qt Creator"
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
    copydata = 1
    isEmpty(TIGER_COMPAT_MODE):TIGER_COMPAT_MODE=$$(QTC_TIGER_COMPAT)
    !isEqual(QT_MAJOR_VERSION, 5) {
        # Qt5 doesn't support 10.5, and will set the minimum version correctly to 10.6 or 10.7.
        isEmpty(TIGER_COMPAT_MODE) {
            QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
            QMAKE_LFLAGS *= -mmacosx-version-min=10.5
        }
    }
} else {
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
    IDE_BIN_PATH     = $$IDE_APP_PATH
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools \
    $$IDE_SOURCE_TREE/src/plugins

CONFIG += depend_includepath

LIBS += -L$$IDE_LIBRARY_PATH

!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION

unix {
    CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared

    CONFIG(debug, debug|release):MOC_DIR = $${OUT_PWD}/.moc/debug-shared
    CONFIG(release, debug|release):MOC_DIR = $${OUT_PWD}/.moc/release-shared

    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
}

win32-msvc* {
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
}

qt:greaterThan(QT_MAJOR_VERSION, 4) {
    contains(QT, core): QT += concurrent
    contains(QT, gui): QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}

QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
exists($$QBSFILE):OTHER_FILES += $$QBSFILE

# recursively resolve plugin deps
done_plugins =
for(ever) {
    isEmpty(QTC_PLUGIN_DEPENDS): \
        break()
    done_plugins += $$QTC_PLUGIN_DEPENDS
    for(dep, QTC_PLUGIN_DEPENDS) {
        include($$PWD/src/plugins/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
    }
    QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
    QTC_PLUGIN_DEPENDS -= $$unique(done_plugins)
}

# recursively resolve library deps
done_libs =
for(ever) {
    isEmpty(QTC_LIB_DEPENDS): \
        break()
    done_libs += $$QTC_LIB_DEPENDS
    for(dep, QTC_LIB_DEPENDS) {
        include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
    }
    QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)
    QTC_LIB_DEPENDS -= $$unique(done_libs)
}

!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
QTCREATOR_PRI_INCLUDED = 1

QTCREATOR_VERSION = 2.8.81
BINARY_ARTIFACTS_BRANCH = 3.0

isEqual(QT_MAJOR_VERSION, 5) {

defineReplace(cleanPath) {
    return($$clean_path($$1))
}

defineReplace(targetPath) {
    return($$shell_path($$1))
}

} else { # qt5

defineReplace(cleanPath) {
    win32:1 ~= s|\\\\|/|g
    contains(1, ^/.*):pfx = /
    else:pfx =
    segs = $$split(1, /)
    out =
    for(seg, segs) {
        equals(seg, ..):out = $$member(out, 0, -2)
        else:!equals(seg, .):out += $$seg
    }
    return($$join(out, /, $$pfx))
}

defineReplace(targetPath) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}

} # qt5

defineReplace(qtLibraryName) {
   unset(LIBRARY_NAME)
   LIBRARY_NAME = $$1
   CONFIG(debug, debug|release) {
      !debug_and_release|build_pass {
          mac:RET = $$member(LIBRARY_NAME, 0)_debug
              else:win32:RET = $$member(LIBRARY_NAME, 0)d
      }
   }
   isEmpty(RET):RET = $$LIBRARY_NAME
   return($$RET)
}

defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
    return(false)
}

isEqual(QT_MAJOR_VERSION, 5) {

# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
    return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}

} else { # qt5

# For use in custom compilers which just copy files
win32:i_flag = i
defineReplace(stripSrcDir) {
    win32 {
        !contains(1, ^.:.*):1 = $$OUT_PWD/$$1
    } else {
        !contains(1, ^/.*):1 = $$OUT_PWD/$$1
    }
    out = $$cleanPath($$1)
    out ~= s|^$$re_escape($$_PRO_FILE_PWD_/)||$$i_flag
    return($$out)
}

} # qt5

!isEmpty(BUILD_TESTS):TEST = 1

isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
        TEST = 1
    }
}

isEmpty(IDE_LIBRARY_BASENAME) {
    IDE_LIBRARY_BASENAME = lib
}

equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
}

IDE_SOURCE_TREE = $$PWD
isEmpty(IDE_BUILD_TREE) {
    sub_dir = $$_PRO_FILE_PWD_
    sub_dir ~= s,^$$re_escape($$PWD),,
    IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
    IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
macx {
    IDE_APP_TARGET   = "Qt Creator"
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
    copydata = 1
    isEmpty(TIGER_COMPAT_MODE):TIGER_COMPAT_MODE=$$(QTC_TIGER_COMPAT)
    !isEqual(QT_MAJOR_VERSION, 5) {
        # Qt5 doesn't support 10.5, and will set the minimum version correctly to 10.6 or 10.7.
        isEmpty(TIGER_COMPAT_MODE) {
            QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
            QMAKE_LFLAGS *= -mmacosx-version-min=10.5
        }
    }
} else {
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
    IDE_BIN_PATH     = $$IDE_APP_PATH
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools \
    $$IDE_SOURCE_TREE/src/plugins

CONFIG += depend_includepath

LIBS += -L$$IDE_LIBRARY_PATH

!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION

unix {
    CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared

    CONFIG(debug, debug|release):MOC_DIR = $${OUT_PWD}/.moc/debug-shared
    CONFIG(release, debug|release):MOC_DIR = $${OUT_PWD}/.moc/release-shared

    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
}

win32-msvc* {
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
}

qt:greaterThan(QT_MAJOR_VERSION, 4) {
    contains(QT, core): QT += concurrent
    contains(QT, gui): QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}

QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
exists($$QBSFILE):OTHER_FILES += $$QBSFILE

# recursively resolve plugin deps
done_plugins =
for(ever) {
    isEmpty(QTC_PLUGIN_DEPENDS): \
        break()
    done_plugins += $$QTC_PLUGIN_DEPENDS
    for(dep, QTC_PLUGIN_DEPENDS) {
        include($$PWD/src/plugins/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
    }
    QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
    QTC_PLUGIN_DEPENDS -= $$unique(done_plugins)
}

# recursively resolve library deps
done_libs =
for(ever) {
    isEmpty(QTC_LIB_DEPENDS): \
        break()
    done_libs += $$QTC_LIB_DEPENDS
    for(dep, QTC_LIB_DEPENDS) {
        include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
    }
    QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)
    QTC_LIB_DEPENDS -= $$unique(done_libs)
}


Fixed missing line in loadlibs.pri (unix build error)

# Load this from any subproject to link shared libs properly and easy.
#
# Takes a list of paths of shared libs (customLibs). The used list must
# contain 'path/to/lib/name's with path/to/lib relative to the caller.
#
# Example:
# - customLibs = ../path/to/lib/mylib ../other/path/to/otherlib
# - include(loadlibs.pri)
#
# Make sure to provide all libname.pri to set INCLUDEPATH & DEPENDPATH!
#
# Note: include(loadlibs.pri) will setup all given custom libs ->
# -> INCLUDEPATH, DEPENDPATH, LIBS, PRE_TARGETDEPS & QMAKE_LFLAGS.

include($$PWD/win32.pri)

QMAKE_PROJECT_DEPTH = 0 # Forces absolute paths

for(lib, customLibs) {
    !isEmpty(lib) {
        LIBDIR = $$dirname(lib)
        LIBNAME = $$basename(lib)
        #message("$${TARGET} is loading $$LIBNAME -> from: $$LIBDIR")

        # Load lib.pri to set INCLUDEPATH & DEPENDPATH
        exists($$_PRO_FILE_PWD_/$$LIBDIR/$$LIBNAME.pri) {
            include($$_PRO_FILE_PWD_/$$LIBDIR/$${LIBNAME}.pri)
        }
        #message($${INCLUDEPATH})

        #  Set library file extension
        LIB_EXTENSION = $$QMAKE_EXTENSION_SHLIB
        isEmpty(LIB_EXTENSION) {
            macx: LIB_EXTENSION = dylib
            unix:!macx: LIB_EXTENSION = so
        }
        win32 {
            LIB_EXTENSION = $$QMAKE_EXTENSION_STATICLIB
            isEmpty(LIB_EXTENSION) {
                LIB_EXTENSION = lib
            }
        }
        #message($${LIB_EXTENSION})

        # Get library's binary directory
        OUTDIR = $$clean_path($$OUT_PWD/$${LIBDIR})

        macx {
            frameworks += $$files($${OUTDIR}/$${LIBNAME}.framework)
            LIBS += -F$${OUTDIR}/ -framework $${LIBNAME}
            PRE_TARGETDEPS += $${OUTDIR}/$${LIBNAME}.framework
            INCLUDEPATH += -F$${LIBDIR}
        }
        win32 {
            msvc {
                LIBS += $${OUTDIR}/$${WINDIR}/$${LIBNAME}.$${LIB_EXTENSION}
                PRE_TARGETDEPS += $${OUTDIR}/$${WINDIR}/$${LIBNAME}.$${LIB_EXTENSION}
            }
            gcc {
                LIBS += $${OUTDIR}/$${WINDIR}/lib$${LIBNAME}.$${LIB_EXTENSION}
                PRE_TARGETDEPS += $${OUTDIR}/$${WINDIR}/lib$${LIBNAME}.$${LIB_EXTENSION}
            }
        }
        unix:!macx {
            LIBS += -L$${OUTDIR}/ -l$${LIBNAME}
            PRE_TARGETDEPS += $${OUTDIR}/lib$${LIBNAME}.$${LIB_EXTENSION}
            QMAKE_LFLAGS += "-Wl,-rpath,\'$$OUTDIR\'"
        }
    }
}

macx { # Deploy all linked frameworks to target bundle
    APP_LIB_FILES.files = $$frameworks
    APP_LIB_FILES.path = Contents/Frameworks/
    QMAKE_BUNDLE_DATA += APP_LIB_FILES
}

# Load this from any subproject to link shared libs properly and easy.
#
# Takes a list of paths of shared libs (customLibs). The used list must
# contain 'path/to/lib/name's with path/to/lib relative to the caller.
#
# Example:
# - customLibs = ../path/to/lib/mylib ../other/path/to/otherlib
# - include(loadlibs.pri)
#
# Make sure to provide all libname.pri to set INCLUDEPATH & DEPENDPATH!
#
# Note: include(loadlibs.pri) will setup all given custom libs ->
# -> INCLUDEPATH, DEPENDPATH, LIBS, PRE_TARGETDEPS & QMAKE_LFLAGS.

include($$PWD/win32.pri)

QMAKE_PROJECT_DEPTH = 0 # Forces absolute paths

for(lib, customLibs) {
    !isEmpty(lib) {
        LIBDIR = $$dirname(lib)
        LIBNAME = $$basename(lib)
        #message("$${TARGET} is loading $$LIBNAME -> from: $$LIBDIR")

        # Load lib.pri to set INCLUDEPATH & DEPENDPATH
        exists($$_PRO_FILE_PWD_/$$LIBDIR/$$LIBNAME.pri) {
            include($$_PRO_FILE_PWD_/$$LIBDIR/$${LIBNAME}.pri)
        }
        #message($${INCLUDEPATH})

        #  Set library file extension
        LIB_EXTENSION = $$QMAKE_EXTENSION_SHLIB
        isEmpty(LIB_EXTENSION) {
            macx: LIB_EXTENSION = dylib
            unix:!macx: LIB_EXTENSION = so
        }
        win32 {
            LIB_EXTENSION = $$QMAKE_EXTENSION_STATICLIB
            isEmpty(LIB_EXTENSION) {
                LIB_EXTENSION = lib
            }
        }
        #message($${LIB_EXTENSION})

        # Get library's binary directory
        OUTDIR = $$clean_path($$OUT_PWD/$${LIBDIR})

        macx {
            frameworks += $$files($${OUTDIR}/$${LIBNAME}.framework)
            LIBS += -F$${OUTDIR}/ -framework $${LIBNAME}
            PRE_TARGETDEPS += $${OUTDIR}/$${LIBNAME}.framework
            INCLUDEPATH += -F$${LIBDIR}
        }
        win32 {
            msvc {
                LIBS += $${OUTDIR}/$${WINDIR}/$${LIBNAME}.$${LIB_EXTENSION}
                PRE_TARGETDEPS += $${OUTDIR}/$${WINDIR}/$${LIBNAME}.$${LIB_EXTENSION}
            }
            gcc {
                LIBS += $${OUTDIR}/$${WINDIR}/lib$${LIBNAME}.$${LIB_EXTENSION}
                PRE_TARGETDEPS += $${OUTDIR}/$${WINDIR}/lib$${LIBNAME}.$${LIB_EXTENSION}
            }
        }
        unix:!macx {
            PRE_TARGETDEPS += $${OUTDIR}/lib$${LIBNAME}.$${LIB_EXTENSION}
            QMAKE_LFLAGS += "-Wl,-rpath,\'$$OUTDIR\'"
        }
    }
}

macx { # Deploy all linked frameworks to target bundle
    APP_LIB_FILES.files = $$frameworks
    APP_LIB_FILES.path = Contents/Frameworks/
    QMAKE_BUNDLE_DATA += APP_LIB_FILES
}


link against winsock2 on win32 for ntohl and friends

git-svn-id: e2fa1b4f04257a65cc3162f75ad5f19d327daceb@1712 85bd2434-ea95-11dd-8fb1-9960f2a117f8

# Common definitions

QT += network xml
QXMPP_INCLUDE_DIR = $$PWD/src
QXMPP_LIBRARY_DIR = $$PWD/lib

CONFIG(debug, debug|release) {
    QXMPP_LIBRARY_NAME = qxmpp_d
} else {
    QXMPP_LIBRARY_NAME = qxmpp
}

# Libraries used internal by QXmpp
symbian {
    QXMPP_INTERNAL_INCLUDES = $$APP_LAYER_SYSTEMINCLUDE
    QXMPP_INTERNAL_LIBS = -lesock
} else:win32 {
    QXMPP_INTERNAL_LIBS = -lws2_32
}

# Libraries for apps which use QXmpp
symbian {
    # Symbian needs a .lib extension to recognise the library as static
    QXMPP_LIBS = -L$$QXMPP_LIBRARY_DIR -l$${QXMPP_LIBRARY_NAME}.lib
} else {
    QXMPP_LIBS = -L$$QXMPP_LIBRARY_DIR -l$${QXMPP_LIBRARY_NAME}
}

# FIXME: we should be able to use the link_prl option to automatically pull
# in the extra libraries which the qxmpp library needs, but this does not
# seem to work on win32, so we specify the dependencies here:
QXMPP_LIBS += $$QXMPP_INTERNAL_LIBS

# Path of the QXmpp library file, for expressing dependency.
symbian {
} else:unix {
    QXMPP_LIBRARY_FILE = $${QXMPP_LIBRARY_DIR}/lib$${QXMPP_LIBRARY_NAME}.a
}

# Common definitions

QT += network xml
QXMPP_INCLUDE_DIR = $$PWD/src
QXMPP_LIBRARY_DIR = $$PWD/lib

CONFIG(debug, debug|release) {
    QXMPP_LIBRARY_NAME = qxmpp_d
} else {
    QXMPP_LIBRARY_NAME = qxmpp
}

# Libraries used internal by QXmpp
symbian {
    QXMPP_INTERNAL_INCLUDES = $$APP_LAYER_SYSTEMINCLUDE
    QXMPP_INTERNAL_LIBS = -lesock
}

# Libraries for apps which use QXmpp
symbian {
    # Symbian needs a .lib extension to recognise the library as static
    QXMPP_LIBS = -L$$QXMPP_LIBRARY_DIR -l$${QXMPP_LIBRARY_NAME}.lib
} else {
    QXMPP_LIBS = -L$$QXMPP_LIBRARY_DIR -l$${QXMPP_LIBRARY_NAME}
}

# FIXME: we should be able to use the link_prl option to automatically pull
# in the extra libraries which the qxmpp library needs, but this does not
# seem to work on win32, so we specify the dependencies here:
QXMPP_LIBS += $$QXMPP_INTERNAL_LIBS

# Path of the QXmpp library file, for expressing dependency.
symbian {
} else:unix {
    QXMPP_LIBRARY_FILE = $${QXMPP_LIBRARY_DIR}/lib$${QXMPP_LIBRARY_NAME}.a
}


Fixed build under linux

Fixed build under linux

win32 {
	HEADERS += \
		thirdparty/windowsmodernstyle.h \

	SOURCES += \
		thirdparty/windowsmodernstyle.cpp \
}

HEADERS += \
	thirdparty/qsKineticScroller.h \

SOURCES += \
	thirdparty/qsKineticScroller.cpp \

include (qtpropertybrowser/src/qtpropertybrowser.pri)

win32{
	HEADERS += \
		thirdparty/windowsmodernstyle.h \
		thirdparty/qsKineticScroller.h \

	SOURCES += \
		thirdparty/windowsmodernstyle.cpp \
		thirdparty/qsKineticScroller.cpp \
}

include (qtpropertybrowser/src/qtpropertybrowser.pri)


add s60 packaging rules for examples

add s60 packaging rules for examples

include(../qxmpp.pri)

TEMPLATE = app

QT += network xml

CONFIG += console

INCLUDEPATH += $$QXMPP_INCLUDE_DIR
LIBS += $$QXMPP_LIBS

# FIXME: we need to express a dependency on the library, but the file name
# depends on the platform and whether the library is static or dynamic
# PRE_TARGETDEPS += $${QXMPP_LIBRARY_DIR}/lib$${QXMPP_LIB}.a

# Symbian packaging rules
symbian {
    vendorinfo = \
        "; Localised Vendor name" \
        "%{\"QXmpp\"}" \
        " " \
        "; Unique Vendor name" \
        ":\"QXmpp\"" \
        " "

    examples_deployment.pkg_prerules += vendorinfo
    DEPLOYMENT += examples_deployment

    TARGET.CAPABILITY = "NetworkServices"
}


QMake: Fix server build

QMake: Fix server build

SOURCES += $$PWD/DefaultAuthorizationProvider.cpp
SOURCES += $$PWD/LocalCluster.cpp
SOURCES += $$PWD/ServerDhLayer.cpp
SOURCES += $$PWD/ServerMessageData.cpp
SOURCES += $$PWD/ServerRpcLayer.cpp
SOURCES += $$PWD/ServerRpcOperation.cpp
SOURCES += $$PWD/ServerUtils.cpp
SOURCES += $$PWD/Session.cpp
SOURCES += $$PWD/Storage.cpp
SOURCES += $$PWD/RpcOperationFactory.cpp
SOURCES += $$PWD/RpcProcessingContext.cpp
SOURCES += $$PWD/TelegramServer.cpp
SOURCES += $$PWD/TelegramServerConfig.cpp
SOURCES += $$PWD/TelegramServerUser.cpp
SOURCES += $$PWD/CServerTcpTransport.cpp
SOURCES += $$PWD/RemoteClientConnection.cpp
SOURCES += $$PWD/RemoteServerConnection.cpp
SOURCES += $$PWD/FunctionStreamOperators.cpp

HEADERS += $$PWD/AuthorizationProvider.hpp
HEADERS += $$PWD/DefaultAuthorizationProvider.hpp
HEADERS += $$PWD/LocalCluster.hpp
HEADERS += $$PWD/ServerApi.hpp
HEADERS += $$PWD/ServerDhLayer.hpp
HEADERS += $$PWD/ServerNamespace.hpp
HEADERS += $$PWD/ServerMessageData.hpp
HEADERS += $$PWD/ServerRpcLayer.hpp
HEADERS += $$PWD/ServerRpcOperation.hpp
HEADERS += $$PWD/ServerUtils.hpp
HEADERS += $$PWD/Session.hpp
HEADERS += $$PWD/Storage.hpp
HEADERS += $$PWD/RpcOperationFactory.hpp
HEADERS += $$PWD/RpcOperationFactory_p.hpp
HEADERS += $$PWD/RpcProcessingContext.hpp
HEADERS += $$PWD/TelegramServer.hpp
HEADERS += $$PWD/TelegramServerConfig.hpp
HEADERS += $$PWD/TelegramServerUser.hpp
HEADERS += $$PWD/CServerTcpTransport.hpp
HEADERS += $$PWD/RemoteClientConnection.hpp
HEADERS += $$PWD/RemoteServerConnection.hpp
HEADERS += $$PWD/FunctionStreamOperators.hpp

include(RpcOperations/operations.pri)

SOURCES += $$PWD/DefaultAuthorizationProvider.cpp
SOURCES += $$PWD/LocalCluster.cpp
SOURCES += $$PWD/ServerDhLayer.cpp
SOURCES += $$PWD/ServerRpcLayer.cpp
SOURCES += $$PWD/ServerRpcOperation.cpp
SOURCES += $$PWD/Session.cpp
SOURCES += $$PWD/RpcOperationFactory.cpp
SOURCES += $$PWD/RpcProcessingContext.cpp
SOURCES += $$PWD/TelegramServer.cpp
SOURCES += $$PWD/TelegramServerUser.cpp
SOURCES += $$PWD/CServerTcpTransport.cpp
SOURCES += $$PWD/RemoteClientConnection.cpp
SOURCES += $$PWD/RemoteServerConnection.cpp
SOURCES += $$PWD/FunctionStreamOperators.cpp

HEADERS += $$PWD/AuthorizationProvider.hpp
HEADERS += $$PWD/DefaultAuthorizationProvider.hpp
HEADERS += $$PWD/LocalCluster.hpp
HEADERS += $$PWD/ServerApi.hpp
HEADERS += $$PWD/ServerDhLayer.hpp
HEADERS += $$PWD/ServerNamespace.hpp
HEADERS += $$PWD/ServerRpcLayer.hpp
HEADERS += $$PWD/ServerRpcOperation.hpp
HEADERS += $$PWD/Session.hpp
HEADERS += $$PWD/RpcOperationFactory.hpp
HEADERS += $$PWD/RpcOperationFactory_p.hpp
HEADERS += $$PWD/RpcProcessingContext.hpp
HEADERS += $$PWD/TelegramServer.hpp
HEADERS += $$PWD/TelegramServerUser.hpp
HEADERS += $$PWD/CServerTcpTransport.hpp
HEADERS += $$PWD/RemoteClientConnection.hpp
HEADERS += $$PWD/RemoteServerConnection.hpp
HEADERS += $$PWD/FunctionStreamOperators.hpp

include(RpcOperations/operations.pri)


Let's release 4.10.0

Let's release 4.10.0

From now on, tagged releases will be configured in release mode.
Right after the release, the sources will be brought back to debug

#############################################################################
# Application name & version
#############################################################################

APPNAME    = Q Light Controller Plus
FXEDNAME   = Fixture Definition Editor
APPVERSION = 4.10.0

#############################################################################
# Compiler & linker configuration
#############################################################################

# Treat all compiler warnings as errors
QMAKE_CXXFLAGS += -Werror

CONFIG         += warn_on

# Build everything in the order specified in .pro files
CONFIG         += ordered

# Enable the following 2 lines when making a release
CONFIG         += release
DEFINES        += QT_NO_DEBUG_OUTPUT

# Disable this when making a release
CONFIG         -= debug

!macx:!ios: {
 system( g++ --version | grep -e "4.6.[0-9]" ) {
   message("g++ version 4.6 found")
   QMAKE_CXXFLAGS += -Wno-error=strict-overflow
 }
 else {
   QMAKE_CXXFLAGS += -Wno-unused-local-typedefs # Fix to build with GCC 4.8
 }
}

# Disable these if you don't want to see SVN revision in the About Box
#unix:REVISION = $$system(svn info | grep "Revision" | sed 's/Revision://')
#unix:APPVERSION = $$APPVERSION-r$$REVISION

unix:OLA_GIT    = /usr/src/ola    # OLA directories

#macx:CONFIG   += x86 ppc  # Build universal binaries (Leopard only)
macx:CONFIG    -= app_bundle # Let QLC+ construct the .app bundle
# Qt 5.5 and above
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
  macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
}

# Produce build targets to the source directory
win32:DESTDIR  = ./

# Don't whine about some imports
win32:QMAKE_LFLAGS += -Wl,--enable-auto-import

# Enable unit test coverage measurement ('qmake CONFIG+=coverage' works, too)
#CONFIG        += coverage

#############################################################################
# Installation paths
#############################################################################

# Install root
win32:INSTALLROOT       = $$(SystemDrive)/qlcplus
macx:INSTALLROOT        = ~/QLC+.app/Contents
unix:!macx:INSTALLROOT += /usr
android:INSTALLROOT     = /
ios:INSTALLROOT         = /

# Binaries
win32:BINDIR      =
unix:!macx:BINDIR = bin
macx:BINDIR       = MacOS
android:BINDIR    = bin
ios:BINDIR        =

# Libraries
win32:LIBSDIR      =
unix:!macx:LIBSDIR = lib
macx:LIBSDIR       = Frameworks
android:LIBSDIR    = /libs/armeabi-v7a
ios:LIBSDIR        = lib

# Data
win32:DATADIR      =
unix:!macx:DATADIR = share/qlcplus
macx:DATADIR       = Resources
android:DATADIR    = /assets
ios:DATADIR        =

# User Data
win32:USERDATADIR      = QLC+
unix:!macx:USERDATADIR = .qlcplus
macx:USERDATADIR       = "Library/Application Support/QLC+"
android:USERDATADIR    = .qlcplus
ios:USERDATADIR        = .qlcplus

# Documentation
win32:DOCSDIR      = Documents
unix:!macx:DOCSDIR = $$DATADIR/documents
macx:DOCSDIR       = $$DATADIR/Documents
android:DOCSDIR    = $$DATADIR/documents
ios:DOCSDIR        = Documents

# Input profiles
win32:INPUTPROFILEDIR      = InputProfiles
unix:!macx:INPUTPROFILEDIR = $$DATADIR/inputprofiles
macx:INPUTPROFILEDIR       = $$DATADIR/InputProfiles
android:INPUTPROFILEDIR    = $$DATADIR/inputprofiles
ios:INPUTPROFILEDIR        = InputProfiles

# User input profiles
win32:USERINPUTPROFILEDIR      = $$USERDATADIR/InputProfiles
unix:!macx:USERINPUTPROFILEDIR = $$USERDATADIR/inputprofiles
macx:USERINPUTPROFILEDIR       = $$USERDATADIR/InputProfiles
android:USERINPUTPROFILEDIR    = $$USERDATADIR/inputprofiles
ios:USERINPUTPROFILEDIR        = $$USERDATADIR/InputProfiles

# Midi templates
win32:MIDITEMPLATEDIR      = MidiTemplates
unix:!macx:MIDITEMPLATEDIR = $$DATADIR/miditemplates
macx:MIDITEMPLATEDIR       = $$DATADIR/MidiTemplates
android:MIDITEMPLATEDIR    = $$DATADIR/miditemplates
ios:MIDITEMPLATEDIR        = MidiTemplates

# User midi templates
win32:USERMIDITEMPLATEDIR      = $$USERDATADIR/MidiTemplates
unix:!macx:USERMIDITEMPLATEDIR = $$USERDATADIR/miditemplates
macx:USERMIDITEMPLATEDIR       = $$USERDATADIR/MidiTemplates
android:USERMIDITEMPLATEDIR    = $$USERDATADIR/miditemplates
ios:USERMIDITEMPLATEDIR        = $$USERDATADIR/MidiTemplates

# Channel modifiers templates
win32:MODIFIERSTEMPLATEDIR      = ModifiersTemplates
unix:!macx:MODIFIERSTEMPLATEDIR = $$DATADIR/modifierstemplates
macx:MODIFIERSTEMPLATEDIR       = $$DATADIR/ModifiersTemplates
android:MODIFIERSTEMPLATEDIR    = $$DATADIR/modifierstemplates
ios:MODIFIERSTEMPLATEDIR        = ModifiersTemplates

# User midi templates
win32:USERMODIFIERSTEMPLATEDIR      = $$USERDATADIR/ModifiersTemplates
unix:!macx:USERMODIFIERSTEMPLATEDIR = $$USERDATADIR/modifierstemplates
macx:USERMODIFIERSTEMPLATEDIR       = $$USERDATADIR/ModifiersTemplates
android:USERMODIFIERSTEMPLATEDIR    = $$USERDATADIR/modifierstemplates
ios:USERMODIFIERSTEMPLATEDIR        = $$USERDATADIR/ModifiersTemplates

# Fixtures
win32:FIXTUREDIR      = Fixtures
unix:!macx:FIXTUREDIR = $$DATADIR/fixtures
macx:FIXTUREDIR       = $$DATADIR/Fixtures
android:FIXTUREDIR    = $$DATADIR/fixtures
ios:FIXTUREDIR        = Fixtures

# Gobos
win32:GOBODIR      = Gobos
unix:!macx:GOBODIR = $$DATADIR/gobos
macx:GOBODIR       = $$DATADIR/Gobos
android:GOBODIR    = $$DATADIR/gobos
ios:GOBODIR        = Gobos

# User fixtures
win32:USERFIXTUREDIR      = $$USERDATADIR/Fixtures
unix:!macx:USERFIXTUREDIR = $$USERDATADIR/fixtures
macx:USERFIXTUREDIR       = $$USERDATADIR/Fixtures
android:USERFIXTUREDIR    = $$USERDATADIR/fixtures
ios:USERFIXTUREDIR        = $$USERDATADIR/Fixtures

# Plugins
win32:PLUGINDIR      = Plugins
unix:!macx:PLUGINDIR = $$LIBSDIR/qt4/plugins/qlcplus
macx:PLUGINDIR       = PlugIns
android:PLUGINDIR    = Plugins
ios:PLUGINDIR        = Plugins

# Translations
win32:TRANSLATIONDIR      =
unix:!macx:TRANSLATIONDIR = $$DATADIR/translations
macx:TRANSLATIONDIR       = $$DATADIR/Translations
android:TRANSLATIONDIR    = $$DATADIR/translations
ios:TRANSLATIONDIR        =

# RGB Scripts
win32:RGBSCRIPTDIR      = RGBScripts
unix:!macx:RGBSCRIPTDIR = $$DATADIR/rgbscripts
macx:RGBSCRIPTDIR       = $$DATADIR/RGBScripts
android:RGBSCRIPTDIR    = $$DATADIR/rgbscripts
ios:RGBSCRIPTDIR        = RGBScripts

# User RGB Scripts
win32:USERRGBSCRIPTDIR      = $$USERDATADIR/RGBScripts
unix:!macx:USERRGBSCRIPTDIR = $$USERDATADIR/rgbscripts
macx:USERRGBSCRIPTDIR       = $$USERDATADIR/RGBScripts
android:USERRGBSCRIPTDIR    = $$USERDATADIR/rgbscripts
ios:USERRGBSCRIPTDIR        = $$USERDATADIR/RGBScripts

# RGB Scripts
win32:WEBFILESDIR      = Web
unix:!macx:WEBFILESDIR = $$DATADIR/web
macx:WEBFILESDIR       = $$DATADIR/Web
android:WEBFILESDIR    = $$DATADIR/web
ios:WEBFILESDIR        = Web

#############################################################################
# Application name & version
#############################################################################

APPNAME    = Q Light Controller Plus
FXEDNAME   = Fixture Definition Editor
APPVERSION = 4.10.0 GIT

#############################################################################
# Compiler & linker configuration
#############################################################################

# Treat all compiler warnings as errors
QMAKE_CXXFLAGS += -Werror

CONFIG         += warn_on

# Build everything in the order specified in .pro files
CONFIG         += ordered

# Enable the following 2 lines when making a release
CONFIG         -= release
#DEFINES        += QT_NO_DEBUG_OUTPUT

# Disable this when making a release
CONFIG         += debug

!macx:!ios: {
 system( g++ --version | grep -e "4.6.[0-9]" ) {
   message("g++ version 4.6 found")
   QMAKE_CXXFLAGS += -Wno-error=strict-overflow
 }
 else {
   QMAKE_CXXFLAGS += -Wno-unused-local-typedefs # Fix to build with GCC 4.8
 }
}

# Disable these if you don't want to see SVN revision in the About Box
#unix:REVISION = $$system(svn info | grep "Revision" | sed 's/Revision://')
#unix:APPVERSION = $$APPVERSION-r$$REVISION

unix:OLA_GIT    = /usr/src/ola    # OLA directories

#macx:CONFIG   += x86 ppc  # Build universal binaries (Leopard only)
macx:CONFIG    -= app_bundle # Let QLC+ construct the .app bundle
# Qt 5.5 and above
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
  macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
}

# Produce build targets to the source directory
win32:DESTDIR  = ./

# Don't whine about some imports
win32:QMAKE_LFLAGS += -Wl,--enable-auto-import

# Enable unit test coverage measurement ('qmake CONFIG+=coverage' works, too)
#CONFIG        += coverage

#############################################################################
# Installation paths
#############################################################################

# Install root
win32:INSTALLROOT       = $$(SystemDrive)/qlcplus
macx:INSTALLROOT        = ~/QLC+.app/Contents
unix:!macx:INSTALLROOT += /usr
android:INSTALLROOT     = /
ios:INSTALLROOT         = /

# Binaries
win32:BINDIR      =
unix:!macx:BINDIR = bin
macx:BINDIR       = MacOS
android:BINDIR    = bin
ios:BINDIR        =

# Libraries
win32:LIBSDIR      =
unix:!macx:LIBSDIR = lib
macx:LIBSDIR       = Frameworks
android:LIBSDIR    = /libs/armeabi-v7a
ios:LIBSDIR        = lib

# Data
win32:DATADIR      =
unix:!macx:DATADIR = share/qlcplus
macx:DATADIR       = Resources
android:DATADIR    = /assets
ios:DATADIR        =

# User Data
win32:USERDATADIR      = QLC+
unix:!macx:USERDATADIR = .qlcplus
macx:USERDATADIR       = "Library/Application Support/QLC+"
android:USERDATADIR    = .qlcplus
ios:USERDATADIR        = .qlcplus

# Documentation
win32:DOCSDIR      = Documents
unix:!macx:DOCSDIR = $$DATADIR/documents
macx:DOCSDIR       = $$DATADIR/Documents
android:DOCSDIR    = $$DATADIR/documents
ios:DOCSDIR        = Documents

# Input profiles
win32:INPUTPROFILEDIR      = InputProfiles
unix:!macx:INPUTPROFILEDIR = $$DATADIR/inputprofiles
macx:INPUTPROFILEDIR       = $$DATADIR/InputProfiles
android:INPUTPROFILEDIR    = $$DATADIR/inputprofiles
ios:INPUTPROFILEDIR        = InputProfiles

# User input profiles
win32:USERINPUTPROFILEDIR      = $$USERDATADIR/InputProfiles
unix:!macx:USERINPUTPROFILEDIR = $$USERDATADIR/inputprofiles
macx:USERINPUTPROFILEDIR       = $$USERDATADIR/InputProfiles
android:USERINPUTPROFILEDIR    = $$USERDATADIR/inputprofiles
ios:USERINPUTPROFILEDIR        = $$USERDATADIR/InputProfiles

# Midi templates
win32:MIDITEMPLATEDIR      = MidiTemplates
unix:!macx:MIDITEMPLATEDIR = $$DATADIR/miditemplates
macx:MIDITEMPLATEDIR       = $$DATADIR/MidiTemplates
android:MIDITEMPLATEDIR    = $$DATADIR/miditemplates
ios:MIDITEMPLATEDIR        = MidiTemplates

# User midi templates
win32:USERMIDITEMPLATEDIR      = $$USERDATADIR/MidiTemplates
unix:!macx:USERMIDITEMPLATEDIR = $$USERDATADIR/miditemplates
macx:USERMIDITEMPLATEDIR       = $$USERDATADIR/MidiTemplates
android:USERMIDITEMPLATEDIR    = $$USERDATADIR/miditemplates
ios:USERMIDITEMPLATEDIR        = $$USERDATADIR/MidiTemplates

# Channel modifiers templates
win32:MODIFIERSTEMPLATEDIR      = ModifiersTemplates
unix:!macx:MODIFIERSTEMPLATEDIR = $$DATADIR/modifierstemplates
macx:MODIFIERSTEMPLATEDIR       = $$DATADIR/ModifiersTemplates
android:MODIFIERSTEMPLATEDIR    = $$DATADIR/modifierstemplates
ios:MODIFIERSTEMPLATEDIR        = ModifiersTemplates

# User midi templates
win32:USERMODIFIERSTEMPLATEDIR      = $$USERDATADIR/ModifiersTemplates
unix:!macx:USERMODIFIERSTEMPLATEDIR = $$USERDATADIR/modifierstemplates
macx:USERMODIFIERSTEMPLATEDIR       = $$USERDATADIR/ModifiersTemplates
android:USERMODIFIERSTEMPLATEDIR    = $$USERDATADIR/modifierstemplates
ios:USERMODIFIERSTEMPLATEDIR        = $$USERDATADIR/ModifiersTemplates

# Fixtures
win32:FIXTUREDIR      = Fixtures
unix:!macx:FIXTUREDIR = $$DATADIR/fixtures
macx:FIXTUREDIR       = $$DATADIR/Fixtures
android:FIXTUREDIR    = $$DATADIR/fixtures
ios:FIXTUREDIR        = Fixtures

# Gobos
win32:GOBODIR      = Gobos
unix:!macx:GOBODIR = $$DATADIR/gobos
macx:GOBODIR       = $$DATADIR/Gobos
android:GOBODIR    = $$DATADIR/gobos
ios:GOBODIR        = Gobos

# User fixtures
win32:USERFIXTUREDIR      = $$USERDATADIR/Fixtures
unix:!macx:USERFIXTUREDIR = $$USERDATADIR/fixtures
macx:USERFIXTUREDIR       = $$USERDATADIR/Fixtures
android:USERFIXTUREDIR    = $$USERDATADIR/fixtures
ios:USERFIXTUREDIR        = $$USERDATADIR/Fixtures

# Plugins
win32:PLUGINDIR      = Plugins
unix:!macx:PLUGINDIR = $$LIBSDIR/qt4/plugins/qlcplus
macx:PLUGINDIR       = PlugIns
android:PLUGINDIR    = Plugins
ios:PLUGINDIR        = Plugins

# Translations
win32:TRANSLATIONDIR      =
unix:!macx:TRANSLATIONDIR = $$DATADIR/translations
macx:TRANSLATIONDIR       = $$DATADIR/Translations
android:TRANSLATIONDIR    = $$DATADIR/translations
ios:TRANSLATIONDIR        =

# RGB Scripts
win32:RGBSCRIPTDIR      = RGBScripts
unix:!macx:RGBSCRIPTDIR = $$DATADIR/rgbscripts
macx:RGBSCRIPTDIR       = $$DATADIR/RGBScripts
android:RGBSCRIPTDIR    = $$DATADIR/rgbscripts
ios:RGBSCRIPTDIR        = RGBScripts

# User RGB Scripts
win32:USERRGBSCRIPTDIR      = $$USERDATADIR/RGBScripts
unix:!macx:USERRGBSCRIPTDIR = $$USERDATADIR/rgbscripts
macx:USERRGBSCRIPTDIR       = $$USERDATADIR/RGBScripts
android:USERRGBSCRIPTDIR    = $$USERDATADIR/rgbscripts
ios:USERRGBSCRIPTDIR        = $$USERDATADIR/RGBScripts

# RGB Scripts
win32:WEBFILESDIR      = Web
unix:!macx:WEBFILESDIR = $$DATADIR/web
macx:WEBFILESDIR       = $$DATADIR/Web
android:WEBFILESDIR    = $$DATADIR/web
ios:WEBFILESDIR        = Web