GBS options location

GBS options location

#
# GAMS - General Algebraic Modeling System C++ API
#
# Copyright (c) 2017-2018 GAMS Software GmbH <support@gams.com>
# Copyright (c) 2017-2018 GAMS Development Corp. <support@gams.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

win32 {
    # Switch off warings caused by GAMS headers
    DEFINES += _CRT_SECURE_NO_WARNINGS
}

include (version)
# GAMS_CORE_PATH is Jenkins build switch
GAMS_CORE_TMP = $$(GAMS_CORE_PATH)
!exists($$PWD/gamsinclude.pri) {
    equals(GAMS_CORE_TMP, "") {
        macx {
            GAMSINC = GAMS_DISTRIB=/Applications/GAMS'$$GAMS_DISTRIB_MAJOR'.'$$GAMS_DISTRIB_MINOR'/sysdir \
                      GAMS_DISTRIB_C_API=\$$GAMS_DISTRIB/apifiles/C/api   \
                      GAMS_DISTRIB_CPP_API=\$$GAMS_DISTRIB/apifiles/C++/api
        }
        unix:!macx {
            GAMSINC = GAMS_DISTRIB=$$(HOME)/gams/gams'$$GAMS_DISTRIB_MAJOR'.'$$GAMS_DISTRIB_MINOR'_linux_x64_64_sfx \
                      GAMS_DISTRIB_C_API=\$$GAMS_DISTRIB/apifiles/C/api   \
                      GAMS_DISTRIB_CPP_API=\$$GAMS_DISTRIB/apifiles/C++/api
        }
        win32 {
            GAMSINC = GAMS_DISTRIB=C:/GAMS/win64/'$$GAMS_DISTRIB_MAJOR'.'$$GAMS_DISTRIB_MINOR' \
                      GAMS_DISTRIB_C_API=\$$GAMS_DISTRIB/apifiles/C/api   \
                      GAMS_DISTRIB_CPP_API=\$$GAMS_DISTRIB/apifiles/C++/api
        }
        write_file($$PWD/gamsinclude.pri,GAMSINC)
    } else {
        GAMSINC = GAMS_DISTRIB=$$(GAMS_CORE_PATH) \
                  GAMS_DISTRIB_C_API=\$$GAMS_DISTRIB/apifiles/C/api   \
                  GAMS_DISTRIB_CPP_API=\$$GAMS_DISTRIB/apifiles/C++/api
        write_file($$PWD/gamsinclude.pri,GAMSINC)
    }
}

exists($$PWD/gamsinclude.pri) {
    include($$PWD/gamsinclude.pri)
}

# GAMS_BUILD is GAMS distrib build switch
GAMS_BUILD_ENV = $$(GAMS_BUILD)
equals(GAMS_BUILD_ENV, "") {
    INCLUDEPATH += $$GAMS_DISTRIB_C_API     \
                   $$GAMS_DISTRIB_CPP_API

    SOURCES += \
        $$GAMS_DISTRIB_C_API/gclgms.c               \
        $$GAMS_DISTRIB_C_API/gmdcc.c                \
        $$GAMS_DISTRIB_C_API/cfgmcc.c               \
        $$GAMS_DISTRIB_C_API/gevmcc.c               \
        $$GAMS_DISTRIB_C_API/gmomcc.c               \
        $$GAMS_DISTRIB_C_API/optcc.c                \
        $$GAMS_DISTRIB_CPP_API/gamsoptions.cpp      \
        $$GAMS_DISTRIB_CPP_API/gamsoptionsimpl.cpp
} else {
    DEFINES += HAVE_MUTEX
    GSYS_ENV = $$(GSYS)
    equals(GSYS_ENV, "wei") {
        DEFINES += WEI
        DEFINES += CIA_WEX
    }
    equals(GSYS_ENV, "vs8") {
        DEFINES += VS8
        DEFINES += CIA_WIN
    }
    equals(GSYS_ENV, "leg") {
        DEFINES += LEG
        DEFINES += CIA_LEX
        QMAKE_CXXFLAGS += -Werror-implicit-function-declaration -Wreturn-type -Wmissing-declarations -m64
        QMAKE_CFLAGS += -Werror-implicit-function-declaration -Wreturn-type -Wmissing-prototypes -Wmissing-declarations -m64
    }
    equals(GSYS_ENV, "deg") {
        DEFINES += DEG
        DEFINES += CIA_DEX
        QMAKE_CXXFLAGS += -Werror-implicit-function-declaration -Wreturn-type -Wmissing-declarations -m64
        QMAKE_CFLAGS += -Werror-implicit-function-declaration -Wreturn-type -Wmissing-prototypes -Wmissing-declarations -m64
    }
    INCLUDEPATH += \
        $$(GPRODUCTS)/gclib                     \
        $$(GPRODUCTS)/apiwrap/gmdobj            \
        $$(GPRODUCTS)/apiwrap/joat              \
        $$(GPRODUCTS)/apiwrap/optobj            \
        $$(GPRODUCTS)/apiexamples/C++/api

    SOURCES += \
        $$(GPRODUCTS)/gclib/gclgms.c                            \
        $$(GPRODUCTS)/gclib/gcmt.c                              \
        $$(GPRODUCTS)/apiwrap/gmdobj/gmdcc.c                    \
        $$(GPRODUCTS)/apiwrap/joat/cfgmcc.c                     \
        $$(GPRODUCTS)/apiwrap/joat/gevmcc.c                     \
        $$(GPRODUCTS)/apiwrap/joat/gmomcc.c                     \
        $$(GPRODUCTS)/apiwrap/optobj/optcc.c                    \
        $$(GPRODUCTS)/apiexamples/C++/api/gamsoptions.cpp       \
        $$(GPRODUCTS)/apiexamples/C++/api/gamsoptionsimpl.cpp
}

#
# GAMS - General Algebraic Modeling System C++ API
#
# Copyright (c) 2017-2018 GAMS Software GmbH <support@gams.com>
# Copyright (c) 2017-2018 GAMS Development Corp. <support@gams.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

win32 {
    # Switch off warings caused by GAMS headers
    DEFINES += _CRT_SECURE_NO_WARNINGS
}

include (version)
# GAMS_CORE_PATH is Jenkins build switch
GAMS_CORE_TMP = $$(GAMS_CORE_PATH)
!exists($$PWD/gamsinclude.pri) {
    equals(GAMS_CORE_TMP, "") {
        macx {
            GAMSINC = GAMS_DISTRIB=/Applications/GAMS'$$GAMS_DISTRIB_MAJOR'.'$$GAMS_DISTRIB_MINOR'/sysdir \
                      GAMS_DISTRIB_C_API=\$$GAMS_DISTRIB/apifiles/C/api   \
                      GAMS_DISTRIB_CPP_API=\$$GAMS_DISTRIB/apifiles/C++/api
        }
        unix:!macx {
            GAMSINC = GAMS_DISTRIB=$$(HOME)/gams/gams'$$GAMS_DISTRIB_MAJOR'.'$$GAMS_DISTRIB_MINOR'_linux_x64_64_sfx \
                      GAMS_DISTRIB_C_API=\$$GAMS_DISTRIB/apifiles/C/api   \
                      GAMS_DISTRIB_CPP_API=\$$GAMS_DISTRIB/apifiles/C++/api
        }
        win32 {
            GAMSINC = GAMS_DISTRIB=C:/GAMS/win64/'$$GAMS_DISTRIB_MAJOR'.'$$GAMS_DISTRIB_MINOR' \
                      GAMS_DISTRIB_C_API=\$$GAMS_DISTRIB/apifiles/C/api   \
                      GAMS_DISTRIB_CPP_API=\$$GAMS_DISTRIB/apifiles/C++/api
        }
        write_file($$PWD/gamsinclude.pri,GAMSINC)
    } else {
        GAMSINC = GAMS_DISTRIB=$$(GAMS_CORE_PATH) \
                  GAMS_DISTRIB_C_API=\$$GAMS_DISTRIB/apifiles/C/api   \
                  GAMS_DISTRIB_CPP_API=\$$GAMS_DISTRIB/apifiles/C++/api
        write_file($$PWD/gamsinclude.pri,GAMSINC)
    }
}

exists($$PWD/gamsinclude.pri) {
    include($$PWD/gamsinclude.pri)
}

# GAMS_BUILD is GAMS distrib build switch
GAMS_BUILD_ENV = $$(GAMS_BUILD)
equals(GAMS_BUILD_ENV, "") {
    INCLUDEPATH += $$GAMS_DISTRIB_C_API     \
                   $$GAMS_DISTRIB_CPP_API

    SOURCES += \
        $$GAMS_DISTRIB_C_API/gclgms.c               \
        $$GAMS_DISTRIB_C_API/gmdcc.c                \
        $$GAMS_DISTRIB_C_API/cfgmcc.c               \
        $$GAMS_DISTRIB_C_API/gevmcc.c               \
        $$GAMS_DISTRIB_C_API/gmomcc.c               \
        $$GAMS_DISTRIB_C_API/optcc.c                \
        $$GAMS_DISTRIB_CPP_API/gamsoptions.cpp      \
        $$GAMS_DISTRIB_CPP_API/gamsoptionsimpl.cpp
} else {
    DEFINES += HAVE_MUTEX
    GSYS_ENV = $$(GSYS)
    equals(GSYS_ENV, "wei") {
        DEFINES += WEI
        DEFINES += CIA_WEX
    }
    equals(GSYS_ENV, "vs8") {
        DEFINES += VS8
        DEFINES += CIA_WIN
    }
    equals(GSYS_ENV, "leg") {
        DEFINES += LEG
        DEFINES += CIA_LEX
        QMAKE_CXXFLAGS += -Werror-implicit-function-declaration -Wreturn-type -Wmissing-declarations -m64
        QMAKE_CFLAGS += -Werror-implicit-function-declaration -Wreturn-type -Wmissing-prototypes -Wmissing-declarations -m64
    }
    equals(GSYS_ENV, "deg") {
        DEFINES += DEG
        DEFINES += CIA_DEX
        QMAKE_CXXFLAGS += -Werror-implicit-function-declaration -Wreturn-type -Wmissing-declarations -m64
        QMAKE_CFLAGS += -Werror-implicit-function-declaration -Wreturn-type -Wmissing-prototypes -Wmissing-declarations -m64
    }
    INCLUDEPATH += \
        $$(GPRODUCTS)/gclib                     \
        $$(GPRODUCTS)/apiwrap/gmdobj            \
        $$(GPRODUCTS)/apiwrap/joat              \
        $$(GPRODUCTS)/apiwrap/optobj            \
        $$(GPRODUCTS)/src/apiexamples/C++/api

    SOURCES += \
        $$(GPRODUCTS)/gclib/gclgms.c            \
        $$(GPRODUCTS)/gclib/gcmt.c              \
        $$(GPRODUCTS)/apiwrap/gmdobj/gmdcc.c    \
        $$(GPRODUCTS)/apiwrap/joat/cfgmcc.c     \
        $$(GPRODUCTS)/apiwrap/joat/gevmcc.c     \
        $$(GPRODUCTS)/apiwrap/joat/gmomcc.c     \
        $$(GPRODUCTS)/apiwrap/optobj/optcc.c    \
        $$(GPRODUCTS)/gamsoptions.cpp           \
        $$(GPRODUCTS)/gamsoptionsimpl.cpp
}


Improved WIN32 build.

Improved WIN32 build.

# Begin CVS Header
#   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/common.pri,v $
#   $Revision: 1.110 $
#   $Name:  $
#   $Author: shoops $
#   $Date: 2009/10/26 19:00:39 $
# End CVS Header

# 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.110 $ $Author: shoops $ $Date: 2009/10/26 19:00:39 $
######################################################################

# 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} with QTDIR=???.")
      } else {
        QMAKE_QMAKE = $(QTDIR)\bin\qmake.exe
        !build_pass: message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")
      }
	} else {
      !build_pass: message("Configuring for $${BUILD_OS} with QTDIR=$(QT4DIR).")
	}

  } else {
    BUILD_OS = $$system(uname)
    message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")
  }
}
DEFINES += $$BUILD_OS

TARGETDEPS += Makefile

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

#ifdef COPASI_LICENSE_COM
# COPASI License to use
DEFINES -= COPASI_LICENSE_US
DEFINES -= COPASI_LICENSE_DE
DEFINES -= COPASI_LICENSE_COM
DEFINES += COPASI_LICENSE_$$USE_LICENSE
#endif // COPASI_LICENSE_COM

INCLUDEPATH += ../..
QMAKE_CFLAGS   += $$(CFLAGS)
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_LFLAGS  += $$(LDFLAGS)

debug {
  DEFINES += COPASI_DEBUG
  DEFINES += COPASI_EXTUNIT

  isEmpty(COPASI_SRC_PACKAGE) {
    # DEFINES += COPASI_TSS
    #  stoichiometric stability analysis:
    # DEFINES += COPASI_SSA
  }
}

isEmpty(COPASI_SRC_PACKAGE) {
  DEFINES += HAVE_MML
}

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 = ../../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")
  }
}

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

  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
    INCLUDEPATH += $${RAPTOR_PATH}/include
  } else {
    LIBS += -lraptor
  }

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

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

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

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

contains(BUILD_OS, WIN32) {
  CONFIG += debug_and_release

  win32-icc: {
     !build_pass: message("Using Intel Compiler.")
     DEFINES += COPASI_ICC
     DEFINES += _CRT_SECURE_NO_WARNINGS
  }

  QMAKE_LEX = C:\cygwin\bin\bash ../../admin/flex.sh
  QMAKE_YACC = C:\cygwin\bin\bash ../../admin/yacc.sh

  DEFINES -= UNICODE

  #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"
    }
  }

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    QMAKE_CXXFLAGS += -I\"$${MKL_PATH}\include\"
    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
    LIBS += libiomp5mt.lib
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      QMAKE_CXXFLAGS   += -I\"$${CLAPACK_PATH}\include\"
      QMAKE_LFLAGS += /LIBPATH:\"$${CLAPACK_PATH}\lib\"
      LIBS += clapack.lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }

#expat library
  contains(RUNTIME, MT) | contains (RUNTIME, MTd) {
    LIBS += libexpatMT.lib
  } else {
    DEFINES -= XML_STATIC
    LIBS += libexpat.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\"
  } 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}\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\"
  } else {
    error( "RAPTOR_PATH must be specified" )
  }

  contains(CONFIG, qt) {
    LIBS    += SBW$${RUNTIME}.lib ws2_32.lib

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

      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES *= WIN32
    }

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

#    DEFINES        += QWT3D_NODLL

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

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
    } else {
      LIBS += -lqwtplot3d
    }

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

contains(BUILD_OS, Linux) {
  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
#    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
#      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

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

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

    !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
    } else {
      LIBS += -lqwtplot3d
    }
  }
}

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
}

# 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.109 $
#   $Name:  $
#   $Author: shoops $
#   $Date: 2009/10/22 20:01:25 $
# End CVS Header

# 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.109 $ $Author: shoops $ $Date: 2009/10/22 20:01:25 $
######################################################################

# 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} with QTDIR=???.")
      } else {
        QMAKE_QMAKE = $(QTDIR)\bin\qmake.exe
        !build_pass: message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")
      }
	} else {
      !build_pass: message("Configuring for $${BUILD_OS} with QTDIR=$(QT4DIR).")
	}

  } else {
    BUILD_OS = $$system(uname)
    message("Configuring for $${BUILD_OS} with QTDIR=$(QTDIR).")
  }
}
DEFINES += $$BUILD_OS

TARGETDEPS += Makefile

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

#ifdef COPASI_LICENSE_COM
# COPASI License to use
DEFINES -= COPASI_LICENSE_US
DEFINES -= COPASI_LICENSE_DE
DEFINES -= COPASI_LICENSE_COM
DEFINES += COPASI_LICENSE_$$USE_LICENSE
#endif // COPASI_LICENSE_COM

INCLUDEPATH += ../..
QMAKE_CFLAGS   += $$(CFLAGS)
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_LFLAGS  += $$(LDFLAGS)

debug {
  DEFINES += COPASI_DEBUG
  DEFINES += COPASI_EXTUNIT

  isEmpty(COPASI_SRC_PACKAGE) {
    # DEFINES += COPASI_TSS
    #  stoichiometric stability analysis:
    # DEFINES += COPASI_SSA
  }
}

isEmpty(COPASI_SRC_PACKAGE) {
  DEFINES += HAVE_MML
}

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 = ../../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")
  }
}

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

  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
    INCLUDEPATH += $${RAPTOR_PATH}/include
  } else {
    LIBS += -lraptor
  }

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

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

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

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

contains(BUILD_OS, WIN32) {
  win32-icc: {
     !build_pass: message("Using Intel Compiler.")
     DEFINES += COPASI_ICC
     DEFINES += _CRT_SECURE_NO_WARNINGS
  }

  QMAKE_LEX = C:\cygwin\bin\bash ../../admin/flex.sh
  QMAKE_YACC = C:\cygwin\bin\bash ../../admin/yacc.sh

  DEFINES -= UNICODE

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

  QMAKE_CXXFLAGS_RELEASE -= -O1
  QMAKE_CXXFLAGS_RELEASE *= -O2

  contains(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"
    }
  }

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    QMAKE_CXXFLAGS += -I\"$${MKL_PATH}\include\"
    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
    LIBS += libiomp5mt.lib
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      QMAKE_CXXFLAGS   += -I\"$${CLAPACK_PATH}\include\"
      QMAKE_LFLAGS += /LIBPATH:\"$${CLAPACK_PATH}\lib\"
      LIBS += clapack.lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }

#expat library
  contains(RUNTIME, MT) | contains (RUNTIME, MTd) {
    LIBS += libexpatMT.lib
  } else {
    DEFINES -= XML_STATIC
    LIBS += libexpat.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\"
  } 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}\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\"
  } else {
    error( "RAPTOR_PATH must be specified" )
  }

  contains(CONFIG, qt) {
    LIBS    += SBW$${RUNTIME}.lib ws2_32.lib

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

      DEFINES += COPASI_SBW_INTEGRATION
      DEFINES *= WIN32
    }

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

#    DEFINES        += QWT3D_NODLL

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

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
    } else {
      LIBS += -lqwtplot3d
    }

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

contains(BUILD_OS, Linux) {
  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
#    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
#      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

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

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

    !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
    } else {
      LIBS += -lqwtplot3d
    }
  }
}

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
}

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


do not link qwtplot3d if path is not set

# Begin CVS Header
#   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/common.pri,v $
#   $Revision: 1.66 $
#   $Name:  $
#   $Author: ssahle $
#   $Date: 2007/11/12 18:37:43 $
# End CVS Header

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

######################################################################
# $Revision: 1.66 $ $Author: ssahle $ $Date: 2007/11/12 18:37:43 $
######################################################################

# 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

#ifdef COPASI_LICENSE_COM
# COPASI License to use
DEFINES -= COPASI_LICENSE_US
DEFINES -= COPASI_LICENSE_DE
DEFINES -= COPASI_LICENSE_COM
DEFINES += COPASI_LICENSE_$$USE_LICENSE
#endif // COPASI_LICENSE_COM

INCLUDEPATH += ../..
QMAKE_CFLAGS   += $$(CFLAGS)
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_LFLAGS  += $$(LDFLAGS)

debug {
  DEFINES += COPASI_DEBUG
  #DEFINES += WITH_LAYOUT
  DEFINES += COPASI_TSSA

  isEmpty(COPASI_SRC_PACKAGE) {
    DEFINES += COPASI_TSS
  }
}

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/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(QWT3D_PATH){
    LIBS +=  $${QWT3D_PATH}/lib/libqwtplot3d.a
    INCLUDEPATH += $${QWT3D_PATH}/include
    DEFINES += WITH_QWT3D
  }

  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 Accelerate
  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 += /NODEFAULTLIB:"libcmt.lib"
    QMAKE_LFLAGS += /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_c.lib
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      QMAKE_CXXFLAGS   += -I"$${CLAPACK_PATH}\include"
      QMAKE_LFLAGS += /LIBPATH:"$${CLAPACK_PATH}\lib"
      LIBS += clapack.lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }

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

  !isEmpty(SBML_PATH) {
    QMAKE_CXXFLAGS   += -I"$${SBML_PATH}\include"
    QMAKE_LFLAGS += /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 {
      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

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

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
    INCLUDEPATH += $${SBML_PATH}/include/sbml
  }
  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
}

# Begin CVS Header
#   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/common.pri,v $
#   $Revision: 1.65 $
#   $Name:  $
#   $Author: akoenig $
#   $Date: 2007/11/12 16:57:44 $
# End CVS Header

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

######################################################################
# $Revision: 1.65 $ $Author: akoenig $ $Date: 2007/11/12 16:57:44 $
######################################################################

# 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

#ifdef COPASI_LICENSE_COM
# COPASI License to use
DEFINES -= COPASI_LICENSE_US
DEFINES -= COPASI_LICENSE_DE
DEFINES -= COPASI_LICENSE_COM
DEFINES += COPASI_LICENSE_$$USE_LICENSE
#endif // COPASI_LICENSE_COM

INCLUDEPATH += ../..
QMAKE_CFLAGS   += $$(CFLAGS)
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_LFLAGS  += $$(LDFLAGS)

debug {
  DEFINES += COPASI_DEBUG
  #DEFINES += WITH_LAYOUT
  DEFINES += COPASI_TSSA

  isEmpty(COPASI_SRC_PACKAGE) {
    DEFINES += COPASI_TSS
  }
}

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/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(QWT3D_PATH){
    LIBS +=  $${QWT3D_PATH}/lib/libqwtplot3d.a
    INCLUDEPATH += $${QWT3D_PATH}/include
    DEFINES += WITH_QWT3D
  } else {
    LIBS += -lqwtplot3d
  }

  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 Accelerate
  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 += /NODEFAULTLIB:"libcmt.lib"
    QMAKE_LFLAGS += /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_c.lib
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      QMAKE_CXXFLAGS   += -I"$${CLAPACK_PATH}\include"
      QMAKE_LFLAGS += /LIBPATH:"$${CLAPACK_PATH}\lib"
      LIBS += clapack.lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }

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

  !isEmpty(SBML_PATH) {
    QMAKE_CXXFLAGS   += -I"$${SBML_PATH}\include"
    QMAKE_LFLAGS += /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 {
      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

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

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
    INCLUDEPATH += $${SBML_PATH}/include/sbml
  }
  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
}


Fix for openFrameworks version 0.9.x. QMake can now be used for v0.9

# openFrameworks path.
CONFIG += USE_PRECOMPILED_LIB
OF = "E:/Development/Tools/Libraries/of_v0.9.3_vs_release"
AR = Win32
OF_VERSION = 0.9

equals(AR, "x64") {
    message("NOTICE [openFrameworks]: Using libraries for x64")
}
else:equals(AR, "Win32") {
    message("NOTICE [openFrameworks]: Using libraries for Win32")
}
else {
    message("NOTICE [openFrameworks]: Architecture is not set. Defaulting to x64")
    AR = x64
}

win32:CONFIG(debug, debug|release): {
    QMAKE_LFLAGS += /NODEFAULTLIB:PocoFoundationmdd.lib
    QMAKE_LFLAGS += /NODEFAULTLIB:atlthunk.lib
    QMAKE_LFLAGS += /NODEFAULTLIB:msvcrt
    QMAKE_LFLAGS += /NODEFAULTLIB:libcmt
    QMAKE_LFLAGS += /NODEFAULTLIB:LIBC
    QMAKE_LFLAGS += /NODEFAULTLIB:LIBCMTD

    DEFINES += "WIN32"
    DEFINES += "_DEBUG"
    DEFINES += "_CONSOLE"
    DEFINES += "POCO_STATIC"
    DEFINES += "CAIRO_WIN32_STATIC_BUILD"
    DEFINES += "DISABLE_SOME_FLOATING_POINT"
    DEFINES += "_UNICODE"
    DEFINES += "UNICODE"
}
else:win32:CONFIG(release, debug|release): {
    QMAKE_LFLAGS += /NODEFAULTLIB:PocoFoundationmd.lib
    QMAKE_LFLAGS += /NODEFAULTLIB:LIBCMT
    QMAKE_LFLAGS += /NODEFAULTLIB:LIBC.LIBS
    QMAKE_LFLAGS += /NODEFAULTLIB:atlthunk.lib

    DEFINES += "WIN32"
    DEFINES += "NDEBUG"
    DEFINES += "_CONSOLE"
    DEFINES += "POCO_STATIC"
    DEFINES += "CAIRO_WIN32_STATIC_BUILD"
    DEFINES += "DISABLE_SOME_FLOATING_POINT"
    DEFINES += "_UNICODE"
    DEFINES += "UNICODE"
}

# BOOST
win32:CONFIG(debug, debug|release): {
    LIBS += $$OF/libs/boost/lib/vs/$$AR/libboost_filesystem-vc140-mt-gd-1_58.lib
    LIBS += $$OF/libs/boost/lib/vs/$$AR/libboost_system-vc140-mt-gd-1_58.lib
}
else:win32:CONFIG(release, debug|release): {
    LIBS += $$OF/libs/boost/lib/vs/$$AR/libboost_filesystem-vc140-mt-1_58.lib
    LIBS += $$OF/libs/boost/lib/vs/$$AR/libboost_system-vc140-mt-1_58.lib
}
INCLUDEPATH += $$OF/libs/boost/include
INCLUDEPATH += $$OF/libs/boost/include/boost

# CAIRO
LIBS += $$OF/libs/cairo/lib/vs/$$AR/cairo-static.lib
LIBS += $$OF/libs/cairo/lib/vs/$$AR/libpng.lib
LIBS += $$OF/libs/cairo/lib/vs/$$AR/pixman-1.lib

INCLUDEPATH += $$OF/libs/cairo/include
INCLUDEPATH += $$OF/libs/cairo/include/libpng15
INCLUDEPATH += $$OF/libs/cairo/include/pixman-1
INCLUDEPATH += $$OF/libs/cairo/include/cairo

# FMODEX
equals(AR, "x64") {
    LIBS += $$OF/libs/fmodex/lib/vs/$$AR/fmodex64_vc.lib
}
else {
    LIBS += $$OF/libs/fmodex/lib/vs/$$AR/fmodex_vc.lib
}

INCLUDEPATH += $$OF/libs/fmodex/include

# FREEIMAGE
LIBS += $$OF/libs/FreeImage/lib/vs/$$AR/FreeImage.lib
INCLUDEPATH += $$OF/libs/FreeImage/include

# FREETYPE
LIBS += $$OF/libs/freetype/lib/vs/$$AR/libfreetype.lib
INCLUDEPATH += $$OF/libs/freetype/include
INCLUDEPATH += $$OF/libs/freetype/include/freetype2

# GLEW
LIBS += $$OF/libs/glew/lib/vs/$$AR/glew32s.lib
INCLUDEPATH += $$OF/libs/glew/include

# GLFW
LIBS += $$OF/libs/glfw/lib/vs/$$AR/glfw3.lib
INCLUDEPATH += $$OF/libs/glfw/include
INCLUDEPATH += $$OF/libs/glfw/include/GLFW

# GLU
LIBS += $$OF/libs/glu/lib/vs/Win32/glu32.lib
INCLUDEPATH += $$OF/libs/glu/include

# GLUT
LIBS += $$OF/libs/glut/lib/vs/$$AR/glut32.lib
INCLUDEPATH += $$OF/libs/glut/include

# OPENSSL
LIBS += $$OF/libs/openssl/lib/vs/$$AR/libeay32md.lib
LIBS += $$OF/libs/openssl/lib/vs/$$AR/ssleay32md.lib
INCLUDEPATH += $$OF/libs/openssl/include
INCLUDEPATH += $$OF/libs/openssl/include/openssl

# POCO
win32:CONFIG(debug, debug|release): {
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoCryptomdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoUtilmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoXMLmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoNetmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoNetSSLmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoFoundationmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoJSONmdd.lib
}
else:win32:CONFIG(release, debug|release): {
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoCryptomd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoUtilmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoXMLmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoNetmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoNetSSLmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoFoundationmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoJSONmd.lib
}
INCLUDEPATH += $$OF/libs/poco/include

# QUICKTIME
LIBS += $$OF/libs/quicktime/lib/vs/Win32/qtmlClient.lib
LIBS += $$OF/libs/quicktime/lib/vs/Win32/QTSClient.lib
LIBS += $$OF/libs/quicktime/lib/vs/Win32/Rave.lib
INCLUDEPATH += $$OF/libs/quicktime/include

# RTAUDIO
win32:CONFIG(debug, debug|release): {
    LIBS += $$OF/libs/rtAudio/lib/vs/$$AR/rtAudioD.lib
}
else:win32:CONFIG(release, debug|release): {
    LIBS += $$OF/libs/rtAudio/lib/vs/$$AR/rtAudio.lib
}
INCLUDEPATH += $$OF/libs/rtAudio/include

# TESS2
LIBS += $$OF/libs/tess2/lib/vs/$$AR/tess2.lib
INCLUDEPATH += $$OF/libs/tess2/include

# UTF8CPP
INCLUDEPATH += $$OF/libs/utf8cpp/include
INCLUDEPATH += $$OF/libs/utf8cpp/include/utf8

# VIDEOINPUT
win32:CONFIG(debug, debug|release): {
    LIBS += $$OF/libs/videoInput/lib/vs/$$AR/videoInputD.lib
}
else:win32:CONFIG(release, debug|release): {
    LIBS += $$OF/libs/videoInput/lib/vs/$$AR/videoInput.lib
}
INCLUDEPATH += $$OF/libs/videoInput/include

# SYSTEM LIBS
win32 {
    LIBS += -lmsimg32
    LIBS += -lOpenGL32
    LIBS += -lkernel32
    LIBS += -lsetupapi
    LIBS += -lVfw32
    LIBS += -lcomctl32
    LIBS += -ldsound
    LIBS += -luser32
    LIBS += -lgdi32
    LIBS += -lwinspool
    LIBS += -lcomdlg32
    LIBS += -ladvapi32
    LIBS += -lshell32
    LIBS += -lole32
    LIBS += -luuid
    LIBS += -lcrypt32
    LIBS += -lWs2_32
    LIBS += -lodbc32
    LIBS += -lodbccp32
    LIBS += -lGLu32
    LIBS += -lwinmm
    LIBS += -lWinmm
    LIBS += -lOleAut32
}

# OPENFRAMEWORKS
INCLUDEPATH += $$OF/libs/openFrameworks
INCLUDEPATH += $$OF/libs/openFrameworks/3d
INCLUDEPATH += $$OF/libs/openFrameworks/app
INCLUDEPATH += $$OF/libs/openFrameworks/communication
INCLUDEPATH += $$OF/libs/openFrameworks/events
INCLUDEPATH += $$OF/libs/openFrameworks/gl
INCLUDEPATH += $$OF/libs/openFrameworks/graphics
INCLUDEPATH += $$OF/libs/openFrameworks/math
INCLUDEPATH += $$OF/libs/openFrameworks/sound
INCLUDEPATH += $$OF/libs/openFrameworks/types
INCLUDEPATH += $$OF/libs/openFrameworks/utils
INCLUDEPATH += $$OF/libs/openFrameworks/video

USE_PRECOMPILED_LIB {
    win32:CONFIG(debug, debug|release): {
        OF_LIB_PATH = $$OF/libs/openFrameworksCompiled/lib/vs/$$AR/openframeworksLib_debug.lib
    }
    else:win32:CONFIG(release, debug|release): {
        OF_LIB_PATH = $$OF/libs/openFrameworksCompiled/lib/vs/$$AR/openframeworksLib_release.lib
    }
}

if(exists($$OF_LIB_PATH)) {
    LIBS += $$OF_LIB_PATH
    message("NOTICE [openFrameworks]: Using precompiled library for OF")
}
else {
    message("NOTICE [openFrameworks]: Compiling OF")

    # 3d
    SOURCES += $$OF/libs/openFrameworks/3d/of3dPrimitives.cpp
    SOURCES += $$OF/libs/openFrameworks/3d/of3dUtils.cpp
    SOURCES += $$OF/libs/openFrameworks/3d/ofCamera.cpp
    SOURCES += $$OF/libs/openFrameworks/3d/ofEasyCam.cpp
    SOURCES += $$OF/libs/openFrameworks/3d/ofMesh.cpp
    SOURCES += $$OF/libs/openFrameworks/3d/ofNode.cpp

    HEADERS += $$OF/libs/openFrameworks/3d/of3dPrimitives.h
    HEADERS += $$OF/libs/openFrameworks/3d/of3dUtils.h
    HEADERS += $$OF/libs/openFrameworks/3d/ofCamera.h
    HEADERS += $$OF/libs/openFrameworks/3d/ofEasyCam.h
    HEADERS += $$OF/libs/openFrameworks/3d/ofMesh.h
    HEADERS += $$OF/libs/openFrameworks/3d/ofNode.h

    # app
    SOURCES += $$OF/libs/openFrameworks/app/ofAppGLFWWindow.cpp
    SOURCES += $$OF/libs/openFrameworks/app/ofAppGlutWindow.cpp
    SOURCES += $$OF/libs/openFrameworks/app/ofAppNoWindow.cpp
    SOURCES += $$OF/libs/openFrameworks/app/ofAppRunner.cpp
    SOURCES += $$OF/libs/openFrameworks/app/ofMainLoop.cpp

    HEADERS += $$OF/libs/openFrameworks/app/ofAppBaseWindow.h
    HEADERS += $$OF/libs/openFrameworks/app/ofAppGLFWWindow.h
    HEADERS += $$OF/libs/openFrameworks/app/ofAppGlutWindow.h
    HEADERS += $$OF/libs/openFrameworks/app/ofAppNoWindow.h
    HEADERS += $$OF/libs/openFrameworks/app/ofAppRunner.h
    HEADERS += $$OF/libs/openFrameworks/app/ofBaseApp.h
    HEADERS += $$OF/libs/openFrameworks/app/ofMainLoop.h
    HEADERS += $$OF/libs/openFrameworks/app/ofIcon.h
    HEADERS += $$OF/libs/openFrameworks/app/ofWindowSettings.h

    # communication
    SOURCES += $$OF/libs/openFrameworks/communication/ofSerial.cpp
    SOURCES += $$OF/libs/openFrameworks/communication/ofArduino.cpp

    HEADERS += $$OF/libs/openFrameworks/communication/ofSerial.h
    HEADERS += $$OF/libs/openFrameworks/communication/ofArduino.h

    # events
    SOURCES += $$OF/libs/openFrameworks/events/ofEvents.cpp

    HEADERS += $$OF/libs/openFrameworks/events/ofEvent.h
    HEADERS += $$OF/libs/openFrameworks/events/ofEvents.h
    HEADERS += $$OF/libs/openFrameworks/events/ofEventUtils.h

    # gl
    SOURCES += $$OF/libs/openFrameworks/gl/ofBufferObject.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofFbo.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofGLProgrammableRenderer.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofGLRenderer.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofGLUtils.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofLight.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofMaterial.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofShader.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofTexture.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofVbo.cpp
    SOURCES += $$OF/libs/openFrameworks/gl/ofVboMesh.cpp

    HEADERS += $$OF/libs/openFrameworks/gl/ofBufferObject.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofFbo.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofGLProgrammableRenderer.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofGLRenderer.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofGLUtils.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofLight.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofMaterial.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofShader.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofTexture.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofVbo.h
    HEADERS += $$OF/libs/openFrameworks/gl/ofVboMesh.h

    # graphics
    SOURCES += $$OF/libs/openFrameworks/graphics/of3dGraphics.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofBitmapFont.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofCairoRenderer.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofGraphics.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofImage.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofPath.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofPixels.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofPolyline.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofRendererCollection.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofTessellator.cpp
    SOURCES += $$OF/libs/openFrameworks/graphics/ofTrueTypeFont.cpp

    HEADERS += $$OF/libs/openFrameworks/graphics/of3dGraphics.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofBitmapFont.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofCairoRenderer.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofGraphics.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofImage.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofPath.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofPixels.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofPolyline.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofRendererCollection.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofTessellator.h
    HEADERS += $$OF/libs/openFrameworks/graphics/ofTrueTypeFont.h

    # math
    SOURCES += $$OF/libs/openFrameworks/math/ofMath.cpp
    SOURCES += $$OF/libs/openFrameworks/math/ofMatrix3x3.cpp
    SOURCES += $$OF/libs/openFrameworks/math/ofMatrix4x4.cpp
    SOURCES += $$OF/libs/openFrameworks/math/ofQuaternion.cpp
    SOURCES += $$OF/libs/openFrameworks/math/ofVec2f.cpp
    SOURCES += $$OF/libs/openFrameworks/math/ofVec4f.cpp

    HEADERS += $$OF/libs/openFrameworks/math/ofMath.h
    HEADERS += $$OF/libs/openFrameworks/math/ofMatrix3x3.h
    HEADERS += $$OF/libs/openFrameworks/math/ofMatrix4x4.h
    HEADERS += $$OF/libs/openFrameworks/math/ofQuaternion.h
    HEADERS += $$OF/libs/openFrameworks/math/ofVec2f.h
    HEADERS += $$OF/libs/openFrameworks/math/ofVec3f.h
    HEADERS += $$OF/libs/openFrameworks/math/ofVec4f.h
    HEADERS += $$OF/libs/openFrameworks/math/ofVectorMath.h

    # sound
    SOURCES += $$OF/libs/openFrameworks/sound/ofBaseSoundStream.cpp
    SOURCES += $$OF/libs/openFrameworks/sound/ofFmodSoundPlayer.cpp
    SOURCES += $$OF/libs/openFrameworks/sound/ofOpenALSoundPlayer.cpp
    SOURCES += $$OF/libs/openFrameworks/sound/ofRtAudioSoundStream.cpp
    SOURCES += $$OF/libs/openFrameworks/sound/ofSoundBuffer.cpp
    SOURCES += $$OF/libs/openFrameworks/sound/ofSoundPlayer.cpp
    SOURCES += $$OF/libs/openFrameworks/sound/ofSoundStream.cpp

    HEADERS += $$OF/libs/openFrameworks/sound/ofBaseSoundPlayer.h
    HEADERS += $$OF/libs/openFrameworks/sound/ofBaseSoundStream.h
    HEADERS += $$OF/libs/openFrameworks/sound/ofOpenALSoundPlayer.h
    HEADERS += $$OF/libs/openFrameworks/sound/ofFmodSoundPlayer.h
    HEADERS += $$OF/libs/openFrameworks/sound/ofRtAudioSoundStream.h
    HEADERS += $$OF/libs/openFrameworks/sound/ofSoundBuffer.h
    HEADERS += $$OF/libs/openFrameworks/sound/ofSoundPlayer.h
    HEADERS += $$OF/libs/openFrameworks/sound/ofSoundStream.h
    HEADERS += $$OF/libs/openFrameworks/sound/ofSoundUtils.h

    # types
    SOURCES += $$OF/libs/openFrameworks/types/ofBaseTypes.cpp
    SOURCES += $$OF/libs/openFrameworks/types/ofColor.cpp
    SOURCES += $$OF/libs/openFrameworks/types/ofParameter.cpp
    SOURCES += $$OF/libs/openFrameworks/types/ofParameterGroup.cpp
    SOURCES += $$OF/libs/openFrameworks/types/ofRectangle.cpp

    HEADERS += $$OF/libs/openFrameworks/types/ofBaseTypes.h
    HEADERS += $$OF/libs/openFrameworks/types/ofColor.h
    HEADERS += $$OF/libs/openFrameworks/types/ofParameter.h
    HEADERS += $$OF/libs/openFrameworks/types/ofParameterGroup.h
    HEADERS += $$OF/libs/openFrameworks/types/ofPoint.h
    HEADERS += $$OF/libs/openFrameworks/types/ofRectangle.h
    HEADERS += $$OF/libs/openFrameworks/types/ofTypes.h

    # utils
    SOURCES += $$OF/libs/openFrameworks/utils/ofFileUtils.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofFpsCounter.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofLog.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofMatrixStack.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofSystemUtils.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofThread.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofTimer.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofURLFileLoader.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofUtils.cpp
    SOURCES += $$OF/libs/openFrameworks/utils/ofXml.cpp

    HEADERS += $$OF/libs/openFrameworks/utils/ofFpsCounter.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofConstants.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofFileUtils.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofLog.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofMatrixStack.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofSystemUtils.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofThread.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofThreadChannel.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofTimer.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofURLFileLoader.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofUtils.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofXml.h
    HEADERS += $$OF/libs/openFrameworks/utils/ofNoise.h

    # video
    SOURCES += $$OF/libs/openFrameworks/video/ofDirectShowGrabber.cpp
    SOURCES += $$OF/libs/openFrameworks/video/ofDirectShowPlayer.cpp
    SOURCES += $$OF/libs/openFrameworks/video/ofVideoGrabber.cpp
    SOURCES += $$OF/libs/openFrameworks/video/ofVideoPlayer.cpp

    HEADERS += $$OF/libs/openFrameworks/video/ofDirectShowGrabber.h
    HEADERS += $$OF/libs/openFrameworks/video/ofDirectShowPlayer.h
    HEADERS += $$OF/libs/openFrameworks/video/ofVideoGrabber.h
    HEADERS += $$OF/libs/openFrameworks/video/ofVideoPlayer.h

    HEADERS += $$OF/libs/openFrameworks/ofMain.h
}

#openFrameworks path.
CONFIG += USE_PRECOMPILED_LIB
OF = #OF_PATH#
AR = #AR#
OF_VERSION = 0.9

equals(AR, "x64") {
    message("NOTICE [openFrameworks]: Using libraries for x64")
}
else:equals(AR, "Win32") {
    message("NOTICE [openFrameworks]: Using libraries for Win32")
}
else {
    message("NOTICE [openFrameworks]: Architecture is not set. Defaulting to x64")
    AR = x64
}

win32:CONFIG(release, debug|release): {
    QMAKE_LFLAGS += /NODEFAULTLIB:PocoFoundationmd.lib
    QMAKE_LFLAGS += /NODEFAULTLIB:LIBCMT
    QMAKE_LFLAGS += /NODEFAULTLIB:LIBC.LIBS
    QMAKE_LFLAGS += /NODEFAULTLIB:atlthunk.lib

    DEFINES += "WIN32"
    DEFINES += "NDEBUG"
    DEFINES += "_CONSOLE"
    DEFINES += "POCO_STATIC"
    DEFINES += "CAIRO_WIN32_STATIC_BUILD"
    DEFINES += "DISABLE_SOME_FLOATING_POINT"
    DEFINES += "_UNICODE"
    DEFINES += "UNICODE"
}
else:win32:CONFIG(debug, debug|release): {
    QMAKE_LFLAGS += /NODEFAULTLIB:PocoFoundationmdd.lib
    QMAKE_LFLAGS += /NODEFAULTLIB:atlthunk.lib
    QMAKE_LFLAGS += /NODEFAULTLIB:msvcrt
    QMAKE_LFLAGS += /NODEFAULTLIB:libcmt
    QMAKE_LFLAGS += /NODEFAULTLIB:LIBC
    QMAKE_LFLAGS += /NODEFAULTLIB:LIBCMTD

    DEFINES += "WIN32"
    DEFINES += "_DEBUG"
    DEFINES += "_CONSOLE"
    DEFINES += "POCO_STATIC"
    DEFINES += "CAIRO_WIN32_STATIC_BUILD"
    DEFINES += "DISABLE_SOME_FLOATING_POINT"
    DEFINES += "_UNICODE"
    DEFINES += "UNICODE"
}

#BOOST
win32:CONFIG(debug, debug|release): {
    LIBS += $$OF/libs/boost/lib/vs/$$AR/libboost_filesystem-vc140-mt-gd-1_58.lib
    LIBS += $$OF/libs/boost/lib/vs/$$AR/libboost_system-vc140-mt-gd-1_58.lib
}
else:win32:CONFIG(release, debug|release): {
    LIBS += $$OF/libs/boost/lib/vs/$$AR/libboost_filesystem-vc140-mt-1_58.lib
    LIBS += $$OF/libs/boost/lib/vs/$$AR/libboost_system-vc140-mt-1_58.lib
}
INCLUDEPATH += $$OF/libs/boost/include
INCLUDEPATH += $$OF/libs/boost/include/boost

#CAIRO
LIBS += $$OF/libs/cairo/lib/vs/$$AR/cairo-static.lib
LIBS += $$OF/libs/cairo/lib/vs/$$AR/pixman-1.lib
LIBS += $$OF/libs/cairo/lib/vs/$$AR/libpng.lib

INCLUDEPATH += $$OF/libs/cairo/include
INCLUDEPATH += $$OF/libs/cairo/include/libpng15
INCLUDEPATH += $$OF/libs/cairo/include/pixman-1
INCLUDEPATH += $$OF/libs/cairo/include/cairo

#FMODEX
equals(AR, "x64") {
    LIBS += $$OF/libs/fmodex/lib/vs/$$AR/fmodex64_vc.lib
}
else {
    LIBS += $$OF/libs/fmodex/lib/vs/$$AR/fmodex_vc.lib
}

INCLUDEPATH += $$OF/libs/fmodex/include

#FREEIMAGE
LIBS += $$OF/libs/FreeImage/lib/vs/$$AR/FreeImage.lib
INCLUDEPATH += $$OF/libs/FreeImage/include

#FREETYPE
LIBS += $$OF/libs/freetype/lib/vs/$$AR/libfreetype.lib
INCLUDEPATH += $$OF/libs/freetype/include
INCLUDEPATH += $$OF/libs/freetype/include/freetype2

#GLEW
LIBS += $$OF/libs/glew/lib/vs/$$AR/glew32s.lib
INCLUDEPATH += $$OF/libs/glew/include

#GLFW
LIBS += $$OF/libs/glfw/lib/vs/$$AR/glfw3.lib
INCLUDEPATH += $$OF/libs/glfw/include
INCLUDEPATH += $$OF/libs/glfw/include/GLFW

#GLU
LIBS += $$OF/libs/glu/lib/vs/Win32/glu32.lib
INCLUDEPATH += $$OF/libs/glu/include

#GLUT
LIBS += $$OF/libs/glut/lib/vs/$$AR/glut32.lib
INCLUDEPATH += $$OF/libs/glut/include

#OPENSSL
LIBS += $$OF/libs/openssl/lib/vs/$$AR/libeay32md.lib
LIBS += $$OF/libs/openssl/lib/vs/$$AR/ssleay32md.lib
INCLUDEPATH += $$OF/libs/openssl/include
INCLUDEPATH += $$OF/libs/openssl/include/openssl

#POCO
win32:CONFIG(debug, debug|release): {
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoCryptomdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoUtilmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoXMLmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoNetmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoNetSSLmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoFoundationmdd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoJSONmdd.lib
}
else:win32:CONFIG(release, debug|release): {
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoCryptomd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoUtilmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoXMLmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoNetmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoNetSSLmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoFoundationmd.lib
    LIBS += $$OF/libs/poco/lib/vs/$$AR/PocoJSONmd.lib
}
INCLUDEPATH += $$OF/libs/poco/include

#QUICKTIME
LIBS += $$OF/libs/quicktime/lib/vs/Win32/qtmlClient.lib
LIBS += $$OF/libs/quicktime/lib/vs/Win32/QTSClient.lib
LIBS += $$OF/libs/quicktime/lib/vs/Win32/Rave.lib
INCLUDEPATH += $$OF/libs/quicktime/include

#RTAUDIO
win32:CONFIG(debug, debug|release):LIBS += $$OF/libs/rtAudio/lib/vs/$$AR/rtAudioD.lib
else:win32:CONFIG(release, debug|release):LIBS += $$OF/libs/rtAudio/lib/vs/$$AR/rtAudio.lib
INCLUDEPATH += $$OF/libs/rtAudio/include

#TESS2
LIBS += $$OF/libs/tess2/lib/vs/$$AR/tess2.lib
INCLUDEPATH += $$OF/libs/tess2/include

#UTF8CPP
INCLUDEPATH += $$OF/libs/utf8cpp/include
INCLUDEPATH += $$OF/libs/utf8cpp/include/utf8

#VIDEOINPUT
win32:CONFIG(debug, debug|release):LIBS += $$OF/libs/videoInput/lib/vs/$$AR/videoInputD.lib
else:win32:CONFIG(release, debug|release):LIBS += $$OF/libs/videoInput/lib/vs/$$AR/videoInput.lib
INCLUDEPATH += $$OF/libs/videoInput/include

#SYSTEM LIBS
LIBS += -lmsimg32
LIBS += -lOpenGL32
LIBS += -lkernel32
LIBS += -lsetupapi
LIBS += -lVfw32
LIBS += -lcomctl32
LIBS += -ldsound
LIBS += -luser32
LIBS += -lgdi32
LIBS += -lwinspool
LIBS += -lcomdlg32
LIBS += -ladvapi32
LIBS += -lshell32
LIBS += -lole32
LIBS += -loleaut32
LIBS += -luuid
LIBS += -lcrypt32
LIBS += -lWs2_32
LIBS += -lodbc32
LIBS += -lodbccp32
LIBS += -lGLu32

#OPENFRAMEWORKS
INCLUDEPATH += $$OF/libs/openFrameworks
INCLUDEPATH += $$OF/libs/openFrameworks/3d
INCLUDEPATH += $$OF/libs/openFrameworks/app
INCLUDEPATH += $$OF/libs/openFrameworks/communication
INCLUDEPATH += $$OF/libs/openFrameworks/events
INCLUDEPATH += $$OF/libs/openFrameworks/gl
INCLUDEPATH += $$OF/libs/openFrameworks/graphics
INCLUDEPATH += $$OF/libs/openFrameworks/math
INCLUDEPATH += $$OF/libs/openFrameworks/sound
INCLUDEPATH += $$OF/libs/openFrameworks/types
INCLUDEPATH += $$OF/libs/openFrameworks/utils
INCLUDEPATH += $$OF/libs/openFrameworks/video

USE_PRECOMPILED_LIB {
    win32:CONFIG(debug, debug|release): {
        OF_LIB_PATH = $$OF/libs/openFrameworksCompiled/lib/vs/$$AR/openframeworksLib_debug.lib
    }
    else:win32:CONFIG(release, debug|release): {
        OF_LIB_PATH = $$OF/libs/openFrameworksCompiled/lib/vs/$$AR/openframeworksLib_release.lib
    }
}

if(exists($$OF_LIB_PATH)) {
    LIBS += $$OF_LIB_PATH
    message("NOTICE [openFrameworks]: Using precompiled library for OF")
}
else {
    message("NOTICE [openFrameworks]: Compiling OF")

#3d
SOURCES += $$OF/libs/openFrameworks/3d/of3dPrimitives.cpp
SOURCES += $$OF/libs/openFrameworks/3d/of3dUtils.cpp
SOURCES += $$OF/libs/openFrameworks/3d/ofCamera.cpp
SOURCES += $$OF/libs/openFrameworks/3d/ofEasyCam.cpp
SOURCES += $$OF/libs/openFrameworks/3d/ofMesh.cpp
SOURCES += $$OF/libs/openFrameworks/3d/ofNode.cpp

HEADERS += $$OF/libs/openFrameworks/3d/of3dPrimitives.h
HEADERS += $$OF/libs/openFrameworks/3d/of3dUtils.h
HEADERS += $$OF/libs/openFrameworks/3d/ofCamera.h
HEADERS += $$OF/libs/openFrameworks/3d/ofEasyCam.h
HEADERS += $$OF/libs/openFrameworks/3d/ofMesh.h
HEADERS += $$OF/libs/openFrameworks/3d/ofNode.h

#app
SOURCES += $$OF/libs/openFrameworks/app/ofAppGLFWWindow.cpp
SOURCES += $$OF/libs/openFrameworks/app/ofAppGlutWindow.cpp
SOURCES += $$OF/libs/openFrameworks/app/ofAppNoWindow.cpp
SOURCES += $$OF/libs/openFrameworks/app/ofAppRunner.cpp
HEADERS += $$OF/libs/openFrameworks/app/ofMainLoop.cpp

HEADERS += $$OF/libs/openFrameworks/app/ofAppBaseWindow.h
HEADERS += $$OF/libs/openFrameworks/app/ofAppGLFWWindow.h
HEADERS += $$OF/libs/openFrameworks/app/ofAppGlutWindow.h
HEADERS += $$OF/libs/openFrameworks/app/ofAppNoWindow.h
HEADERS += $$OF/libs/openFrameworks/app/ofAppRunner.h
HEADERS += $$OF/libs/openFrameworks/app/ofBaseApp.h
HEADERS += $$OF/libs/openFrameworks/app/ofMainLoop.h
HEADERS += $$OF/libs/openFrameworks/app/ofIcon.h
HEADERS += $$OF/libs/openFrameworks/app/ofWindowSettings.h

#communication
SOURCES += $$OF/libs/openFrameworks/communication/ofSerial.cpp
SOURCES += $$OF/libs/openFrameworks/communication/ofArduino.cpp

HEADERS += $$OF/libs/openFrameworks/communication/ofSerial.h
HEADERS += $$OF/libs/openFrameworks/communication/ofArduino.h

#events
SOURCES += $$OF/libs/openFrameworks/events/ofEvents.cpp

HEADERS += $$OF/libs/openFrameworks/events/ofEvent.h
HEADERS += $$OF/libs/openFrameworks/events/ofEvents.h
HEADERS += $$OF/libs/openFrameworks/events/ofEventUtils.h

#gl
SOURCES += $$OF/libs/openFrameworks/gl/ofBufferObject.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofFbo.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofGLProgrammableRenderer.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofGLRenderer.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofGLUtils.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofLight.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofMaterial.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofShader.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofTexture.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofVbo.cpp
SOURCES += $$OF/libs/openFrameworks/gl/ofVboMesh.cpp

HEADERS += $$OF/libs/openFrameworks/gl/ofBufferObject.h
HEADERS += $$OF/libs/openFrameworks/gl/ofFbo.h
HEADERS += $$OF/libs/openFrameworks/gl/ofGLProgrammableRenderer.h
HEADERS += $$OF/libs/openFrameworks/gl/ofGLRenderer.h
HEADERS += $$OF/libs/openFrameworks/gl/ofGLUtils.h
HEADERS += $$OF/libs/openFrameworks/gl/ofLight.h
HEADERS += $$OF/libs/openFrameworks/gl/ofMaterial.h
HEADERS += $$OF/libs/openFrameworks/gl/ofShader.h
HEADERS += $$OF/libs/openFrameworks/gl/ofTexture.h
HEADERS += $$OF/libs/openFrameworks/gl/ofVbo.h
HEADERS += $$OF/libs/openFrameworks/gl/ofVboMesh.h

#graphics
SOURCES += $$OF/libs/openFrameworks/graphics/of3dGraphics.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofBitmapFont.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofCairoRenderer.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofGraphics.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofImage.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofPath.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofPixels.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofPolyline.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofRendererCollection.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofTessellator.cpp
SOURCES += $$OF/libs/openFrameworks/graphics/ofTrueTypeFont.cpp

HEADERS += $$OF/libs/openFrameworks/graphics/of3dGraphics.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofBitmapFont.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofCairoRenderer.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofGraphics.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofImage.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofPath.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofPixels.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofPolyline.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofRendererCollection.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofTessellator.h
HEADERS += $$OF/libs/openFrameworks/graphics/ofTrueTypeFont.h

#math
SOURCES += $$OF/libs/openFrameworks/math/ofMath.cpp
SOURCES += $$OF/libs/openFrameworks/math/ofMatrix3x3.cpp
SOURCES += $$OF/libs/openFrameworks/math/ofMatrix4x4.cpp
SOURCES += $$OF/libs/openFrameworks/math/ofQuaternion.cpp
SOURCES += $$OF/libs/openFrameworks/math/ofVec2f.cpp
SOURCES += $$OF/libs/openFrameworks/math/ofVec4f.cpp

HEADERS += $$OF/libs/openFrameworks/math/ofMath.h
HEADERS += $$OF/libs/openFrameworks/math/ofMatrix3x3.h
HEADERS += $$OF/libs/openFrameworks/math/ofMatrix4x4.h
HEADERS += $$OF/libs/openFrameworks/math/ofQuaternion.h
HEADERS += $$OF/libs/openFrameworks/math/ofVec2f.h
HEADERS += $$OF/libs/openFrameworks/math/ofVec3f.h
HEADERS += $$OF/libs/openFrameworks/math/ofVec4f.h
HEADERS += $$OF/libs/openFrameworks/math/ofVectorMath.h

#sound
SOURCES += $$OF/libs/openFrameworks/sound/ofBaseSoundStream.cpp
SOURCES += $$OF/libs/openFrameworks/sound/ofFmodSoundPlayer.cpp
SOURCES += $$OF/libs/openFrameworks/sound/ofOpenALSoundPlayer.cpp
SOURCES += $$OF/libs/openFrameworks/sound/ofRtAudioSoundStream.cpp
SOURCES += $$OF/libs/openFrameworks/sound/ofSoundBuffer.cpp
SOURCES += $$OF/libs/openFrameworks/sound/ofSoundPlayer.cpp
SOURCES += $$OF/libs/openFrameworks/sound/ofSoundStream.cpp

HEADERS += $$OF/libs/openFrameworks/sound/ofBaseSoundPlayer.h
HEADERS += $$OF/libs/openFrameworks/sound/ofBaseSoundStream.h
HEADERS += $$OF/libs/openFrameworks/sound/ofFmodSoundPlayer.h
HEADERS += $$OF/libs/openFrameworks/sound/ofOpenALSoundPlayer.h
HEADERS += $$OF/libs/openFrameworks/sound/ofRtAudioSoundStream.h
HEADERS += $$OF/libs/openFrameworks/sound/ofSoundBuffer.h
HEADERS += $$OF/libs/openFrameworks/sound/ofSoundPlayer.h
HEADERS += $$OF/libs/openFrameworks/sound/ofSoundStream.h
HEADERS += $$OF/libs/openFrameworks/sound/ofSoundUtils.h

#types
SOURCES += $$OF/libs/openFrameworks/types/ofBaseTypes.cpp
SOURCES += $$OF/libs/openFrameworks/types/ofColor.cpp
SOURCES += $$OF/libs/openFrameworks/types/ofParameter.cpp
SOURCES += $$OF/libs/openFrameworks/types/ofParameterGroup.cpp
SOURCES += $$OF/libs/openFrameworks/types/ofRectangle.cpp

HEADERS += $$OF/libs/openFrameworks/types/ofBaseTypes.h
HEADERS += $$OF/libs/openFrameworks/types/ofColor.h
HEADERS += $$OF/libs/openFrameworks/types/ofParameter.h
HEADERS += $$OF/libs/openFrameworks/types/ofParameterGroup.h
HEADERS += $$OF/libs/openFrameworks/types/ofPoint.h
HEADERS += $$OF/libs/openFrameworks/types/ofRectangle.h
HEADERS += $$OF/libs/openFrameworks/types/ofTypes.h

#utils
SOURCES += $$OF/libs/openFrameworks/utils/ofFileUtils.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofFpsCounter.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofLog.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofMatrixStack.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofSystemUtils.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofThread.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofTimer.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofURLFileLoader.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofUtils.cpp
SOURCES += $$OF/libs/openFrameworks/utils/ofXml.cpp

HEADERS += $$OF/libs/openFrameworks/utils/ofConstants.h
HEADERS += $$OF/libs/openFrameworks/utils/ofFileUtils.h
HEADERS += $$OF/libs/openFrameworks/utils/ofFpsCounter.h
HEADERS += $$OF/libs/openFrameworks/utils/ofLog.h
HEADERS += $$OF/libs/openFrameworks/utils/ofMatrixStack.h
HEADERS += $$OF/libs/openFrameworks/utils/ofNoise.h
HEADERS += $$OF/libs/openFrameworks/utils/ofSystemUtils.h
HEADERS += $$OF/libs/openFrameworks/utils/ofThread.h
HEADERS += $$OF/libs/openFrameworks/utils/ofThreadChannel.h
HEADERS += $$OF/libs/openFrameworks/utils/ofTimer.h
HEADERS += $$OF/libs/openFrameworks/utils/ofURLFileLoader.h
HEADERS += $$OF/libs/openFrameworks/utils/ofUtils.h
HEADERS += $$OF/libs/openFrameworks/utils/ofXml.h

#video
SOURCES += $$OF/libs/openFrameworks/video/ofAVFoundationPlayer.mm
SOURCES += $$OF/libs/openFrameworks/video/ofAVFoundationVideoPlayer.mm
SOURCES += $$OF/libs/openFrameworks/video/ofDirectShowGrabber.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofDirectShowPlayer.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofGstUtils.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofGstVideoGrabber.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofGstVideoPlayer.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofQTKitGrabber.mm
SOURCES += $$OF/libs/openFrameworks/video/ofQTKitMovieRenderer.mm
SOURCES += $$OF/libs/openFrameworks/video/ofQTKitPlayer.mm
SOURCES += $$OF/libs/openFrameworks/video/ofQtUtils.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofQuickTimeGrabber.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofQuickTimePlayer.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofVideoGrabber.cpp
SOURCES += $$OF/libs/openFrameworks/video/ofVideoPlayer.cpp

HEADERS += $$OF/libs/openFrameworks/video/ofAVFoundationPlayer.h
HEADERS += $$OF/libs/openFrameworks/video/ofAVFoundationVideoPlayer.h
HEADERS += $$OF/libs/openFrameworks/video/ofDirectShowGrabber.h
HEADERS += $$OF/libs/openFrameworks/video/ofDirectShowPlayer.h
HEADERS += $$OF/libs/openFrameworks/video/ofGstUtils.h
HEADERS += $$OF/libs/openFrameworks/video/ofGstVideoGrabber.h
HEADERS += $$OF/libs/openFrameworks/video/ofGstVideoPlayer.h
HEADERS += $$OF/libs/openFrameworks/video/ofQTKitGrabber.h
HEADERS += $$OF/libs/openFrameworks/video/ofQTKitMovieRenderer.h
HEADERS += $$OF/libs/openFrameworks/video/ofQTKitPlayer.h
HEADERS += $$OF/libs/openFrameworks/video/ofQtUtils.h
HEADERS += $$OF/libs/openFrameworks/video/ofQuickTimeGrabber.h
HEADERS += $$OF/libs/openFrameworks/video/ofQuickTimePlayer.h
HEADERS += $$OF/libs/openFrameworks/video/ofVideoGrabber.h
HEADERS += $$OF/libs/openFrameworks/video/ofVideoPlayer.h

HEADERS += $$OF/libs/openFrameworks/ofMain.h
}
#addons


Fixed libgpsbip.pri to also set target dependency on the generated library

INCLUDEPATH *= $$absolute_path(.)
LIBS *= -L$${DESTDIR}

CONFIG(debug, debug|release) {
    LIBS *= -llibgpsbipd
     PRE_TARGETDEPS *= $${DESTDIR}/libgpsbipd.lib
}
CONFIG(release, release|debug) {
    LIBS *= -llibgpsbip
     PRE_TARGETDEPS *= $${DESTDIR}/libgpsbip.lib
}

INCLUDEPATH += $$absolute_path(./libgpsbip)
LIBS += -L$${DESTDIR}

CONFIG(debug, debug|release) {
    LIBS += -llibgpsbipd
}
CONFIG(release, release|debug) {
    LIBS += -llibgpsbip
}


fix symbian build

fix symbian build

# Common definitions

QT += network xml
QXMPP_VERSION = 0.4.0
QXMPP_INCLUDEPATH = $$PWD/src/base $$PWD/src/client $$PWD/src/server

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

# Libraries used internally by QXmpp
android {

} else:contains(MEEGO_EDITION,harmattan) {
    # meego/harmattan has speex for sure
    QXMPP_INTERNAL_DEFINES += QXMPP_USE_SPEEX
    QXMPP_INTERNAL_LIBS += -lspeex
} else:symbian {
    QXMPP_INTERNAL_INCLUDES = $$APP_LAYER_SYSTEMINCLUDE
    QXMPP_INTERNAL_LIBS = -lesock
} else:win32 {
    QXMPP_INTERNAL_LIBS = -ldnsapi -lws2_32
}

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

# Determine library type (lib or staticlib)
isEmpty(QXMPP_LIBRARY_TYPE) {
    QXMPP_LIBRARY_TYPE = staticlib
}
contains(QXMPP_LIBRARY_TYPE,staticlib) {
    # FIXME: we should be able to use the link_prl option to automatically pull
    # in the extra libraries which the qxmpp library needs, but this does not
    # seem to work on win32, so we specify the dependencies here:
    QXMPP_LIBS += $$QXMPP_INTERNAL_LIBS
    DEFINES += QXMPP_STATIC
} else {
    DEFINES += QXMPP_SHARED
}

# Installation prefix and library directory
isEmpty(PREFIX) {
    unix:PREFIX=/usr/local
}
isEmpty(LIBDIR) {
    LIBDIR=lib
}

# Common definitions

QT += network xml
QXMPP_VERSION = 0.4.0
QXMPP_INCLUDEPATH = $$PWD/src/base $$PWD/src/client $$PWD/src/server

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

# Libraries used internally by QXmpp
android|symbian {

} else:contains(MEEGO_EDITION,harmattan) {
    # meego/harmattan has speex for sure
    QXMPP_INTERNAL_DEFINES += QXMPP_USE_SPEEX
    QXMPP_INTERNAL_LIBS += -lspeex
} else:symbian {
    QXMPP_INTERNAL_INCLUDES = $$APP_LAYER_SYSTEMINCLUDE
    QXMPP_INTERNAL_LIBS = -lesock
} else:win32 {
    QXMPP_INTERNAL_LIBS = -ldnsapi -lws2_32
}

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

# Determine library type (lib or staticlib)
isEmpty(QXMPP_LIBRARY_TYPE) {
    QXMPP_LIBRARY_TYPE = staticlib
}
contains(QXMPP_LIBRARY_TYPE,staticlib) {
    # FIXME: we should be able to use the link_prl option to automatically pull
    # in the extra libraries which the qxmpp library needs, but this does not
    # seem to work on win32, so we specify the dependencies here:
    QXMPP_LIBS += $$QXMPP_INTERNAL_LIBS
    DEFINES += QXMPP_STATIC
} else {
    DEFINES += QXMPP_SHARED
}

# Installation prefix and library directory
isEmpty(PREFIX) {
    unix:PREFIX=/usr/local
}
isEmpty(LIBDIR) {
    LIBDIR=lib
}


Compilando no Windows

Compilando no Windows

# exportacao e configuracoes de build

INCLUDEPATH += $$PWD/src

win32 {
	win32-g++ {
		EXCEPTION_LIBS += -lexception -limagehlp
		bfd {
			EXCEPTION_LIBS += -lbfd -liberty
		}
		POST_TARGETDEPS += $$BUILD_DIR/libexception.a
	} else {
		EXCEPTION_LIBS += exception.lib imagehlp.lib
		POST_TARGETDEPS += $$BUILD_DIR/libexception.lib
	}
}

unix {
	EXCEPTION_LIBS += -lexception
	bfd {
		EXCEPTION_LIBS += -lbfd -ldl -lz -liberty
	}

	POST_TARGETDEPS += $$BUILD_DIR/libexception.a
}

# exportacao e configuracoes de build

INCLUDEPATH += $$PWD/src

win32 {
    win32-g++ {
        EXCEPTION_LIBS += -lexception -limagehlp
	bfd {
            EXCEPTION_LIBS += -lbfd -liberty
        }
    } else {
        EXCEPTION_LIBS += exception.lib imagehlp.lib
    }
}

unix {
    EXCEPTION_LIBS += -lexception
    bfd {
        EXCEPTION_LIBS += -lbfd -ldl -lz -liberty
    }
}