Fixed qwtplot3d include path fro Darwin.

# Begin CVS Header
#   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/common.pri,v $
#   $Revision: 1.142 $
#   $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.142 $ $Author: shoops $ $Date: 2012/06/26 22:30:00 $
######################################################################

# 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
    QT += svg
    QT += opengl
    QT += xml
    QT += qt3support
}

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
    }

    # TODO CRITICAL To build packages we need to assure that only the static library is linked
    !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

      DEBUG_LIB += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT_PATH}/lib qwt-qt4_debug qwt_debug)
      RELEASE_LIB += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT_PATH}/lib qwt-qt4 qwt)

      debug:!isEmpty(DEBUG_LIB) {
          LIBS += $${DEBUG_LIB}
        } else {
          LIBS += $${RELEASE_LIB}
        }
    } else {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh qwt-qt4 qwt)

      DEBUG_LIB += $$system($${BUILD_ROOT}/admin/libs.sh qwt-qt4_debug qwt_debug)
      RELEASE_LIB += $$system($${BUILD_ROOT}/admin/libs.sh qwt-qt4 qwt)

      debug:!isEmpty(DEBUG_LIB) {
          LIBS += $${DEBUG_LIB}
        } else {
          LIBS += $${RELEASE_LIB}
        }
    }

    # TODO CRITICAL To build packages we need to assure that only the static library is linked
    !isEmpty(QWT3D_PATH):!contains(QWT3D_PATH, yes) {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh -i $${QWT3D_PATH}/include qwtplot3d-qt4 qwtplot3d)
      LIBS *= -L$${QWT3D_PATH}/lib
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT3D_PATH}/lib qwtplot3d-qt4 qwtplot3d)
    } else {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh qwtplot3d-qt4 qwtplot3d)
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh qwtplot3d-qt4 qwtplot3d)
    }

    !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
      }
      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
    QMAKE_LFLAGS -= -shared-intel
    QMAKE_LFLAGS_SHLIB -= -shared-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(QWT3D_PATH, yes) {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh -i $${QWT3D_PATH}/include qwtplot3d-qt4 qwtplot3d)
      LIBS *= -L$${QWT3D_PATH}/lib
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT3D_PATH}/lib qwtplot3d-qt4 qwtplot3d)
    } else {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh qwtplot3d-qt4 qwtplot3d)
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh qwtplot3d-qt4 qwtplot3d)
    }

    !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.141 $
#   $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.141 $ $Author: shoops $ $Date: 2012/06/20 19:55:37 $
######################################################################

# 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
    QT += svg
    QT += opengl
    QT += xml
    QT += qt3support
}

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
    }

    # TODO CRITICAL To build packages we need to assure that only the static library is linked
    !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

      DEBUG_LIB += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT_PATH}/lib qwt-qt4_debug qwt_debug)
      RELEASE_LIB += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT_PATH}/lib qwt-qt4 qwt)

      debug:!isEmpty(DEBUG_LIB) {
          LIBS += $${DEBUG_LIB}
        } else {
          LIBS += $${RELEASE_LIB}
        }
    } else {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh qwt-qt4 qwt)

      DEBUG_LIB += $$system($${BUILD_ROOT}/admin/libs.sh qwt-qt4_debug qwt_debug)
      RELEASE_LIB += $$system($${BUILD_ROOT}/admin/libs.sh qwt-qt4 qwt)

      debug:!isEmpty(DEBUG_LIB) {
          LIBS += $${DEBUG_LIB}
        } else {
          LIBS += $${RELEASE_LIB}
        }
    }

    # TODO CRITICAL To build packages we need to assure that only the static library is linked
    !isEmpty(QWT3D_PATH):!contains(QWT3D_PATH, yes) {
      INCLUDEPAT0H *= $$system($${BUILD_ROOT}/admin/include.sh -i $${QWT3D_PATH}/include qwtplot3d-qt4 qwtplot3d)
      LIBS *= -L$${QWT3D_PATH}/lib
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT3D_PATH}/lib qwtplot3d-qt4 qwtplot3d)
    } else {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh qwtplot3d-qt4 qwtplot3d)
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh qwtplot3d-qt4 qwtplot3d)
    }

    !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
    QMAKE_LFLAGS -= -shared-intel
    QMAKE_LFLAGS_SHLIB -= -shared-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(QWT3D_PATH, yes) {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh -i $${QWT3D_PATH}/include qwtplot3d-qt4 qwtplot3d)
      LIBS *= -L$${QWT3D_PATH}/lib
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh -l $${QWT3D_PATH}/lib qwtplot3d-qt4 qwtplot3d)
    } else {
      INCLUDEPATH *= $$system($${BUILD_ROOT}/admin/include.sh qwtplot3d-qt4 qwtplot3d)
      LIBS += $$system($${BUILD_ROOT}/admin/libs.sh qwtplot3d-qt4 qwtplot3d)
    }

    !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)
}


LDFLAGS are mapped to QMAKE_LFLAGS.

LDFLAGS are mapped to QMAKE_LFLAGS.

######################################################################
# $Revision: 1.53 $ $Author: shoops $ $Date: 2006/11/22 14:01:35 $
######################################################################

# In the case the BUILD_OS is not specified we make a guess.
isEmpty(BUILD_OS) {
  win32 {
    BUILD_OS = WIN32
  } else {
    BUILD_OS = $$system(uname)
  }
}
DEFINES += $$BUILD_OS
message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")

TARGETDEPS += Makefile

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

# COPASI License to use
DEFINES += COPASI_LICENSE_US
DEFINES -= COPASI_LICENSE_DE
contains(USE_LICENSE, DE) {
  DEFINES += COPASI_LICENSE_DE
  DEFINES -= COPASI_LICENSE_US
}

QMAKE_CFLAGS   += $$(CFLAGS)
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_LFLAGS  += $$(LDFLAGS)

debug {
  DEFINES += COPASI_DEBUG

  isEmpty(COPASI_SRC_PACKAGE) {
    DEFINES += COPASI_TSS
    DEFINES += COPASI_SENS
  }
}

isEmpty(COPASI_SRC_PACKAGE) {
  DEFINES += HAVE_MML
}

contains(STATIC_LINKAGE, yes) {
  DEFINES+=XML_STATIC
  DEFINES+=LIBSBML_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_QMAKE = $(QTDIR)/bin/qmake
  QMAKE_LEX = ../../admin/flex.sh
  QMAKE_YACC = ../../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")
  }

  myLex = \
          $(LEX) -t $< | \
          sed -e 's/class istream;/$${HASH}include "copasi.h"/' \
              -e 's/<FlexLexer.h>/"FlexLexer.h"/' \
              -e 's/$${HASH}include <unistd.h>/using namespace std;/' > $@
}

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

  INCLUDEPATH += /System/Library/Frameworks/vecLib.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
  }

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

    LIBS += $(QTDIR)/lib/libqt-mt.a

    QMAKE_LIBS_QT =
    QMAKE_LIBS_QT_THREAD =
  }

  LIBS += -framework vecLib
  LIBS += -framework Carbon
  LIBS += -framework QuickTime
  LIBS += -lz
}

contains(BUILD_OS, WIN32) {
  QMAKE_QMAKE = $(QTDIR)\bin\qmake.exe
  QMAKE_LEX = C:\cygwin\bin\bash ../../admin/flex.sh
  QMAKE_YACC = C:\cygwin\bin\bash ../../admin/yacc.sh

  DEFINES -= UNICODE
  debug {
    QMAKE_LFLAGS_WINDOWS += /NODEFAULTLIB:"msvcrt.lib"
    QMAKE_LFLAGS_CONSOLE += /NODEFAULTLIB:"msvcrt.lib"
  }

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

  QMAKE_CXXFLAGS_RELEASE -= -O1
  QMAKE_CXXFLAGS_RELEASE += -O2

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    QMAKE_CXXFLAGS_DEBUG   += -I"$${MKL_PATH}\include"
    QMAKE_CXXFLAGS_RELEASE += -I"$${MKL_PATH}\include"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${MKL_PATH}\32\lib"
    QMAKE_LFLAGS_CONSOLE += /LIBPATH:"$${MKL_PATH}\32\lib"
#    LIBS += mkl_lapack.lib mkl_p3.lib mkl_c.lib
    LIBS += mkl_lapack.lib mkl_ia32.lib guide.lib
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      QMAKE_CXXFLAGS_DEBUG   += -I"$${CLAPACK_PATH}\include"
      QMAKE_CXXFLAGS_RELEASE += -I"$${CLAPACK_PATH}\include"
      QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${CLAPACK_PATH}\lib"
      QMAKE_LFLAGS_CONSOLE += /LIBPATH:"$${CLAPACK_PATH}\lib"
      LIBS += clapack.lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }

  !isEmpty(EXPAT_PATH) {
    QMAKE_CXXFLAGS_DEBUG   += -I"$${EXPAT_PATH}\Source\lib"
    QMAKE_CXXFLAGS_RELEASE += -I"$${EXPAT_PATH}\Source\lib"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${EXPAT_PATH}\StaticLibs"
    QMAKE_LFLAGS_CONSOLE += /LIBPATH:"$${EXPAT_PATH}\StaticLibs"
    LIBS += libexpatMT.lib
  } else {
    error( "EXPAT_PATH must be specified" )
  }

  !isEmpty(SBML_PATH) {
    QMAKE_CXXFLAGS_DEBUG   += -I"$${SBML_PATH}\include"
    QMAKE_CXXFLAGS_RELEASE += -I"$${SBML_PATH}\include"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${SBML_PATH}\lib"
    QMAKE_LFLAGS_CONSOLE += /LIBPATH:"$${SBML_PATH}\lib"
    LIBS += libsbml.lib
  } else {
    error( "SBML_PATH must be specified" )
  }

  contains(CONFIG, qt) {
    LIBS += -lqwt
  }
}

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 += -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 {
      error( "Either CLAPACK_PATH or LAPACK_PATH must be specified" )
    }
  }
  !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

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

  LIBS += -lSM
}

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

  contains(STATIC_LINKAGE, yes) {
    QMAKE_LFLAGS += -static
  }

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

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

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    INCLUDEPATH += $${MKL_PATH}/include
#    LIBS += -lmkl_lapack -lmkl_ia32 -lg2c -lpthread
    LIBS += -lmkl_lapack -lmkl_ia32 -lguide -lpthread
    LIBS +=  -L$${MKL_PATH}/lib/32
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      INCLUDEPATH += $${CLAPACK_PATH}/include
      INCLUDEPATH += /usr/include/qt3
      LIBS += -llapack -lblas -lF77 -lfl
      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 {
        error( "Either MKL_PATH, CLAPACK_PATH, or LAPACK_PATH must be specified" )
      }
    }
  }

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

DEP1.target   = depend
DEP1.depends  = qmake

QMAKE_EXTRA_UNIX_TARGETS += DEP1

!equals(TEMPLATE, subdirs) {
  # Copy the sources for the tar ball
  src_distribution.depends = Makefile
  src_distribution.commands =   \
    $(CHK_DIR_EXISTS) ../../copasi_src || $(MKDIR) ../../copasi_src; \
    $(CHK_DIR_EXISTS) ../../copasi_src/copasi || \
      $(MKDIR) ../../copasi_src/copasi; \
    $(CHK_DIR_EXISTS) ../../copasi_src/copasi/$$SRC_TARGET || \
      $(MKDIR) ../../copasi_src/copasi/$$SRC_TARGET; \
    $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) \
      ../../copasi_src/copasi/$$SRC_TARGET/

  QMAKE_EXTRA_UNIX_TARGETS += src_distribution
}

######################################################################
# $Revision: 1.52 $ $Author: shoops $ $Date: 2006/11/13 14:13:33 $
######################################################################

# In the case the BUILD_OS is not specified we make a guess.
isEmpty(BUILD_OS) {
  win32 {
    BUILD_OS = WIN32
  } else {
    BUILD_OS = $$system(uname)
  }
}
DEFINES += $$BUILD_OS
message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")

TARGETDEPS += Makefile

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

# COPASI License to use
DEFINES += COPASI_LICENSE_US
DEFINES -= COPASI_LICENSE_DE
contains(USE_LICENSE, DE) {
  DEFINES += COPASI_LICENSE_DE
  DEFINES -= COPASI_LICENSE_US
}

QMAKE_CFLAGS   += $$(CFLAGS)
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_LDFLAGS  += $$(LDFLAGS)

debug {
  DEFINES += COPASI_DEBUG

  isEmpty(COPASI_SRC_PACKAGE) {
    DEFINES += COPASI_TSS
    DEFINES += COPASI_SENS
  }
}

isEmpty(COPASI_SRC_PACKAGE) {
  DEFINES += HAVE_MML
}

contains(STATIC_LINKAGE, yes) {
  DEFINES+=XML_STATIC
  DEFINES+=LIBSBML_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_QMAKE = $(QTDIR)/bin/qmake
  QMAKE_LEX = ../../admin/flex.sh
  QMAKE_YACC = ../../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")
  }

  myLex = \
          $(LEX) -t $< | \
          sed -e 's/class istream;/$${HASH}include "copasi.h"/' \
              -e 's/<FlexLexer.h>/"FlexLexer.h"/' \
              -e 's/$${HASH}include <unistd.h>/using namespace std;/' > $@
}

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

  INCLUDEPATH += /System/Library/Frameworks/vecLib.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
  }

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

    LIBS += $(QTDIR)/lib/libqt-mt.a

    QMAKE_LIBS_QT =
    QMAKE_LIBS_QT_THREAD =
  }

  LIBS += -framework vecLib
  LIBS += -framework Carbon
  LIBS += -framework QuickTime
  LIBS += -lz
}

contains(BUILD_OS, WIN32) {
  QMAKE_QMAKE = $(QTDIR)\bin\qmake.exe
  QMAKE_LEX = C:\cygwin\bin\bash ../../admin/flex.sh
  QMAKE_YACC = C:\cygwin\bin\bash ../../admin/yacc.sh

  DEFINES -= UNICODE
  debug {
    QMAKE_LFLAGS_WINDOWS += /NODEFAULTLIB:"msvcrt.lib"
    QMAKE_LFLAGS_CONSOLE += /NODEFAULTLIB:"msvcrt.lib"
  }

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

  QMAKE_CXXFLAGS_RELEASE -= -O1
  QMAKE_CXXFLAGS_RELEASE += -O2

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    QMAKE_CXXFLAGS_DEBUG   += -I"$${MKL_PATH}\include"
    QMAKE_CXXFLAGS_RELEASE += -I"$${MKL_PATH}\include"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${MKL_PATH}\32\lib"
    QMAKE_LFLAGS_CONSOLE += /LIBPATH:"$${MKL_PATH}\32\lib"
#    LIBS += mkl_lapack.lib mkl_p3.lib mkl_c.lib
    LIBS += mkl_lapack.lib mkl_ia32.lib guide.lib
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      QMAKE_CXXFLAGS_DEBUG   += -I"$${CLAPACK_PATH}\include"
      QMAKE_CXXFLAGS_RELEASE += -I"$${CLAPACK_PATH}\include"
      QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${CLAPACK_PATH}\lib"
      QMAKE_LFLAGS_CONSOLE += /LIBPATH:"$${CLAPACK_PATH}\lib"
      LIBS += clapack.lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }

  !isEmpty(EXPAT_PATH) {
    QMAKE_CXXFLAGS_DEBUG   += -I"$${EXPAT_PATH}\Source\lib"
    QMAKE_CXXFLAGS_RELEASE += -I"$${EXPAT_PATH}\Source\lib"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${EXPAT_PATH}\StaticLibs"
    QMAKE_LFLAGS_CONSOLE += /LIBPATH:"$${EXPAT_PATH}\StaticLibs"
    LIBS += libexpatMT.lib
  } else {
    error( "EXPAT_PATH must be specified" )
  }

  !isEmpty(SBML_PATH) {
    QMAKE_CXXFLAGS_DEBUG   += -I"$${SBML_PATH}\include"
    QMAKE_CXXFLAGS_RELEASE += -I"$${SBML_PATH}\include"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${SBML_PATH}\lib"
    QMAKE_LFLAGS_CONSOLE += /LIBPATH:"$${SBML_PATH}\lib"
    LIBS += libsbml.lib
  } else {
    error( "SBML_PATH must be specified" )
  }

  contains(CONFIG, qt) {
    LIBS += -lqwt
  }
}

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 += -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 {
      error( "Either CLAPACK_PATH or LAPACK_PATH must be specified" )
    }
  }
  !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

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

  LIBS += -lSM
}

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

  contains(STATIC_LINKAGE, yes) {
    QMAKE_LFLAGS += -static
  }

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

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

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    INCLUDEPATH += $${MKL_PATH}/include
#    LIBS += -lmkl_lapack -lmkl_ia32 -lg2c -lpthread
    LIBS += -lmkl_lapack -lmkl_ia32 -lguide -lpthread
    LIBS +=  -L$${MKL_PATH}/lib/32
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      INCLUDEPATH += $${CLAPACK_PATH}/include
      INCLUDEPATH += /usr/include/qt3
      LIBS += -llapack -lblas -lF77 -lfl
      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 {
        error( "Either MKL_PATH, CLAPACK_PATH, or LAPACK_PATH must be specified" )
      }
    }
  }

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

DEP1.target   = depend
DEP1.depends  = qmake

QMAKE_EXTRA_UNIX_TARGETS += DEP1

!equals(TEMPLATE, subdirs) {
  # Copy the sources for the tar ball
  src_distribution.depends = Makefile
  src_distribution.commands =   \
    $(CHK_DIR_EXISTS) ../../copasi_src || $(MKDIR) ../../copasi_src; \
    $(CHK_DIR_EXISTS) ../../copasi_src/copasi || \
      $(MKDIR) ../../copasi_src/copasi; \
    $(CHK_DIR_EXISTS) ../../copasi_src/copasi/$$SRC_TARGET || \
      $(MKDIR) ../../copasi_src/copasi/$$SRC_TARGET; \
    $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) \
      ../../copasi_src/copasi/$$SRC_TARGET/

  QMAKE_EXTRA_UNIX_TARGETS += src_distribution
}


TravisCI fixes for linux - pthread barrier shouldn't be redefined

INCLUDEPATH += \
    $$PWD/../libuv/src \
    $$PWD/../libuv/include

HEADERS += $$PWD/../libuv/src/*.h \
    $$PWD/../libuv/include/pthread-barrier.h \
    $$PWD/../libuv/include/uv-errno.h \
    $$PWD/../libuv/include/uv-threadpool.h \
    $$PWD/../libuv/include/uv-version.h \
    $$PWD/../libuv/include/uv-common.h \
    $$PWD/../libuv/include/uv.h \
    $$PWD/../libuv/include/tree.h

win32 {
    HEADERS += $$PWD/../libuv/include/uv-win.h

}

unix:!macx {
    HEADERS += $$PWD/../libuv/include/uv-unix.h
}

macx: {
    HEADERS += $$PWD/../libuv/include/uv-darwin.h
}

SOURCES += $$PWD/../libuv/src/*.c

win32 {
    INCLUDEPATH += $$PWD/../libuv/src/win
    HEADERS += $$PWD/../libuv/src/win/*.h
    SOURCES += $$PWD/../libuv/src/win/*.c
}

unix {
    INCLUDEPATH += $$PWD/../libuv/src/unix
    HEADERS += $$PWD/../libuv/src/unix/*.h
    SOURCES += $$PWD/../libuv/src/unix/async.c \
        $$PWD/../libuv/src/unix/core.c \
        $$PWD/../libuv/src/unix/dl.c \
        $$PWD/../libuv/src/unix/fs.c \
        $$PWD/../libuv/src/unix/getaddrinfo.c \
        $$PWD/../libuv/src/unix/getnameinfo.c \
        $$PWD/../libuv/src/unix/loop.c \
        $$PWD/../libuv/src/unix/pipe.c \
        $$PWD/../libuv/src/unix/poll.c \
        $$PWD/../libuv/src/unix/process.c \
        $$PWD/../libuv/src/unix/proctitle.c \
        $$PWD/../libuv/src/unix/signal.c \
        $$PWD/../libuv/src/unix/stream.c \
        $$PWD/../libuv/src/unix/tcp.c \
        $$PWD/../libuv/src/unix/thread.c \
        $$PWD/../libuv/src/unix/timer.c \
        $$PWD/../libuv/src/unix/tty.c \
        $$PWD/../libuv/src/unix/udp.c
}

unix:!macx {
    SOURCES += $$PWD/../libuv/src/unix/linux-core.c \
        $$PWD/../libuv/src/unix/linux-inotify.c \
        $$PWD/../libuv/src/unix/linux-syscalls.c
}

macx {
    SOURCES += $$PWD/../libuv/src/unix/darwin.c \
        $$PWD/../libuv/src/unix/darwin-proctitle.c \
        $$PWD/../libuv/src/unix/fsevents.c \
        $$PWD/../libuv/src/unix/kqueue.c \
        $$PWD/../libuv/src/unix/pthread-barrier.c \
        $$PWD/../libuv/src/unix/pthread-fixes.c \
}

INCLUDEPATH += \
    $$PWD/../libuv/src \
    $$PWD/../libuv/include

HEADERS += $$PWD/../libuv/src/*.h \
    $$PWD/../libuv/include/pthread-barrier.h \
    $$PWD/../libuv/include/uv-errno.h \
    $$PWD/../libuv/include/uv-threadpool.h \
    $$PWD/../libuv/include/uv-version.h \
    $$PWD/../libuv/include/uv-common.h \
    $$PWD/../libuv/include/uv.h \
    $$PWD/../libuv/include/tree.h

win32 {
    HEADERS += $$PWD/../libuv/include/uv-win.h

}

unix:!macx {
    HEADERS += $$PWD/../libuv/include/uv-unix.h
}

macx: {
    HEADERS += $$PWD/../libuv/include/uv-darwin.h
}

SOURCES += $$PWD/../libuv/src/*.c

win32 {
    INCLUDEPATH += $$PWD/../libuv/src/win
    HEADERS += $$PWD/../libuv/src/win/*.h
    SOURCES += $$PWD/../libuv/src/win/*.c
}

unix {
    INCLUDEPATH += $$PWD/../libuv/src/unix
    HEADERS += $$PWD/../libuv/src/unix/*.h
    SOURCES += $$PWD/../libuv/src/unix/async.c \
        $$PWD/../libuv/src/unix/core.c \
        $$PWD/../libuv/src/unix/dl.c \
        $$PWD/../libuv/src/unix/fs.c \
        $$PWD/../libuv/src/unix/getaddrinfo.c \
        $$PWD/../libuv/src/unix/getnameinfo.c \
        $$PWD/../libuv/src/unix/loop.c \
        $$PWD/../libuv/src/unix/pipe.c \
        $$PWD/../libuv/src/unix/poll.c \
        $$PWD/../libuv/src/unix/process.c \
        $$PWD/../libuv/src/unix/proctitle.c \
        $$PWD/../libuv/src/unix/pthread-barrier.c \
        $$PWD/../libuv/src/unix/pthread-fixes.c \
        $$PWD/../libuv/src/unix/signal.c \
        $$PWD/../libuv/src/unix/stream.c \
        $$PWD/../libuv/src/unix/tcp.c \
        $$PWD/../libuv/src/unix/thread.c \
        $$PWD/../libuv/src/unix/timer.c \
        $$PWD/../libuv/src/unix/tty.c \
        $$PWD/../libuv/src/unix/udp.c
}

unix:!macx {
    SOURCES += $$PWD/../libuv/src/unix/linux-core.c \
        $$PWD/../libuv/src/unix/linux-inotify.c \
        $$PWD/../libuv/src/unix/linux-syscalls.c
}

macx {
    SOURCES += $$PWD/../libuv/src/unix/darwin.c \
        $$PWD/../libuv/src/unix/darwin-proctitle.c \
        $$PWD/../libuv/src/unix/fsevents.c \
        $$PWD/../libuv/src/unix/kqueue.c
}


Fix CDB detection for Windows SDK 8.1

Fix CDB detection for Windows SDK 8.1

Change-Id: Ia39b736acb8ee9d35a6ee213265c780249271c49
Reviewed-by: Friedemann Kleint <1b9f2592239daaec4856ccc1cfb4d2d55b35fb71@digia.com>
Reviewed-by: Joerg Bornemann <47777b9406dbddd02a3fdca8341789a013805a11@digia.com>

# Detect presence of "Debugging Tools For Windows"
# in case MS VS compilers are used.

CDB_PATH=""
win32-msvc*|winrt {
    CDB_PATH="$$(CDB_PATH)"
    isEmpty(CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x86)/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x64)/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows 64-bit/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x86)/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x64)/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows 64-bit/sdk"
#   Starting from Windows SDK 8, the headers and libs are under 'ProgramFiles (x86)'.
#   The libraries are under 'ProgramFiles'as well, so, check for existence of 'inc'.
#   32bit qmake:
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Windows Kits/8.0/Debuggers"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Windows Kits/8.1/Debuggers"
#   64bit qmake:
    !exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles) (x86)/Windows Kits/8.0/Debuggers"
    !exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles) (x86)/Windows Kits/8.1/Debuggers"
    !exists($$CDB_PATH/inc):CDB_PATH=""
}

# Detect presence of "Debugging Tools For Windows"
# in case MS VS compilers are used.

CDB_PATH=""
win32-msvc*|winrt {
    CDB_PATH="$$(CDB_PATH)"
    isEmpty(CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x86)/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x64)/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows 64-bit/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x86)/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x64)/sdk"
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows 64-bit/sdk"
#   Starting from Windows SDK 8, the headers and libs are under 'ProgramFiles (x86)'.
#   The libraries are under 'ProgramFiles'as well, so, check for existence of 'inc'.
#   32bit qmake:
    !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Windows Kits/8.0/Debuggers"
#   64bit qmake:
    !exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles) (x86)/Windows Kits/8.0/Debuggers"
    !exists($$CDB_PATH/inc):CDB_PATH=""
}


Apparently MSVC needs EH enabled for SJLJ.

Change-Id: Ieab8157816237151dcfcf3eccfb3de177c4ad221
Reviewed-by: Simon Hausmann <a975102812d593b3191088e3d0aeaeb6f11dbcf5@digia.com>

include(llvm_installation.pri)
include(../3rdparty/masm/masm-defs.pri)

CONFIG += exceptions

!llvm: DEFINES += QMLJS_NO_LLVM

INCLUDEPATH += $$PWD

include(llvm_installation.pri)
include(../3rdparty/masm/masm-defs.pri)

!llvm: DEFINES += QMLJS_NO_LLVM

INCLUDEPATH += $$PWD


compiler_config.pri: let qmake specify -fstrict-aliasing for release builds

CONFIG += debug_and_release
CONFIG += warn_on stl rtti exceptions

QT -= core gui

CONFIG(debug, debug|release) {
  DEFINES += _DEBUG_CONFIG_
  CONFIG  += console
}
else {
  CONFIG  -= console
}

CONFIG(warn_on) {
  *-g++*:QMAKE_CXXFLAGS *= -Wextra
  GCC_CFLAGS = -Wextra -Wstrict-aliasing -Wcast-align -Wlogical-op -Wfloat-equal
  *-g++*:QMAKE_CFLAGS_DEBUG   *= $$GCC_CFLAGS
  *-g++*:QMAKE_CFLAGS_RELEASE *= $$GCC_CFLAGS
}

win32-msvc20*:QMAKE_CXXFLAGS *= -wd4996 -wd4290 -wd4503
win32-msvc*:DEFINES *= NOMINMAX
# This explicitely defines INTXX_C() and UINTXX_C() macros in <stdint.h>
DEFINES *= __STDC_CONSTANT_MACROS

CONFIG += debug_and_release
CONFIG += warn_on stl rtti exceptions

QT -= core gui

CONFIG(debug, debug|release) {
  DEFINES += _DEBUG_CONFIG_
  CONFIG  += console
}
else {
  CONFIG  -= console
}

CONFIG(warn_on) {
  *-g++*:QMAKE_CXXFLAGS *= -Wextra
  GCC_CFLAGS = -Wextra -fstrict-aliasing -Wstrict-aliasing -Wcast-align -Wlogical-op -Wfloat-equal
  *-g++*:QMAKE_CFLAGS_DEBUG   *= $$GCC_CFLAGS
  *-g++*:QMAKE_CFLAGS_RELEASE *= $$GCC_CFLAGS
}

win32-msvc20*:QMAKE_CXXFLAGS *= -wd4996 -wd4290 -wd4503
win32-msvc*:DEFINES *= NOMINMAX
# This explicitely defines INTXX_C() and UINTXX_C() macros in <stdint.h>
DEFINES *= __STDC_CONSTANT_MACROS


Build info message is slightly nicer and more informative

CONFIG      -= qt

KS_BUILD_INFO_CONFIG = Unknown
KS_BUILD_INFO_PLATFORM = $$[QMAKE_XSPEC]
KS_BUILD_INFO_SPEC = $$[QMAKE_XSPEC]
KS_BUILD_INFO_ARCH = $${QT_ARCH}

CONFIG(debug,debug|release) {
    KS_BUILD_INFO_CONFIG = Debug
}

CONFIG(release,debug|release) {
    KS_BUILD_INFO_CONFIG = Release
}

android {
    KS_BUILD_INFO_PLATFORM = Android
}
linux {
    !android {
        KS_BUILD_INFO_PLATFORM = Linux
    }
}

message("ks: Build Info: $${KS_BUILD_INFO_PLATFORM}, $${KS_BUILD_INFO_SPEC}, $${KS_BUILD_INFO_ARCH}, $${KS_BUILD_INFO_CONFIG}")

#ks_core
include($${PATH_KS}/ks_core/ks_core.pri)

#ks_ecs
include($${PATH_KS}/ks_ecs/ks_ecs.pri)

#ks_gl
include($${PATH_KS}/ks_gl/ks_gl.pri)

#ks_draw
include($${PATH_KS}/ks_draw/ks_draw.pri)

#ks_gui
include($${PATH_KS}/ks_gui/ks_gui.pri)

#ks_platform
include($${PATH_KS}/ks_platform/ks_platform.pri)

#ks_shared
include($${PATH_KS}/ks_shared/ks_shared.pri)

#ks_text
include($${PATH_KS}/ks_text/ks_text.pri)

CONFIG      -= qt

CONFIG(debug,debug|release) {
    message("ks: Debug Build")
}

CONFIG(release,debug|release) {
    message("ks: Release Build")
}

android {
    message("ks: Platform: Android")
}
linux {
    !android {
        message("ks: Platform: Linux")
    }
}

#ks_core
include($${PATH_KS}/ks_core/ks_core.pri)

#ks_ecs
include($${PATH_KS}/ks_ecs/ks_ecs.pri)

#ks_gl
include($${PATH_KS}/ks_gl/ks_gl.pri)

#ks_draw
include($${PATH_KS}/ks_draw/ks_draw.pri)

#ks_gui
include($${PATH_KS}/ks_gui/ks_gui.pri)

#ks_platform
include($${PATH_KS}/ks_platform/ks_platform.pri)

#ks_shared
include($${PATH_KS}/ks_shared/ks_shared.pri)


optimized code MusicVideo.pro [512322]

optimized code MusicVideo.pro [512322]

#-------------------------------------------------
#
# Project created by QtCreator 2014-08-08T23:19:41
#
#-------------------------------------------------

SOURCES += \
    videokits/musicvideoplayer.cpp \
    videokits/musicvideocontrol.cpp \
    videokits/musicvideoview.cpp \
    videokits/musicvideotablewidget.cpp

HEADERS  += \
    videokits/musicvideoplayer.h \
    videokits/musicvideocontrol.h \
    videokits/musicvideoview.h \
    videokits/musicvideotablewidget.h

RESOURCES += \
    qrc/MusicPlayerVedio.qrc


Changed lib extention for gcc build #13

Changed lib extention for gcc build #13

# 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 {
                LIB_EXTENSION = lib
                LIBS += $${OUTDIR}/$${WINDIR}/$${LIBNAME}.$${LIB_EXTENSION}
                PRE_TARGETDEPS += $${OUTDIR}/$${WINDIR}/$${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}/$${LIBNAME}.$${LIB_EXTENSION}
                PRE_TARGETDEPS += $${OUTDIR}/$${WINDIR}/$${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
}


fix redefinition in tests

fix redefinition in tests

#include(./../../lib/dcpconfig.pri)

INCLUDEPATH +=/usr/include/dui ../doubles

SRCDIR = ./../../src

DEPENDPATH = $$INCLUDEPATH

QMAKE_LIBDIR += ../../lib/lib/ /usr/lib/
LIBDCPINCLUDE=../../../lib/src/include
CONFIG += debug

QT += testlib

TEMPLATE = app

DEFINES += QT_NO_DEBUG_OUTPUT
#DEFINES += QT_NO_WARNING_OUTPUT
DEFINES += UNIT_TEST

coverage {
    message("Coverage options enabled")
    QMAKE_CXXFLAGS += --coverage
    QMAKE_LFLAGS += --coverage
}

target.path = $${DCP_INSTALL_LIB}/duicontrolpanel-tests
INSTALLS += target
include(check.pri)
LIBS += -L../../lib/ -L/usr/lib -lduicontrolpanel
QMAKE_CXXFLAGS += -Werror
message($$target.path)


Link with debug qwt on debug build on Windows

This avoids crash when opening a plotwindow in debug mode

# Add debug if debugmode (only default on for windows)
dbg_ext =
win32:CONFIG(debug, debug|release):dbg_ext = d

# Set hompath and libname for local install
qwt_home = $${PWD}/qwt
qwt_lib = $${qwt_home}/lib
libname = qwt

defineTest(have_local_qwt) {
  exists($${qwt_lib}) {
    return(true)
  }
  return(false)
}

defineTest(have_system_qwt) {
  unix:system(pkg-config --exists $${libname}) {
    return(true)
  } else:unix:system(ldconfig -p | grep -q lib$${libname}) {
    return(true)
  }
  return(false)
}

defineTest(have_qwt) {
  have_local_qwt() {
    return(true)
  }
  have_system_qwt() {
    return(true)
  }
  return(false)
}

have_local_qwt() {
  #QMAKEFEATURES *= $${qwt_home}/features
  #CONFIG += qwt
  INCLUDEPATH *= $${qwt_home}/include
  LIBS *= -L$${qwt_lib} -l$${libname}$${dbg_ext}
  # Note! The RPATH is absolute and only meant for dev builds in the IDE, on releaspe runtime paths should be stripped
  QMAKE_RPATHDIR *= $${qwt_lib}
  message(Found local qwt)
} else:have_system_qwt() {
  unix:CONFIG += qwt
  message(Found system qwt)
}

# Add debug if debugmode (only default on for windows)
dbg_ext =
win32:CONFIG(debug, debug|release):dbg_ext =
#unix:CONFIG(debug, debug|release):dbg_ext = d

# Set hompath and libname for local install
qwt_home = $${PWD}/qwt
qwt_lib = $${qwt_home}/lib
libname = qwt

defineTest(have_local_qwt) {
  exists($${qwt_lib}) {
    return(true)
  }
  return(false)
}

defineTest(have_system_qwt) {
  unix:system(pkg-config --exists $${libname}) {
    return(true)
  } else:unix:system(ldconfig -p | grep -q lib$${libname}) {
    return(true)
  }
  return(false)
}

defineTest(have_qwt) {
  have_local_qwt() {
    return(true)
  }
  have_system_qwt() {
    return(true)
  }
  return(false)
}

have_local_qwt() {
  #QMAKEFEATURES *= $${qwt_home}/features
  #CONFIG += qwt
  INCLUDEPATH *= $${qwt_home}/include
  LIBS *= -L$${qwt_lib} -l$${libname}$${dbg_ext}
  # Note! The RPATH is absolute and only meant for dev builds in the IDE, on releaspe runtime paths should be stripped
  QMAKE_RPATHDIR *= $${qwt_lib}
  message(Found local qwt)
} else:have_system_qwt() {
  unix:CONFIG += qwt
  message(Found system qwt)
}


Fix typo

Fix typo

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@12225 27541ba8-7e3a-0410-8455-c3a389f83636

#
# author  Valeri Fine (fine@bnl.gov)
#-------------------------------------------------------------------------
# Qmake include file to add the rules to create RootCint Dictionary
#-------------------------------------------------------------------------
#
# $Id: rootcint.pri,v 1.1 2005/06/28 13:21:39 brun Exp $
#
# Copyright (C) 2002 by Valeri Fine.  All rights reserved.
#
# This file may be distributed under the terms of the Q Public License
# as defined by Trolltech AS of Norway and appearing in the file
# LICENSE.QPL included in the packaging of this file.
#-------------------------------------------------------------------------
#
# Usage:
# -----
# To link against of the ROOT Qt layer and generate the RootCint dictionary with qmake
#-------------------------------------------------------------------------------------
# 1. Include this file into your project with QMAKE inlcude statement:
#
#    !exists ($(ROOTSYS)/include/rootcint.pri){
#        message "The Rootcint.pri was not found"
#    }
#    exists ($(ROOTSYS)/include/rootcint.pri){
#       include ($(ROOTSYS)/include/rootcint.pri)
#    }
#
# 2. Provide the list of the class header files followed by the appropriated LinkDef.f file
#    within your prpoject with CREATE_ROOT_DICT_FOR_CLASSES  QMAKE variable
# -----------------------------------------------
#
#   For example
#
#    . . .
#    !exists ($(ROOTSYS)/include/rootcint.pri){
#        message "The Rootcint.pri was not found"
#    }
#    exists ($(ROOTSYS)/include/rootcint.pri){
#       include ($(ROOTSYS)/include/rootcint.pri)
#       CREATE_ROOT_DICT_FOR_CLASSES  = ${HEADERS} MyParticle.h MyDetector.h MyEvent.h ShowerMain.h
#       CREATE_ROOT_DICT_FOR_CLASSES *= ${HEADERS} RSLinkDef.h
#    }
#    . . .
# -----------------------------------------------
#
# 3. Run "qmake"
# 4. Run "make"
#
# -----------------------------------------------

#-- permanent components to be included into any ".pro" file to build the RootCint dictionary
#

# -- define the LIBS and INCLUDEPATH variable
#
# -------  define rootlibs.pri -----------------
ROOTLIBSPRI =
ROOTLIBSPRIFILE = rootlibs.pri

isEmpty(ROOTLIBSPRI)
{
# Wow !!! Qt exists function for the nested include file applies the relative path
  exists ($$ROOTLIBSPRIFILE){
     ROOTLIBSPRI = inc/$$ROOTLIBSPRIFILE
  }
}

isEmpty(ROOTLIBSPRI)
{
  exists ($(QTROOTSYS)/include/$$ROOTLIBSPRIFILE){
     ROOTLIBSPRI = $(QTROOTSYSDIR)/include/$$ROOTLIBSPRIFILE
  }
}

isEmpty(ROOTLIBSPRI)
{
  exists ($(ROOTSYS)/include/$$ROOTLIBSPRIFILE){
     ROOTLIBSPRI = $(ROOTSYS)/include/$$ROOTLIBSPRIFILE
  }
}

isEmpty(ROOTLIBSPRI){
    message ("The $$ROOTLIBSPRIFILE was not found")
}

!isEmpty(ROOTLIBSPRI){
   include ($$ROOTLIBSPRI)
}

#
# ----------  define ootcintrule.pri  -----------------
# -- define the RootCint ROOT dictionary building rule
#
ROOTCINTRULEPRI =
ROOTCINTRULEPRIFILE = rootcintrule.pri

isEmpty(ROOTCINTRULEPRI)
{
  exists ($$ROOTCINTRULEPRIFILE){
     ROOTCINTRULEPRI = inc/$$ROOTCINTRULEPRIFILE
  }
}

isEmpty(ROOTCINTRULEPRI)
{
  exists ($(QTROOTSYSDIR)/include/$$ROOTCINTRULEPRIFILE ){
     ROOTCINTRULEPRI = $(QTROOTSYSDIR)/include/$$ROOTCINTRULEPRIFILE
  }
}

isEmpty(ROOTCINTRULEPRI)
{
  exists ($(ROOTSYS)/include/$$ROOTCINTRULEPRIFILE ){
     ROOTCINTRULEPRI = $(ROOTSYS)/include/$$ROOTCINTRULEPRIFILE
  }
}

isEmpty(ROOTCINTRULEPRI){
    message ("The $$ROOTCINTRULEPRIFILE was not found")
}
!isEmpty(ROOTCINTRULEPRI){
   include ($$ROOTCINTRULEPRI)
}

#
# author  Valeri Fine (fine@bnl.gov)
#-------------------------------------------------------------------------
# Qmake include file to add the rules to create RootCint Dictionary
#-------------------------------------------------------------------------
#
# $Id: rootcint.pri,v 1.2 2005/06/24 23:07:59 fine Exp $
#
# Copyright (C) 2002 by Valeri Fine.  All rights reserved.
#
# This file may be distributed under the terms of the Q Public License
# as defined by Trolltech AS of Norway and appearing in the file
# LICENSE.QPL included in the packaging of this file.
#-------------------------------------------------------------------------
#
# Usage:
# -----
# To link against of the ROOT Qt layer and generate the RootCint dictionary with qmake
#-------------------------------------------------------------------------------------
# 1. Include this file into your project with QMAKE inlcude statement:
#
#    !exists ($(ROOTSYS)/include/rootcint.pri){
#        message "The Rootcint.pri was not found"
#    }
#    exists ($(ROOTSYS)/include/rootcint.pri){
#       include ($(ROOTSYS)/include/rootcint.pri)
#    }
#
# 2. Provide the list of the class header files followed by the appropriated LinkDef.f file
#    within your prpoject with CREATE_ROOT_DICT_FOR_CLASSES  QMAKE variable
# -----------------------------------------------
#
#   For example
#
#    . . .
#    !exists ($(ROOTSYS)/include/rootcint.pri){
#        message "The Rootcint.pri was not found"
#    }
#    exists ($(ROOTSYS)/include/rootcint.pri){
#       include ($(ROOTSYS)/include/rootcint.pri)
#       CREATE_ROOT_DICT_FOR_CLASSES  = ${HEADERS} MyParticle.h MyDetector.h MyEvent.h ShowerMain.h
#       CREATE_ROOT_DICT_FOR_CLASSES *= ${HEADERS} RSLinkDef.h
#    }
#    . . .
# -----------------------------------------------
#
# 3. Run "qmake"
# 4. Run "make"
#
# -----------------------------------------------

#-- permanent components to be included into any ".pro" file to build the RootCint dictionary
#

# -- define the LIBS and INCLUDEPATH variable
#
# -------  define rootlibs.pri -----------------
ROOTLIBSPRI =
ROOTLIBSPRIFILE = rootlibs.pr

isEmpty(ROOTLIBSPRI)
{
# Wow !!! Qt exists function for the nested include file applies the relative path
  exists ($$ROOTLIBSPRIFILE){
     ROOTLIBSPRI = inc/$$ROOTLIBSPRIFILE
  }
}

isEmpty(ROOTLIBSPRI)
{
  exists ($(QTROOTSYS)/include/$$ROOTLIBSPRIFILE){
     ROOTLIBSPRI = $(QTROOTSYSDIR)/include/$$ROOTLIBSPRIFILE
  }
}

isEmpty(ROOTLIBSPRI)
{
  exists ($(ROOTSYS)/include/$$ROOTLIBSPRIFILE){
     ROOTLIBSPRI = $(ROOTSYS)/include/$$ROOTLIBSPRIFILE
  }
}

isEmpty(ROOTLIBSPRI){
    message ("The $$ROOTLIBSPRIFILE was not found")
}

!isEmpty(ROOTLIBSPRI){
   include ($$ROOTLIBSPRI)
}

#
# ----------  define ootcintrule.pri  -----------------
# -- define the RootCint ROOT dictionary building rule
#
ROOTCINTRULEPRI =
ROOTCINTRULEPRIFILE = rootcintrule.pri

isEmpty(ROOTCINTRULEPRI)
{
  exists ($$ROOTCINTRULEPRIFILE){
     ROOTCINTRULEPRI = inc/$$ROOTCINTRULEPRIFILE
  }
}

isEmpty(ROOTCINTRULEPRI)
{
  exists ($(QTROOTSYSDIR)/include/$$ROOTCINTRULEPRIFILE ){
     ROOTCINTRULEPRI = $(QTROOTSYSDIR)/include/$$ROOTCINTRULEPRIFILE
  }
}

isEmpty(ROOTCINTRULEPRI)
{
  exists ($(ROOTSYS)/include/$$ROOTCINTRULEPRIFILE ){
     ROOTCINTRULEPRI = $(ROOTSYS)/include/$$ROOTCINTRULEPRIFILE
  }
}

isEmpty(ROOTCINTRULEPRI){
    message ("The $$ROOTCINTRULEPRIFILE was not found")
}
!isEmpty(ROOTCINTRULEPRI){
   include ($$ROOTCINTRULEPRI)
}


protobuf: fixing shell path

protobuf: fixing shell path

#
# Qt qmake integration with Google Protocol Buffers compiler protoc
#
# To compile protocol buffers with qt qmake, specify PROTOS variable and
# include this file
#
# Example:
# LIBS += /usr/local/lib/libprotobuf.so
# PROTOS = a.proto b.proto
# include(protobuf.pri)
#
# By default protoc looks for .proto files (including the imported ones) in
# the current directory where protoc is run. If you need to include additional
# paths specify the PROTOPATH variable

isEmpty(PROTOBUF_PROTOC): PROTOBUF_PROTOC = protoc

PROTOGEN = generated

PROTOPATH += .
!isEmpty(PROTOBUF_INCLUDE_PATH): PROTOPATH += $$PROTOBUF_INCLUDE_PATH
PROTOPATHS =
for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p}

message("Generating protocol buffer classes from .proto files.")

protobuf_decl.name = protobuf headers
protobuf_decl.input = PROTOS
protobuf_decl.output = $$OUT_PWD/$$PROTOGEN/${QMAKE_FILE_BASE}.pb.h
protobuf_decl.commands = $$PROTOBUF_PROTOC --cpp_out=$$shell_path($$OUT_PWD/$$PROTOGEN/) --proto_path=${QMAKE_FILE_IN_PATH} $$PROTOPATHS ${QMAKE_FILE_NAME}
ios: {
    protobuf_decl.commands += $$escape_expand(\n\t)
    protobuf_decl.commands += sed -i \'\' -e \'s/namespace\ google /namespace\ google_public /g\' ${QMAKE_FILE_OUT} $$escape_expand(\n\t)
    protobuf_decl.commands += sed -i \'\' -e \'s/google::protobuf/google_public::protobuf/g\' ${QMAKE_FILE_OUT}
}
protobuf_decl.variable_out = HEADERS
QMAKE_EXTRA_COMPILERS += protobuf_decl

protobuf_impl.name = protobuf sources
protobuf_impl.input = PROTOS
protobuf_impl.output = $$OUT_PWD/$$PROTOGEN/${QMAKE_FILE_BASE}.pb.cc
protobuf_impl.depends = $$OUT_PWD/$$PROTOGEN/${QMAKE_FILE_BASE}.pb.h
ios: {
    protobuf_impl.commands += sed -i \'\' -e \'s/namespace\ google /namespace\ google_public /g\' ${QMAKE_FILE_OUT} $$escape_expand(\n\t)
    protobuf_impl.commands += sed -i \'\' -e \'s/google::protobuf/google_public::protobuf/g\' ${QMAKE_FILE_OUT}
}
else {
    protobuf_impl.commands = $$escape_expand(\n)
}
protobuf_impl.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += protobuf_impl

INCLUDEPATH += $$OUT_PWD/$$PROTOGEN

!isEmpty(PROTOBUF_INCLUDE_PATH): INCLUDEPATH += $$PROTOBUF_INCLUDE_PATH
!isEmpty(PROTOBUF_LIB_PATH): LIBS += -L$$PROTOBUF_LIB_PATH
!isEmpty(PROTOBUF_LIB_FLAGS): LIBS += $$PROTOBUF_LIB_FLAGS

!win32: LIBS += -lprotobuf
win32:  LIBS += -llibprotobuf

#
# Qt qmake integration with Google Protocol Buffers compiler protoc
#
# To compile protocol buffers with qt qmake, specify PROTOS variable and
# include this file
#
# Example:
# LIBS += /usr/local/lib/libprotobuf.so
# PROTOS = a.proto b.proto
# include(protobuf.pri)
#
# By default protoc looks for .proto files (including the imported ones) in
# the current directory where protoc is run. If you need to include additional
# paths specify the PROTOPATH variable

isEmpty(PROTOBUF_PROTOC): PROTOBUF_PROTOC = protoc

PROTOGEN = generated

PROTOPATH += .
!isEmpty(PROTOBUF_INCLUDE_PATH): PROTOPATH += $$PROTOBUF_INCLUDE_PATH
PROTOPATHS =
for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p}

message("Generating protocol buffer classes from .proto files.")

protobuf_decl.name = protobuf headers
protobuf_decl.input = PROTOS
protobuf_decl.output = $$OUT_PWD/$$PROTOGEN/${QMAKE_FILE_BASE}.pb.h
protobuf_decl.commands = $$PROTOBUF_PROTOC --cpp_out=$$OUT_PWD/$$PROTOGEN/ --proto_path=${QMAKE_FILE_IN_PATH} $$PROTOPATHS ${QMAKE_FILE_NAME}
ios: {
    protobuf_decl.commands += $$escape_expand(\n\t)
    protobuf_decl.commands += sed -i \'\' -e \'s/namespace\ google /namespace\ google_public /g\' ${QMAKE_FILE_OUT} $$escape_expand(\n\t)
    protobuf_decl.commands += sed -i \'\' -e \'s/google::protobuf/google_public::protobuf/g\' ${QMAKE_FILE_OUT}
}
protobuf_decl.variable_out = HEADERS
QMAKE_EXTRA_COMPILERS += protobuf_decl

protobuf_impl.name = protobuf sources
protobuf_impl.input = PROTOS
protobuf_impl.output = $$OUT_PWD/$$PROTOGEN/${QMAKE_FILE_BASE}.pb.cc
protobuf_impl.depends = $$OUT_PWD/$$PROTOGEN/${QMAKE_FILE_BASE}.pb.h
ios: {
    protobuf_impl.commands += sed -i \'\' -e \'s/namespace\ google /namespace\ google_public /g\' ${QMAKE_FILE_OUT} $$escape_expand(\n\t)
    protobuf_impl.commands += sed -i \'\' -e \'s/google::protobuf/google_public::protobuf/g\' ${QMAKE_FILE_OUT}
}
else {
    protobuf_impl.commands = $$escape_expand(\n)
}
protobuf_impl.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += protobuf_impl

INCLUDEPATH += $$OUT_PWD/$$PROTOGEN

!isEmpty(PROTOBUF_INCLUDE_PATH): INCLUDEPATH += $$PROTOBUF_INCLUDE_PATH
!isEmpty(PROTOBUF_LIB_PATH): LIBS += -L$$PROTOBUF_LIB_PATH
!isEmpty(PROTOBUF_LIB_FLAGS): LIBS += $$PROTOBUF_LIB_FLAGS

!win32: LIBS += -lprotobuf
win32:  LIBS += -llibprotobuf


install qdnslookup_p.h

install qdnslookup_p.h

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

# Header files
INSTALL_HEADERS += \
    base/qdnslookup.h \
    base/qdnslookup_p.h \
    base/QXmppArchiveIq.h \
    base/QXmppBindIq.h \
    base/QXmppBookmarkSet.h \
    base/QXmppByteStreamIq.h \
    base/QXmppCodec.h \
    base/QXmppConstants.h \
    base/QXmppDataForm.h \
    base/QXmppDiscoveryIq.h \
    base/QXmppElement.h \
    base/QXmppEntityTimeIq.h \
    base/QXmppGlobal.h \
    base/QXmppIbbIq.h \
    base/QXmppIq.h \
    base/QXmppJingleIq.h \
    base/QXmppLogger.h \
    base/QXmppMessage.h \
    base/QXmppMucIq.h \
    base/QXmppNonSASLAuth.h \
    base/QXmppPacket.h \
    base/QXmppPingIq.h \
    base/QXmppPresence.h \
    base/QXmppPubSubIq.h \
    base/QXmppRosterIq.h \
    base/QXmppRpcIq.h \
    base/QXmppRtpChannel.h \
    base/QXmppSaslAuth.h \
    base/QXmppSessionIq.h \
    base/QXmppSocks.h \
    base/QXmppStanza.h \
    base/QXmppStream.h \
    base/QXmppStreamFeatures.h \
    base/QXmppStreamInitiationIq.h \
    base/QXmppStun.h \
    base/QXmppUtils.h \
    base/QXmppVCardIq.h \
    base/QXmppVersionIq.h

# Source files
SOURCES += \
    base/QXmppArchiveIq.cpp \
    base/QXmppBindIq.cpp \
    base/QXmppBookmarkSet.cpp \
    base/QXmppByteStreamIq.cpp \
    base/QXmppCodec.cpp \
    base/QXmppConstants.cpp \
    base/QXmppDataForm.cpp \
    base/QXmppDiscoveryIq.cpp \
    base/QXmppElement.cpp \
    base/QXmppEntityTimeIq.cpp \
    base/QXmppGlobal.cpp \
    base/QXmppIbbIq.cpp \
    base/QXmppIq.cpp \
    base/QXmppJingleIq.cpp \
    base/QXmppLogger.cpp \
    base/QXmppMessage.cpp \
    base/QXmppMucIq.cpp \
    base/QXmppNonSASLAuth.cpp \
    base/QXmppPacket.cpp \
    base/QXmppPingIq.cpp \
    base/QXmppPresence.cpp \
    base/QXmppPubSubIq.cpp \
    base/QXmppRosterIq.cpp \
    base/QXmppRpcIq.cpp \
    base/QXmppRtpChannel.cpp \
    base/QXmppSaslAuth.cpp \
    base/QXmppSessionIq.cpp \
    base/QXmppSocks.cpp \
    base/QXmppStanza.cpp \
    base/QXmppStream.cpp \
    base/QXmppStreamFeatures.cpp \
    base/QXmppStreamInitiationIq.cpp \
    base/QXmppStun.cpp \
    base/QXmppUtils.cpp \
    base/QXmppVCardIq.cpp \
    base/QXmppVersionIq.cpp

# DNS
SOURCES += base/qdnslookup.cpp
android:SOURCES += base/qdnslookup_stub.cpp
else:symbian:SOURCES += base/qdnslookup_symbian.cpp
else:unix:SOURCES += base/qdnslookup_unix.cpp
else:win32:SOURCES += base/qdnslookup_win.cpp

# Header files
INSTALL_HEADERS += \
    base/qdnslookup.h \
    base/QXmppArchiveIq.h \
    base/QXmppBindIq.h \
    base/QXmppBookmarkSet.h \
    base/QXmppByteStreamIq.h \
    base/QXmppCodec.h \
    base/QXmppConstants.h \
    base/QXmppDataForm.h \
    base/QXmppDiscoveryIq.h \
    base/QXmppElement.h \
    base/QXmppEntityTimeIq.h \
    base/QXmppGlobal.h \
    base/QXmppIbbIq.h \
    base/QXmppIq.h \
    base/QXmppJingleIq.h \
    base/QXmppLogger.h \
    base/QXmppMessage.h \
    base/QXmppMucIq.h \
    base/QXmppNonSASLAuth.h \
    base/QXmppPacket.h \
    base/QXmppPingIq.h \
    base/QXmppPresence.h \
    base/QXmppPubSubIq.h \
    base/QXmppRosterIq.h \
    base/QXmppRpcIq.h \
    base/QXmppRtpChannel.h \
    base/QXmppSaslAuth.h \
    base/QXmppSessionIq.h \
    base/QXmppSocks.h \
    base/QXmppStanza.h \
    base/QXmppStream.h \
    base/QXmppStreamFeatures.h \
    base/QXmppStreamInitiationIq.h \
    base/QXmppStun.h \
    base/QXmppUtils.h \
    base/QXmppVCardIq.h \
    base/QXmppVersionIq.h

# Source files
SOURCES += \
    base/QXmppArchiveIq.cpp \
    base/QXmppBindIq.cpp \
    base/QXmppBookmarkSet.cpp \
    base/QXmppByteStreamIq.cpp \
    base/QXmppCodec.cpp \
    base/QXmppConstants.cpp \
    base/QXmppDataForm.cpp \
    base/QXmppDiscoveryIq.cpp \
    base/QXmppElement.cpp \
    base/QXmppEntityTimeIq.cpp \
    base/QXmppGlobal.cpp \
    base/QXmppIbbIq.cpp \
    base/QXmppIq.cpp \
    base/QXmppJingleIq.cpp \
    base/QXmppLogger.cpp \
    base/QXmppMessage.cpp \
    base/QXmppMucIq.cpp \
    base/QXmppNonSASLAuth.cpp \
    base/QXmppPacket.cpp \
    base/QXmppPingIq.cpp \
    base/QXmppPresence.cpp \
    base/QXmppPubSubIq.cpp \
    base/QXmppRosterIq.cpp \
    base/QXmppRpcIq.cpp \
    base/QXmppRtpChannel.cpp \
    base/QXmppSaslAuth.cpp \
    base/QXmppSessionIq.cpp \
    base/QXmppSocks.cpp \
    base/QXmppStanza.cpp \
    base/QXmppStream.cpp \
    base/QXmppStreamFeatures.cpp \
    base/QXmppStreamInitiationIq.cpp \
    base/QXmppStun.cpp \
    base/QXmppUtils.cpp \
    base/QXmppVCardIq.cpp \
    base/QXmppVersionIq.cpp

# DNS
HEADERS += base/qdnslookup_p.h
SOURCES += base/qdnslookup.cpp
android:SOURCES += base/qdnslookup_stub.cpp
else:symbian:SOURCES += base/qdnslookup_symbian.cpp
else:unix:SOURCES += base/qdnslookup_unix.cpp
else:win32:SOURCES += base/qdnslookup_win.cpp