Fixed problem linking with the developer expat package under WIN32.

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

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

######################################################################
# $Revision: 1.69 $ $Author: shoops $ $Date: 2007/12/13 18:22: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(DEFINES, COPASI_MIRIAM) {
    LIBS += -lraptor
  }

  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_CXXFLAGS   += -I"$${EXPAT_PATH}\include"
    QMAKE_LFLAGS += /LIBPATH:"$${EXPAT_PATH}\StaticLibs"
    QMAKE_LFLAGS += /LIBPATH:"$${EXPAT_PATH}\bin"
    QMAKE_LFLAGS += /LIBPATH:"$${EXPAT_PATH}\lib"
    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"
    QMAKE_LFLAGS += /LIBPATH:"$${SBML_PATH}\bin"
    LIBS += libsbml.lib
  } else {
    error( "SBML_PATH must be specified" )
  }

  contains(DEFINES, COPASI_MIRIAM) {
    LIBS += raptor.lib
  }

  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(DEFINES, COPASI_MIRIAM) {
    LIBS += -lraptor
  }

  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

  contains(DEFINES, COPASI_MIRIAM) {
    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
      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.68 $
#   $Name:  $
#   $Author: shoops $
#   $Date: 2007/12/10 02:13:24 $
# End CVS Header

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

######################################################################
# $Revision: 1.68 $ $Author: shoops $ $Date: 2007/12/10 02:13:24 $
######################################################################

# 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(DEFINES, COPASI_MIRIAM) {
    LIBS += -lraptor
  }

  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"
    QMAKE_LFLAGS += /LIBPATH:"$${SBML_PATH}\bin"
    LIBS += libsbml.lib
  } else {
    error( "SBML_PATH must be specified" )
  }

  contains(DEFINES, COPASI_MIRIAM) {
    LIBS += raptor.lib
  }

  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(DEFINES, COPASI_MIRIAM) {
    LIBS += -lraptor
  }

  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

  contains(DEFINES, COPASI_MIRIAM) {
    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
      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
}


Jolla: Fix compilation

Jolla: Fix compilation

include(yaml_dependencies.pri)

INCLUDEPATH *= $$IDE_SOURCE_TREE/src/libs/mer/yaml
LIBS *= -l$$qtLibraryName(YAML)

include(yaml_dependencies.pri)
LIBS *= -l$$qtLibraryName(YAML)


Changes: removed unused stuff from mconfig.pri

RevBy: TrustMe

Full, original commit at 8c4d498430bf09518e5d88b73ac1e7dc98c70279 in maliit-framework

unix {
     M_PREFIX = /usr
     M_INSTALL_BIN = $$M_PREFIX/bin
     M_INSTALL_LIBS = $$M_PREFIX/lib
     M_INSTALL_HEADERS = $$M_PREFIX/include/meegotouch
}
mac {
     # Do mac stuff here
    M_BUILD_FEATURES = debug
    M_PROFILE_PARTS =
    INCLUDEPATH += include/
    M_INSTALL_BIN = $$M_PREFIX/bin/
    M_INSTALL_LIBS = $$M_PREFIX/lib/
    M_INSTALL_HEADERS = $$M_PREFIX/include/meegotouch/
}
win32 {
     # Do win32 stuff here
     M_PREFIX = /usr
     M_INSTALL_BIN = $$M_PREFIX/bin/
     M_INSTALL_LIBS = $$M_PREFIX/lib/
     M_INSTALL_HEADERS = $$M_PREFIX/include/meegotouch/
}

# Directories (taken from libmeegotouch)
unix {
     M_PREFIX = /usr
     M_INSTALL_BIN = $$M_PREFIX/bin
     M_INSTALL_LIBS = $$M_PREFIX/lib
     M_INSTALL_HEADERS = $$M_PREFIX/include/meegotouch
     M_THEME_DIR = $$M_PREFIX/share/themes
     M_TRANSLATION_DIR = $$M_PREFIX/share/l10n/meegotouch
     M_APPLET_DIR = $$M_PREFIX/lib/meegotouch/applets/
     M_APPLET_DATA_DIR = $$M_PREFIX/share/meegotouch/applets
     M_THEME_PRELOAD_DIR = /var/lib/meegotouch/theme/preload.d
     M_THEME_POST_PRELOAD_DIR = /var/lib/meegotouch/theme/preload.post
     M_APPLET_SETTINGS_DIR= $$M_PREFIX/share/meegotouch/applets/settings
}
mac {
     # Do mac stuff here
    M_BUILD_FEATURES = debug
    M_PROFILE_PARTS =
    INCLUDEPATH += include/
    M_INSTALL_BIN = $$M_PREFIX/bin/
    M_INSTALL_LIBS = $$M_PREFIX/lib/
    M_INSTALL_HEADERS = $$M_PREFIX/include/meegotouch/
    M_THEME_DIR = $$M_PREFIX/share/themes
    M_TRANSLATION_DIR = $$M_PREFIX/share/l10n/meegotouch/
    M_APPLET_DIR = $$M_PREFIX/lib/meegotouch/applets/
    M_APPLET_DATA_DIR = $$M_PREFIX/share/meegotouch/applets/
    M_APPLET_SETTINGS_DIR= $$M_PREFIX/share/meegotouch/applets/settings/
}
win32 {
     # Do win32 stuff here
     M_PREFIX = /usr
     M_INSTALL_BIN = $$M_PREFIX/bin/
     M_INSTALL_LIBS = $$M_PREFIX/lib/
     M_INSTALL_HEADERS = $$M_PREFIX/include/meegotouch/
     M_THEME_DIR = $$M_PREFIX/share/themes
     M_TRANSLATION_DIR = $$M_PREFIX/share/l10n/meegotouch/
     M_APPLET_DIR = $$M_PREFIX/lib/meegotouch/applets/
     M_APPLET_DATA_DIR = $$M_PREFIX/share/meegotouch/applets/
}


Add QtNetwork to the project.

Add QtNetwork to the project.

# Common configuration for all .pro files.

ROOT_DIRECTORY = $$PWD
BUILD_DIRECTORY = $$shadowed($$PWD)

QT += core gui widgets network

# Activate C++11 support.

QMAKE_CXXFLAGS += -std=c++11

# Add code coverage support.

CONFIG(debug)
{
	LIBS += -lgcov
	QMAKE_CXXFLAGS += -g -fprofile-arcs -ftest-coverage -O0
	QMAKE_LFLAGS += -g -fprofile-arcs -ftest-coverage -O0
}

# Common configuration for all .pro files.

ROOT_DIRECTORY = $$PWD
BUILD_DIRECTORY = $$shadowed($$PWD)

QT += core gui widgets

# Activate C++11 support.

QMAKE_CXXFLAGS += -std=c++11

# Add code coverage support.

CONFIG(debug)
{
	LIBS += -lgcov
	QMAKE_CXXFLAGS += -g -fprofile-arcs -ftest-coverage -O0
	QMAKE_LFLAGS += -g -fprofile-arcs -ftest-coverage -O0
}


Fix merge failure

Fix merge failure

greaterThan(QT_MAJOR_VERSION, 4) {
    QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
}

# for boost 1.37, add -mt to the boost libraries
# use: qmake BOOST_LIB_SUFFIX=-mt
# for boost thread win32 with _win32 sufix
# use: BOOST_THREAD_LIB_SUFFIX=_win32-...
# or when linking against a specific BerkelyDB version: BDB_LIB_SUFFIX=-4.8

BOOST_LIB_SUFFIX=
windows:BOOST_INCLUDE_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/include/boost
windows:BOOST_LIB_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/lib
macx:BOOST_LIB_PATH=/usr/local/opt/boost@1.60/lib
macx:BOOST_INCLUDE_PATH=/usr/local/opt/boost@1.60/include
windows:BDB_INCLUDE_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/include
windows:BDB_LIB_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/lib
macx:BDB_LIB_PATH=/usr/local/opt/berkeley-db\@4/lib/
MINIUPNPC_LIB_SUFFIX=-miniupnpc
windows:MINIUPNPC_INCLUDE_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/include
windows:MINIUPNPC_LIB_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/libc
macx:OPENSSL_LIB_PATH=/usr/local/opt/openssl/lib
macx:MINIUPNPC_INCLUDE_PATH=/usr/local/opt/miniupnpc/include
macx:MINIUPNPC_LIB_PATH=/usr/local/opt/miniupnpc/lib
macx:QRENCODE_INCLUDE_PATH=/usr/local/opt/qrencode/include
macx:QRENCODE_LIB_PATH=/usr/local/opt/qrencode/lib
macx:CURL_LIB_PATH=/usr/local/opt/curl/lib
windows:QRENCODE_INCLUDE_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/include
windows:QRENCODE_LIB_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/libc

# Dependency library locations can be customized with:
#    BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH,
#    BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively

OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build

# fixes an issue with boost 1.66 and the number of template parameters of basic_socket_acceptor
#DEFINES += BOOST_ASIO_ENABLE_OLD_SERVICES
# TODO: Move to the new standard of boost as current code is deprecated

# use: qmake "RELEASE=1"
contains(RELEASE, 1) {
    # Mac: compile for maximum compatibility (10.12, 32-bit)
    macx:QMAKE_CXXFLAGS += -mmacosx-version-min=10.12 -arch x86_64 -Wno-nullability-completeness -Wno-unused-command-line-argument

    !windows:!macx {
        # Linux: static link
        LIBS += -Wl,-Bstatic
    }
}

!win32 {
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
QMAKE_CXXFLAGS *= -fstack-protector-all
QMAKE_LFLAGS *= -fstack-protector-all
# We need to exclude this for Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable!
# This can be enabled for Windows, when we switch to MinGW >= 4.4.x.
}
# for extra security (see: https://wiki.debian.org/Hardening)
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
win32:QMAKE_LFLAGS *= -Wl,--large-address-aware -static
#win32:QMAKE_LFLAGS += -static-libgcc -static-libstdc++

# use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
contains(USE_QRCODE, 1) {
    message(Building with QRCode support)
    DEFINES += USE_QRCODE
    LIBS += -lqrencode
    windows:LIBS += -lpthread
}

# use: qmake "USE_UPNP=1" ( enabled by default; default)
#  or: qmake "USE_UPNP=0" (disabled by default)
#  or: qmake "USE_UPNP=-" (not supported)
# miniupnpc (http://miniupnp.free.fr/files/) must be installed for support
contains(USE_UPNP, -) {
    message(Building without UPNP support)
} else {
    message(Building with UPNP support)
    count(USE_UPNP, 0) {
        USE_UPNP=1
    }
    DEFINES += USE_UPNP=$$USE_UPNP STATICLIB
    INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH
    LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc
    win32:LIBS += -liphlpapi
}

# use: qmake "USE_DBUS=1" or qmake "USE_DBUS=0"
linux:count(USE_DBUS, 0) {
    USE_DBUS=1
}
contains(USE_DBUS, 1) {
    message(Building with DBUS (Freedesktop notifications) support)
    DEFINES += USE_DBUS
    QT += dbus
}

contains(BITCOIN_NEED_QT_PLUGINS, 1) {
    DEFINES += BITCOIN_NEED_QT_PLUGINS
    QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
}

#USE_LEVELDB += 1

!isEmpty(USE_LEVELDB) {
    message("Using leveldb...")

    DEFINES += USE_LEVELDB

    INCLUDEPATH += $$PWD/leveldb/include $$PWD/leveldb/helpers
    macx: INCLUDEPATH += /usr/local/opt/berkeley-db@4/include /usr/local/opt/boost/include /usr/local/opt/openssl/include
    LIBS += $$PWD/leveldb/libleveldb.a $$PWD/leveldb/libmemenv.a
    SOURCES += txdb-leveldb.cpp

    #NEBLIO_CONFIG += LEVELDB_TESTS

    !win32 {
        # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
        genleveldb.commands = cd $$PWD/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
        contains( NEBLIO_CONFIG, LEVELDB_TESTS ) {
            genleveldb.commands += ./arena_test && ./cache_test && ./env_test && ./table_test && ./write_batch_test && ./coding_test && ./db_bench && ./fault_injection_test && ./issue178_test && ./autocompact_test && ./dbformat_test && ./filename_test && ./issue200_test && ./log_test && ./bloom_test && ./corruption_test && ./db_test && ./filter_block_test && ./recovery_test && ./version_edit_test && ./crc32c_test && ./hash_test && ./memenv_test && ./skiplist_test && ./version_set_test && ./c_test && ./env_posix_test
        }
    } else {
        # make an educated guess about what the ranlib command is called
        isEmpty(QMAKE_RANLIB) {
            QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
        }
        LIBS += -lshlwapi
       # genleveldb.commands = cd $$PWD/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/leveldb/libmemenv.a
    }
    genleveldb.target = $$PWD/leveldb/libleveldb.a
    genleveldb.depends = FORCE
    PRE_TARGETDEPS += $$PWD/leveldb/libleveldb.a
    QMAKE_EXTRA_TARGETS += genleveldb
    # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
    QMAKE_CLEAN += $$PWD/leveldb/libleveldb.a; cd $$PWD/leveldb ; $(MAKE) clean

} else {

    DEFINES += USE_LMDB

    message("Using lmdb...")
#    LIBS += -llmdb

    INCLUDEPATH += $$PWD/liblmdb
    macx: INCLUDEPATH += /usr/local/opt/berkeley-db@4/include /usr/local/opt/boost/include /usr/local/opt/openssl/include
    SOURCES += txdb-lmdb.cpp
#    SOURCES += $$PWD/liblmdb/mdb.c $$PWD/liblmdb/midl.c

    #NEBLIO_CONFIG += LMDB_TESTS

    !win32 {
        LIBS += $$PWD/liblmdb/liblmdb.a
        # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
        #genlmdb.commands = cd $$PWD/liblmdb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" liblmdb.a
        genlmdb.commands = cd $$PWD/liblmdb && CC=$$QMAKE_CC $(MAKE) liblmdb.a
#        contains( NEBLIO_CONFIG, LMDB_TESTS ) {
#            genlmdb.commands += ./arena_test && ./cache_test && ./env_test && ./table_test && ./write_batch_test && ./coding_test && ./db_bench && ./fault_injection_test && ./issue178_test && ./autocompact_test && ./dbformat_test && ./filename_test && ./issue200_test && ./log_test && ./bloom_test && ./corruption_test && ./db_test && ./filter_block_test && ./recovery_test && ./version_edit_test && ./crc32c_test && ./hash_test && ./memenv_test && ./skiplist_test && ./version_set_test && ./c_test && ./env_posix_test
#        }
    } else {
        SOURCES += $$PWD/liblmdb/mdb.c $$PWD/liblmdb/midl.c
        # make an educated guess about what the ranlib command is called
        isEmpty(QMAKE_RANLIB) {
            QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
        }
        LIBS += -lshlwapi
#        genlmdb.commands = cd $$PWD/liblmdb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) clean && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) liblmdb.a && $$QMAKE_RANLIB -t $$PWD/liblmdb/liblmdb.a
    }
    genlmdb.target = $$PWD/liblmdb/liblmdb.a
    genlmdb.depends = FORCE
    PRE_TARGETDEPS += $$PWD/liblmdb/liblmdb.a
    QMAKE_EXTRA_TARGETS += genlmdb
    # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
    QMAKE_CLEAN += $$PWD/liblmdb/liblmdb.a; cd $$PWD/liblmdb ; $(MAKE) clean
}

# regenerate build.h
!windows|contains(USE_BUILD_INFO, 1) {
    genbuild.depends = FORCE
    genbuild.commands = cd $$PWD; /bin/sh ../share/genbuild.sh $$OUT_PWD/build/build.h
    genbuild.target = $$OUT_PWD/build/build.h
    PRE_TARGETDEPS += $$OUT_PWD/build/build.h
    QMAKE_EXTRA_TARGETS += genbuild
    DEFINES += HAVE_BUILD_INFO
}

contains(USE_O3, 1) {
    message(Building O3 optimization flag)
    QMAKE_CXXFLAGS_RELEASE -= -O2
    QMAKE_CFLAGS_RELEASE -= -O2
    QMAKE_CXXFLAGS += -O3
    QMAKE_CFLAGS += -O3
}

*-g++-32 {
    message("32 platform, adding -msse2 flag")

    QMAKE_CXXFLAGS += -msse2
    QMAKE_CFLAGS += -msse2
}

QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector

CODECFORTR = UTF-8

# for lrelease/lupdate
# also add new translations to qt/bitcoin.qrc under translations/
TRANSLATIONS = $$files(qt/locale/bitcoin_*.ts)

isEmpty(QMAKE_LRELEASE) {
    QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
}
isEmpty(QM_DIR):QM_DIR = $$PWD/qt/locale
# automatically build translations, so they can be included in resource file
TSQM.name = lrelease ${QMAKE_FILE_IN}
TSQM.input = TRANSLATIONS
TSQM.output = $$QM_DIR/${QMAKE_FILE_BASE}.qm
TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
TSQM.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += TSQM

# "Other files" to show in Qt Creator
OTHER_FILES += \
    doc/*.rst doc/*.txt doc/README README.md res/bitcoin-qt.rc

# platform specific defaults, if not overridden on command line
isEmpty(BOOST_LIB_SUFFIX) {
    macx:BOOST_LIB_SUFFIX = -mt
    windows:BOOST_LIB_SUFFIX = -mt
}

isEmpty(BOOST_THREAD_LIB_SUFFIX) {
    win32:BOOST_THREAD_LIB_SUFFIX = _win32$$BOOST_LIB_SUFFIX
    else:BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX
}

windows:DEFINES += WIN32

windows:!contains(MINGW_THREAD_BUGFIX, 0) {
    # At least qmake's win32-g++-cross profile is missing the -lmingwthrd
    # thread-safety flag. GCC has -mthreads to enable this, but it doesn't
    # work with static linking. -lmingwthrd must come BEFORE -lmingw, so
    # it is prepended to QMAKE_LIBS_QT_ENTRY.
    # It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes
    # any problems on some untested qmake profile now or in the future.
    DEFINES += _MT BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
    QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY
}

macx:HEADERS += qt/macdockiconhandler.h qt/macnotificationhandler.h
macx:OBJECTIVE_SOURCES += qt/macdockiconhandler.mm qt/macnotificationhandler.mm
macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0
macx:TARGET = "neblio-Qt"
macx:QMAKE_CFLAGS_THREAD += -pthread
macx:QMAKE_LFLAGS_THREAD += -pthread
macx:QMAKE_CXXFLAGS_THREAD += -pthread

# do not include resources while testing
!contains( NEBLIO_TEST, TRUE ) {
    macx:ICON = qt/res/icons/bitcoin.icns
    windows:RC_FILE = qt/res/bitcoin-qt.rc
}

# Set libraries and includes at end, to use platform-defined defaults if not overridden
INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
macx: LIBS += $$join(CURL_LIB_PATH,,-L,)
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
# -lgdi32 has to happen after -lcrypto (see  #681)
windows:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX -lboost_regex$$BOOST_LIB_SUFFIX
windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
macx: LIBS += -lcurl

# For Fedora
unix:INCLUDEPATH += /usr/include/libdb4/
unix:LIBS        += -L/usr/lib64/libdb4/

!macx {
    PKG_CONFIG_ENV_VAR = $$(PKG_CONFIG_PATH)
    !isEmpty(PKG_CONFIG_ENV_VAR) {
        PKG_CONFIG_PATH = $$(PKG_CONFIG_PATH)
    }
    isEmpty(PKG_CONFIG_PATH_ENV_VAR) {
        message("PKGCONFIG enviroment variable is not set")
        pkgConfPrefix = ""
    } else {
        message("PKGCONFIG enviroment variable is found to be set to: \"$${PKG_CONFIG_ENV_VAR}\"; it will be used for pkg-config")
        pkgConfPrefix = "PKGCONFIG=$${PKG_CONFIG_PATH}"
    }

    !isEmpty(PKG_CONFIG_PATH) {
        message("Setting PKG_CONFIG_PATH to $${PKG_CONFIG_PATH}")
    }

        pkgconf_exec = "$${pkgConfPrefix} $${CROSS_COMPILE}pkg-config"

    QMAKE_CFLAGS += $$system("$${pkgconf_exec} libcurl --cflags")
    QMAKE_CXXFLAGS += $$system("$${pkgconf_exec} libcurl --cflags")

    # static when release
    contains(RELEASE, 1) {
        libcurlPkgconfCmd = "$${pkgconf_exec} libcurl --libs --static"
    } else {
        libcurlPkgconfCmd = "$${pkgconf_exec} libcurl --libs"
    }
    # the testing whether system() has a zero exit code with the third parameter of system() doesn't work on all Qt versions
    libcURL_LIBS = $$system($$libcurlPkgconfCmd)
    # OpenSSL linking is not necessary as it comes with curl
    # openssl_LIBS = $$system($$opensslPkgconfCmd)
    LIBS += $$libcURL_LIBS $$openssl_LIBS
}

contains(RELEASE, 1) {
    !windows:!macx {
        # Linux: turn dynamic linking back on for c/c++ runtime libraries
        LIBS += -Wl,-Bdynamic
    }
}

!windows:!macx {
    DEFINES += LINUX
    LIBS += -lrt -ldl
}

greaterThan(QT_MAJOR_VERSION, 4) {
    QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
}

# for boost 1.37, add -mt to the boost libraries
# use: qmake BOOST_LIB_SUFFIX=-mt
# for boost thread win32 with _win32 sufix
# use: BOOST_THREAD_LIB_SUFFIX=_win32-...
# or when linking against a specific BerkelyDB version: BDB_LIB_SUFFIX=-4.8

BOOST_LIB_SUFFIX=
windows:BOOST_INCLUDE_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/include/boost
windows:BOOST_LIB_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/lib
macx:BOOST_LIB_PATH=/usr/local/opt/boost@1.60/lib
macx:BOOST_INCLUDE_PATH=/usr/local/opt/boost@1.60/include
windows:BDB_INCLUDE_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/include
windows:BDB_LIB_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/lib
macx:BDB_LIB_PATH=/usr/local/opt/berkeley-db\@4/lib/
MINIUPNPC_LIB_SUFFIX=-miniupnpc
windows:MINIUPNPC_INCLUDE_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/include
windows:MINIUPNPC_LIB_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/libc
macx:OPENSSL_LIB_PATH=/usr/local/opt/openssl/lib
macx:MINIUPNPC_INCLUDE_PATH=/usr/local/opt/miniupnpc/include
macx:MINIUPNPC_LIB_PATH=/usr/local/opt/miniupnpc/lib
macx:QRENCODE_INCLUDE_PATH=/usr/local/opt/qrencode/include
macx:QRENCODE_LIB_PATH=/usr/local/opt/qrencode/lib
macx:CURL_LIB_PATH=/usr/local/opt/curl/lib
windows:QRENCODE_INCLUDE_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/include
windows:QRENCODE_LIB_PATH=/home/build/Documents/mxe/usr/i686-w64-mingw32.static/libc

# Dependency library locations can be customized with:
#    BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH,
#    BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively

OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build

# fixes an issue with boost 1.66 and the number of template parameters of basic_socket_acceptor
#DEFINES += BOOST_ASIO_ENABLE_OLD_SERVICES
# TODO: Move to the new standard of boost as current code is deprecated

# use: qmake "RELEASE=1"
contains(RELEASE, 1) {
    # Mac: compile for maximum compatibility (10.12, 32-bit)
    macx:QMAKE_CXXFLAGS += -mmacosx-version-min=10.12 -arch x86_64 -Wno-nullability-completeness -Wno-unused-command-line-argument

    !windows:!macx {
        # Linux: static link
        LIBS += -Wl,-Bstatic
    }
}

!win32 {
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
QMAKE_CXXFLAGS *= -fstack-protector-all
QMAKE_LFLAGS *= -fstack-protector-all
# We need to exclude this for Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable!
# This can be enabled for Windows, when we switch to MinGW >= 4.4.x.
}
# for extra security (see: https://wiki.debian.org/Hardening)
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
win32:QMAKE_LFLAGS *= -Wl,--large-address-aware -static
#win32:QMAKE_LFLAGS += -static-libgcc -static-libstdc++

# use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
contains(USE_QRCODE, 1) {
    message(Building with QRCode support)
    DEFINES += USE_QRCODE
    LIBS += -lqrencode
    windows:LIBS += -lpthread
}

# use: qmake "USE_UPNP=1" ( enabled by default; default)
#  or: qmake "USE_UPNP=0" (disabled by default)
#  or: qmake "USE_UPNP=-" (not supported)
# miniupnpc (http://miniupnp.free.fr/files/) must be installed for support
contains(USE_UPNP, -) {
    message(Building without UPNP support)
} else {
    message(Building with UPNP support)
    count(USE_UPNP, 0) {
        USE_UPNP=1
    }
    DEFINES += USE_UPNP=$$USE_UPNP STATICLIB
    INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH
    LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc
    win32:LIBS += -liphlpapi
}

# use: qmake "USE_DBUS=1" or qmake "USE_DBUS=0"
linux:count(USE_DBUS, 0) {
    USE_DBUS=1
}
contains(USE_DBUS, 1) {
    message(Building with DBUS (Freedesktop notifications) support)
    DEFINES += USE_DBUS
    QT += dbus
}

contains(BITCOIN_NEED_QT_PLUGINS, 1) {
    DEFINES += BITCOIN_NEED_QT_PLUGINS
    QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
}

#USE_LEVELDB += 1

!isEmpty(USE_LEVELDB) {
    message("Using leveldb...")

    DEFINES += USE_LEVELDB

    INCLUDEPATH += $$PWD/leveldb/include $$PWD/leveldb/helpers
    macx: INCLUDEPATH += /usr/include /usr/local/opt/berkeley-db@4/include /usr/local/opt/boost/include /usr/local/opt/openssl/include
    LIBS += $$PWD/leveldb/libleveldb.a $$PWD/leveldb/libmemenv.a
    SOURCES += txdb-leveldb.cpp

    #NEBLIO_CONFIG += LEVELDB_TESTS

    !win32 {
        # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
        genleveldb.commands = cd $$PWD/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
        contains( NEBLIO_CONFIG, LEVELDB_TESTS ) {
            genleveldb.commands += ./arena_test && ./cache_test && ./env_test && ./table_test && ./write_batch_test && ./coding_test && ./db_bench && ./fault_injection_test && ./issue178_test && ./autocompact_test && ./dbformat_test && ./filename_test && ./issue200_test && ./log_test && ./bloom_test && ./corruption_test && ./db_test && ./filter_block_test && ./recovery_test && ./version_edit_test && ./crc32c_test && ./hash_test && ./memenv_test && ./skiplist_test && ./version_set_test && ./c_test && ./env_posix_test
        }
    } else {
        # make an educated guess about what the ranlib command is called
        isEmpty(QMAKE_RANLIB) {
            QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
        }
        LIBS += -lshlwapi
       # genleveldb.commands = cd $$PWD/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/leveldb/libmemenv.a
    }
    genleveldb.target = $$PWD/leveldb/libleveldb.a
    genleveldb.depends = FORCE
    PRE_TARGETDEPS += $$PWD/leveldb/libleveldb.a
    QMAKE_EXTRA_TARGETS += genleveldb
    # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
    QMAKE_CLEAN += $$PWD/leveldb/libleveldb.a; cd $$PWD/leveldb ; $(MAKE) clean

} else {

    DEFINES += USE_LMDB

    message("Using lmdb...")
#    LIBS += -llmdb

    INCLUDEPATH += $$PWD/liblmdb
    macx: INCLUDEPATH += /usr/include /usr/local/opt/berkeley-db@4/include /usr/local/opt/boost/include /usr/local/opt/openssl/include
    SOURCES += txdb-lmdb.cpp
#    SOURCES += $$PWD/liblmdb/mdb.c $$PWD/liblmdb/midl.c

    #NEBLIO_CONFIG += LMDB_TESTS

    !win32 {
        LIBS += $$PWD/liblmdb/liblmdb.a
        # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
        #genlmdb.commands = cd $$PWD/liblmdb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" liblmdb.a
        genlmdb.commands = cd $$PWD/liblmdb && CC=$$QMAKE_CC $(MAKE) liblmdb.a
#        contains( NEBLIO_CONFIG, LMDB_TESTS ) {
#            genlmdb.commands += ./arena_test && ./cache_test && ./env_test && ./table_test && ./write_batch_test && ./coding_test && ./db_bench && ./fault_injection_test && ./issue178_test && ./autocompact_test && ./dbformat_test && ./filename_test && ./issue200_test && ./log_test && ./bloom_test && ./corruption_test && ./db_test && ./filter_block_test && ./recovery_test && ./version_edit_test && ./crc32c_test && ./hash_test && ./memenv_test && ./skiplist_test && ./version_set_test && ./c_test && ./env_posix_test
#        }
    } else {
        SOURCES += $$PWD/liblmdb/mdb.c $$PWD/liblmdb/midl.c
        # make an educated guess about what the ranlib command is called
        isEmpty(QMAKE_RANLIB) {
            QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
        }
        LIBS += -lshlwapi
#        genlmdb.commands = cd $$PWD/liblmdb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) clean && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) liblmdb.a && $$QMAKE_RANLIB -t $$PWD/liblmdb/liblmdb.a
    }
    genlmdb.target = $$PWD/liblmdb/liblmdb.a
    genlmdb.depends = FORCE
    PRE_TARGETDEPS += $$PWD/liblmdb/liblmdb.a
    QMAKE_EXTRA_TARGETS += genlmdb
    # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
    QMAKE_CLEAN += $$PWD/liblmdb/liblmdb.a; cd $$PWD/liblmdb ; $(MAKE) clean
}

# regenerate build.h
!windows|contains(USE_BUILD_INFO, 1) {
    genbuild.depends = FORCE
    genbuild.commands = cd $$PWD; /bin/sh ../share/genbuild.sh $$OUT_PWD/build/build.h
    genbuild.target = $$OUT_PWD/build/build.h
    PRE_TARGETDEPS += $$OUT_PWD/build/build.h
    QMAKE_EXTRA_TARGETS += genbuild
    DEFINES += HAVE_BUILD_INFO
}

contains(USE_O3, 1) {
    message(Building O3 optimization flag)
    QMAKE_CXXFLAGS_RELEASE -= -O2
    QMAKE_CFLAGS_RELEASE -= -O2
    QMAKE_CXXFLAGS += -O3
    QMAKE_CFLAGS += -O3
}

*-g++-32 {
    message("32 platform, adding -msse2 flag")

    QMAKE_CXXFLAGS += -msse2
    QMAKE_CFLAGS += -msse2
}

QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector

CODECFORTR = UTF-8

# for lrelease/lupdate
# also add new translations to qt/bitcoin.qrc under translations/
TRANSLATIONS = $$files(qt/locale/bitcoin_*.ts)

isEmpty(QMAKE_LRELEASE) {
    QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
}
isEmpty(QM_DIR):QM_DIR = $$PWD/qt/locale
# automatically build translations, so they can be included in resource file
TSQM.name = lrelease ${QMAKE_FILE_IN}
TSQM.input = TRANSLATIONS
TSQM.output = $$QM_DIR/${QMAKE_FILE_BASE}.qm
TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
TSQM.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += TSQM

# "Other files" to show in Qt Creator
OTHER_FILES += \
    doc/*.rst doc/*.txt doc/README README.md res/bitcoin-qt.rc

# platform specific defaults, if not overridden on command line
isEmpty(BOOST_LIB_SUFFIX) {
    macx:BOOST_LIB_SUFFIX = -mt
    windows:BOOST_LIB_SUFFIX = -mt
}

isEmpty(BOOST_THREAD_LIB_SUFFIX) {
    win32:BOOST_THREAD_LIB_SUFFIX = _win32$$BOOST_LIB_SUFFIX
    else:BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX
}

windows:DEFINES += WIN32

windows:!contains(MINGW_THREAD_BUGFIX, 0) {
    # At least qmake's win32-g++-cross profile is missing the -lmingwthrd
    # thread-safety flag. GCC has -mthreads to enable this, but it doesn't
    # work with static linking. -lmingwthrd must come BEFORE -lmingw, so
    # it is prepended to QMAKE_LIBS_QT_ENTRY.
    # It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes
    # any problems on some untested qmake profile now or in the future.
    DEFINES += _MT BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
    QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY
}

macx:HEADERS += qt/macdockiconhandler.h qt/macnotificationhandler.h
macx:OBJECTIVE_SOURCES += qt/macdockiconhandler.mm qt/macnotificationhandler.mm
macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0
macx:TARGET = "neblio-Qt"
macx:QMAKE_CFLAGS_THREAD += -pthread
macx:QMAKE_LFLAGS_THREAD += -pthread
macx:QMAKE_CXXFLAGS_THREAD += -pthread

# do not include resources while testing
!contains( NEBLIO_TEST, TRUE ) {
    macx:ICON = qt/res/icons/bitcoin.icns
    windows:RC_FILE = qt/res/bitcoin-qt.rc
}

# Set libraries and includes at end, to use platform-defined defaults if not overridden
INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
macx: LIBS += $$join(CURL_LIB_PATH,,-L,)
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
# -lgdi32 has to happen after -lcrypto (see  #681)
windows:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX -lboost_regex$$BOOST_LIB_SUFFIX
windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
macx: LIBS += -lcurl

# For Fedora
unix:INCLUDEPATH += /usr/include/libdb4/
unix:LIBS        += -L/usr/lib64/libdb4/

!macx {
    PKG_CONFIG_ENV_VAR = $$(PKG_CONFIG_PATH)
    !isEmpty(PKG_CONFIG_ENV_VAR) {
        PKG_CONFIG_PATH = $$(PKG_CONFIG_PATH)
    }
    isEmpty(PKG_CONFIG_PATH_ENV_VAR) {
        message("PKGCONFIG enviroment variable is not set")
        pkgConfPrefix = ""
    } else {
        message("PKGCONFIG enviroment variable is found to be set to: \"$${PKG_CONFIG_ENV_VAR}\"; it will be used for pkg-config")
        pkgConfPrefix = "PKGCONFIG=$${PKG_CONFIG_PATH}"
    }

    !isEmpty(PKG_CONFIG_PATH) {
        message("Setting PKG_CONFIG_PATH to $${PKG_CONFIG_PATH}")
    }

        pkgconf_exec = "$${pkgConfPrefix} $${CROSS_COMPILE}pkg-config"

    QMAKE_CFLAGS += $$system("$${pkgconf_exec} libcurl --cflags")
    QMAKE_CXXFLAGS += $$system("$${pkgconf_exec} libcurl --cflags")

    # static when release
    contains(RELEASE, 1) {
        libcurlPkgconfCmd = "$${pkgconf_exec} libcurl --libs --static"
    } else {
        libcurlPkgconfCmd = "$${pkgconf_exec} libcurl --libs"
    }
    # the testing whether system() has a zero exit code with the third parameter of system() doesn't work on all Qt versions
    libcURL_LIBS = $$system($$libcurlPkgconfCmd)
    # OpenSSL linking is not necessary as it comes with curl
    # openssl_LIBS = $$system($$opensslPkgconfCmd)
    LIBS += $$libcURL_LIBS $$openssl_LIBS
}

contains(RELEASE, 1) {
    !windows:!macx {
        # Linux: turn dynamic linking back on for c/c++ runtime libraries
        LIBS += -Wl,-Bdynamic
    }
}

!windows:!macx {
    DEFINES += LINUX
    LIBS += -lrt -ldl
}


Add system package lookup for qwt

Add system package lookup for qwt

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

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

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

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

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

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

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

# Set hompath and libname
qwt_home = $${PWD}/qwt
qwt_libdir = $${qwt_home}/lib
libname = qwt

defineTest(have_qwt) {
  exists($${qwt_libdir}) {
    return(true)
  }
  return(false)
}

have_qwt() {
  INCLUDEPATH *= $${qwt_home}/include
  LIBS *= -L$${qwt_libdir} -l$${libname}$${dbg_ext}
  # Note! The RPATH is absolute and only meant for dev builds in the IDE, on release runtime paths should be stripped
  QMAKE_RPATHDIR *= $${qwt_libdir}
}


Only try to use ldconfig if it can be found

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

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

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

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

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

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

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

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

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

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

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

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


Add cppzmq include path

Add cppzmq include path

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

# Set expected local install dir
zeromq_home = $${PWD}/zeromq
cppzmq_home = $${PWD}/cppzmq
zeromq_lib = $${zeromq_home}/lib
zeromq_bin = $${zeromq_home}/bin

defineTest(have_local_zeromq) {
  exists($${zeromq_lib}) {
    return(true)
  }
  return(false)
}

defineTest(have_system_zeromq) {
  packagesExist(libzmq) {
    return(true)
  }
  return(false)
}

defineTest(have_zeromq) {
  have_local_zeromq() {
    return(true)
  }
  have_system_zeromq() {
    return(true)
  }
  return(false)
}

have_local_zeromq() {
  INCLUDEPATH *= $${zeromq_home}/include
  INCLUDEPATH *= $${cppzmq_home}
  win32:LIBS *= -L$${zeromq_bin} -lzmq$${dbg_ext}
  unix:LIBS *= -L$${zeromq_lib} -lzmq$${dbg_ext}
  # Note! The RPATH is absolute and only meant for dev builds in the IDE, on release runtime paths should be stripped
  unix:QMAKE_RPATHDIR *= $${zeromq_lib}
  win32:QMAKE_RPATHDIR *= $${zeromq_bin}
  message(Found local ZeroMQ)
} else:have_system_zeromq() {
  CONFIG *= link_pkgconfig
  PKGCONFIG *= libzmq
  message(Found system pkg-config ZeroMQ)
}

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

# Set expected local install dir
zeromq_home = $${PWD}/zeromq
zeromq_lib = $${zeromq_home}/lib
zeromq_bin = $${zeromq_home}/bin

defineTest(have_local_zeromq) {
  exists($${zeromq_lib}) {
    return(true)
  }
  return(false)
}

defineTest(have_system_zeromq) {
  packagesExist(libzmq) {
    return(true)
  }
  return(false)
}

defineTest(have_zeromq) {
  have_local_zeromq() {
    return(true)
  }
  have_system_zeromq() {
    return(true)
  }
  return(false)
}

have_local_zeromq() {
  INCLUDEPATH *= $${zeromq_home}/include
  win32:LIBS *= -L$${zeromq_bin} -lzmq$${dbg_ext}
  unix:LIBS *= -L$${zeromq_lib} -lzmq$${dbg_ext}
  # Note! The RPATH is absolute and only meant for dev builds in the IDE, on release runtime paths should be stripped
  unix:QMAKE_RPATHDIR *= $${zeromq_lib}
  win32:QMAKE_RPATHDIR *= $${zeromq_bin}
  message(Found local ZeroMQ)
} else:have_system_zeromq() {
  CONFIG *= link_pkgconfig
  PKGCONFIG *= libzmq
  message(Found system pkg-config ZeroMQ)
}


- Cleanup unnecessary variables - Throw error in case correct plugin installation directory is not   available

#-----------------------------------------------------------------------------
# Common variables for all projects.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Common configuration for all projects.
#-----------------------------------------------------------------------------

CONFIG         += link_pkgconfig
#MOC_DIR         = .moc
#OBJECTS_DIR     = .obj
RCC_DIR         = resources
UI_DIR          = ui
UI_HEADERS_DIR  = ui/include
UI_SOURCES_DIR  = ui/src

QMAKE_CXXFLAGS += -fno-exceptions \
    -fno-rtti
# we don't like warnings...
QMAKE_CXXFLAGS -= -Werror

TOP_SRC_DIR     = $$PWD

#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += SIGNON_TRACE

#-----------------------------------------------------------------------------
# setup the installation prefix
#-----------------------------------------------------------------------------
INSTALL_PREFIX = /usr  # default installation prefix

# default prefix can be overriden by defining PREFIX when running qmake
isEmpty( PREFIX ) {
    message("====")
    message("==== NOTE: To override the installation path run: `qmake PREFIX=/custom/path'")
    message("==== (current installation path is `$${INSTALL_PREFIX}')")
} else {
    INSTALL_PREFIX = $${PREFIX}
    message("====")
    message("==== install prefix set to `$${INSTALL_PREFIX}'")
}

# Setup the library installation directory
exists( meego-release ) {
    ARCH = $$system(tail -n1 meego-release)
} else {
    ARCH = $$system(uname -m)
}

contains( ARCH, x86_64 ) {
    INSTALL_LIBDIR = $${INSTALL_PREFIX}/lib64
} else {
    INSTALL_LIBDIR = $${INSTALL_PREFIX}/lib
}

# default library directory can be overriden by defining LIBDIR when
# running qmake
isEmpty( LIBDIR ) {
    message("====")
    message("==== NOTE: To override the library installation path run: `qmake LIBDIR=/custom/path'")
    message("==== (current installation path is `$${INSTALL_LIBDIR}')")
} else {
    INSTALL_LIBDIR = $${LIBDIR}
    message("====")
    message("==== library install path set to `$${INSTALL_LIBDIR}'")
}

# Default directory for signond extensions
_PLUGINS = $$system(pkg-config --variable=plugindir signon-plugins)
isEmpty(_PLUGINS) {
    error("plugin directory not available through pkg-config")
} else {
    SIGNON_PLUGINS_DIR = $$_PLUGINS
}
SIGNON_PLUGINS_DIR_QUOTED = \\\"$$SIGNON_PLUGINS_DIR\\\"

#-----------------------------------------------------------------------------
# Common variables for all projects.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Common configuration for all projects.
#-----------------------------------------------------------------------------

CONFIG         += link_pkgconfig
#MOC_DIR         = .moc
#OBJECTS_DIR     = .obj
RCC_DIR         = resources
UI_DIR          = ui
UI_HEADERS_DIR  = ui/include
UI_SOURCES_DIR  = ui/src

QMAKE_CXXFLAGS += -fno-exceptions \
    -fno-rtti
# we don't like warnings...
QMAKE_CXXFLAGS -= -Werror

BUILD_DIR = builddir
TOP_SRC_DIR     = $$PWD
TOP_BUILD_DIR   = $${TOP_SRC_DIR}/$(BUILD_DIR)

#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += SIGNON_TRACE

#-----------------------------------------------------------------------------
# setup the installation prefix
#-----------------------------------------------------------------------------
INSTALL_PREFIX = /usr  # default installation prefix

# default prefix can be overriden by defining PREFIX when running qmake
isEmpty( PREFIX ) {
    message("====")
    message("==== NOTE: To override the installation path run: `qmake PREFIX=/custom/path'")
    message("==== (current installation path is `$${INSTALL_PREFIX}')")
} else {
    INSTALL_PREFIX = $${PREFIX}
    message("====")
    message("==== install prefix set to `$${INSTALL_PREFIX}'")
}

# Setup the library installation directory
exists( meego-release ) {
    ARCH = $$system(tail -n1 meego-release)
} else {
    ARCH = $$system(uname -m)
}

contains( ARCH, x86_64 ) {
    INSTALL_LIBDIR = $${INSTALL_PREFIX}/lib64
} else {
    INSTALL_LIBDIR = $${INSTALL_PREFIX}/lib
}

# default library directory can be overriden by defining LIBDIR when
# running qmake
isEmpty( LIBDIR ) {
    message("====")
    message("==== NOTE: To override the library installation path run: `qmake LIBDIR=/custom/path'")
    message("==== (current installation path is `$${INSTALL_LIBDIR}')")
} else {
    INSTALL_LIBDIR = $${LIBDIR}
    message("====")
    message("==== library install path set to `$${INSTALL_LIBDIR}'")
}

# Default directory for signond extensions
_PLUGINS = $$system(pkg-config --variable=plugindir signon-plugins)
isEmpty(_PLUGINS) {
    SIGNON_PLUGINS_DIR = $${INSTALL_LIBDIR}/signon
} else {
    SIGNON_PLUGINS_DIR = $$_PLUGINS
}
SIGNON_PLUGINS_DIR_QUOTED = \\\"$$SIGNON_PLUGINS_DIR\\\"


bringing SIGNON_AEGISFS define into place

#-----------------------------------------------------------------------------
# Common configuration for all projects.
#-----------------------------------------------------------------------------

CONFIG         += link_pkgconfig
#MOC_DIR         = .moc
#OBJECTS_DIR     = .obj
RCC_DIR         = resources
#UI_DIR          = ui
#UI_HEADERS_DIR  = ui/include
#UI_SOURCES_DIR  = ui/src

# we don't like warnings...
QMAKE_CXXFLAGS -= -Werror -Wno-write-strings
# Disable RTTI
QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti

TOP_SRC_DIR     = $$PWD
TOP_BUILD_DIR   = $${TOP_SRC_DIR}/$(BUILD_DIR)
QMAKE_LIBDIR   += $${TOP_BUILD_DIR}/lib/SignOn
INCLUDEPATH    += $${TOP_SRC_DIR}/lib

#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += DEBUG_ENABLED
#TODO comment this to restrict plugins to run under signon user
DEFINES += NO_SIGNON_USER

# Default directory for signond extensions
DEFINES += SIGNON_EXTENSIONS_DIR=\\\"/usr/lib/signon/extensions\\\"

# Bringing aegisFS into use
DEFINES += SIGNON_AEGISFS
# End of File

#-----------------------------------------------------------------------------
# Common configuration for all projects.
#-----------------------------------------------------------------------------

CONFIG         += link_pkgconfig
#MOC_DIR         = .moc
#OBJECTS_DIR     = .obj
RCC_DIR         = resources
#UI_DIR          = ui
#UI_HEADERS_DIR  = ui/include
#UI_SOURCES_DIR  = ui/src

# we don't like warnings...
QMAKE_CXXFLAGS -= -Werror -Wno-write-strings
# Disable RTTI
QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti

TOP_SRC_DIR     = $$PWD
TOP_BUILD_DIR   = $${TOP_SRC_DIR}/$(BUILD_DIR)
QMAKE_LIBDIR   += $${TOP_BUILD_DIR}/lib/SignOn
INCLUDEPATH    += $${TOP_SRC_DIR}/lib

#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += DEBUG_ENABLED
#TODO comment this to restrict plugins to run under signon user
DEFINES += NO_SIGNON_USER

# Default directory for signond extensions
DEFINES += SIGNON_EXTENSIONS_DIR=\\\"/usr/lib/signon/extensions\\\"
# End of File


Fixes: out-of-tree builds for documentation

RevBy: TBD

DOXYGEN_BIN=doxygen

QMAKE_EXTRA_TARGETS += doc
doc.target = doc
isEmpty(DOXYGEN_BIN) {
    doc.commands = @echo "Unable to detect doxygen in PATH"
} else {
  doc.commands += mkdir -p $${OUT_PWD}/doc/html/ ;
  doc.commands+= ( cat $${IN_PWD}/mdoxy.cfg.in | \
        perl -pe \"s:\@M_SRC_DIR\@:$${IN_PWD}:g\" > $${OUT_PWD}/doc/mdoxy.cfg );
  isEqual( IS_OUT_OF_SOURCE, 0 ) {
    # in-source build
    doc.commands += $${DOXYGEN_BIN} $${IN_PWD}/mdoxy.cfg ;
    doc.commands+= mkdir -p doc/html ;
    doc.commands+= cp $${IN_PWD}/src/images/* doc/html ;
    doc.commands+= cp $${IN_PWD}/src/*.html doc/html ;
    doc.commands+= $${IN_PWD}/xmlize.pl ;

    # Install rules
    htmldocs.files = ./doc/html/*

  } else {
    # out-of-source build
    doc.commands+= ( cd doc ; $${DOXYGEN_BIN} $${OUT_PWD}/doc/mdoxy.cfg );
    doc.commands+= cp $${IN_PWD}/src/images/* $${OUT_PWD}/doc/html ;
    doc.commands+= ( cd doc ; $${IN_PWD}/xmlize.pl );

    # Install rules
    htmldocs.files = $${OUT_PWD}/doc/html/*
  }

  htmldocs.path = /usr/share/doc/meego-im-framework
  htmldocs.CONFIG += no_check_exist
  INSTALLS += htmldocs
}

doc.depends = FORCE

DOXYGEN_BIN=doxygen

QMAKE_EXTRA_TARGETS += doc
doc.target = doc
isEmpty(DOXYGEN_BIN) {
    doc.commands = @echo "Unable to detect doxygen in PATH"
} else {
  doc.commands+= ( cat $${IN_PWD}/mdoxy.cfg.in | \
        perl -pe \"s:\@M_SRC_DIR\@:$${IN_PWD}:g\" > $${OUT_PWD}/doc/mdoxy.cfg );
  isEqual( IS_OUT_OF_SOURCE, 0 ) {
    # in-source build
    doc.commands += $${DOXYGEN_BIN} $${IN_PWD}/mdoxy.cfg ;
    doc.commands+= mkdir -p doc/html ;
    doc.commands+= cp $${IN_PWD}/src/images/* doc/html ;
    doc.commands+= cp $${IN_PWD}/src/*.html doc/html ;
    doc.commands+= $${IN_PWD}/xmlize.pl ;

    # Install rules
    htmldocs.files = ./doc/html/*

  } else {
    # out-of-source build
    doc.commands += mkdir -p doc/html/ ;

    doc.commands+= ( cd doc ; $${DOXYGEN_BIN} mdoxy.cfg );
    doc.commands+= cp $${IN_PWD}/src/images/* $${OUT_PWD}/doc/html ;
    doc.commands+= ( cd doc ; $${IN_PWD}/xmlize.pl );

    # Install rules
    htmldocs.files = $${OUT_PWD}/doc/html/*
  }

  htmldocs.path = /usr/share/doc/meego-im-framework
  htmldocs.CONFIG += no_check_exist
  INSTALLS += htmldocs
}

doc.depends = FORCE


Restrict documentation to the src/ directory

The library must be documented separately.

#-----------------------------------------------------------------------------
# doc.pri
#-----------------------------------------------------------------------------

# list of documentation folders to install
DOC_FOLDERS = doc/html \
              doc/qch

# files and folders listed in the installation target's .files section
# must exist _before_ qmake generates the Makefile...so, make sure our
# documentation target folders exist in the current build folder
for( folder, DOC_FOLDERS ) {
    system( mkdir -p $$(PWD)/$${folder} )
}

#-----------------------------------------------------------------------------
# extra build targets for generating and cleaning documentation
#-----------------------------------------------------------------------------
for( subdir, src) {
    DOC_INPUT += $${_PRO_FILE_PWD_}/$${subdir}
}

# target for generating documentation
doctarget.target     = docs
doctarget.commands   = OUTPUT_DIRECTORY=doc \
                       PROJECT_NAME=\"$${PROJECT_NAME}\" \
                       PROJECT_NUMBER=\"$${PROJECT_VERSION}\" \
                       STRIP_FROM_PATH=\"$${_PRO_FILE_PWD_}\" \
                       INPUT=\"$${DOC_INPUT}\" \
                       QHP_NAMESPACE=\"com.nokia.example.$${TARGET}\" \
                       QHP_VIRTUAL_FOLDER=\"$${TARGET}\" \
                       TAGFILES=\"$$system(pwd)/qt.tags\" \
                       TAGFILE=\"doc/$${TARGET}.tags\" \
                       doxygen $$system(pwd)/doxy.conf
doctarget.depends    = FORCE
QMAKE_EXTRA_TARGETS += doctarget

# target for cleaning generated documentation
doccleantarget.target = cleandocs
for( folder, DOC_FOLDERS ) {
    doccleantarget.commands += rm -r -f $${folder};
}
doccleantarget.commands += rm -r -f doc/signon.tags;
doccleantarget.depends   = FORCE
QMAKE_EXTRA_TARGETS     += doccleantarget

#-----------------------------------------------------------------------------
# installation setup
# NOTE: remember to set headers.files before this include to have the headers
# properly setup.
#-----------------------------------------------------------------------------
include( ../common-installs-config.pri )

#-----------------------------------------------------------------------------
# Installation target setup for documentation
#-----------------------------------------------------------------------------
documentation.path = $${INSTALL_PREFIX}/share/doc/$${PROJECT_NAME}
for( folder, DOC_FOLDERS ) {
    documentation.files += $${folder}
}
# make sure docs are generated before trying to install anything
documentation.depends  = docs
INSTALLS              += documentation
message("====")
message("==== INSTALLS += documentation")

# End of File

#-----------------------------------------------------------------------------
# doc.pri
#-----------------------------------------------------------------------------

# list of documentation folders to install
DOC_FOLDERS = doc/html \
              doc/qch

# files and folders listed in the installation target's .files section
# must exist _before_ qmake generates the Makefile...so, make sure our
# documentation target folders exist in the current build folder
for( folder, DOC_FOLDERS ) {
    system( mkdir -p $$(PWD)/$${folder} )
}

#-----------------------------------------------------------------------------
# extra build targets for generating and cleaning documentation
#-----------------------------------------------------------------------------
for( subdir, SUBDIRS) {
    DOC_INPUT += $${_PRO_FILE_PWD_}/$${subdir}
}

# target for generating documentation
doctarget.target     = docs
doctarget.commands   = OUTPUT_DIRECTORY=doc \
                       PROJECT_NAME=\"$${PROJECT_NAME}\" \
                       PROJECT_NUMBER=\"$${PROJECT_VERSION}\" \
                       STRIP_FROM_PATH=\"$${_PRO_FILE_PWD_}\" \
                       INPUT=\"$${DOC_INPUT}\" \
                       QHP_NAMESPACE=\"com.nokia.example.$${TARGET}\" \
                       QHP_VIRTUAL_FOLDER=\"$${TARGET}\" \
                       TAGFILES=\"$$system(pwd)/qt.tags\" \
                       TAGFILE=\"doc/$${TARGET}.tags\" \
                       doxygen $$system(pwd)/doxy.conf
doctarget.depends    = FORCE
QMAKE_EXTRA_TARGETS += doctarget

# target for cleaning generated documentation
doccleantarget.target = cleandocs
for( folder, DOC_FOLDERS ) {
    doccleantarget.commands += rm -r -f $${folder};
}
doccleantarget.commands += rm -r -f doc/signon.tags;
doccleantarget.depends   = FORCE
QMAKE_EXTRA_TARGETS     += doccleantarget

#-----------------------------------------------------------------------------
# installation setup
# NOTE: remember to set headers.files before this include to have the headers
# properly setup.
#-----------------------------------------------------------------------------
include( ../common-installs-config.pri )

#-----------------------------------------------------------------------------
# Installation target setup for documentation
#-----------------------------------------------------------------------------
documentation.path = $${INSTALL_PREFIX}/share/doc/$${PROJECT_NAME}
for( folder, DOC_FOLDERS ) {
    documentation.files += $${folder}
}
# make sure docs are generated before trying to install anything
documentation.depends  = docs
INSTALLS              += documentation
message("====")
message("==== INSTALLS += documentation")

# End of File


mark current version

mark current version

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

# Common definitions

QXMPP_VERSION = 0.3.0_unreleased
QXMPP_INCLUDE_DIR = $$PWD/src
QXMPP_LIBRARY_DIR = $$PWD/lib

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

DEFINES = "QXMPP_VERSION=$$QXMPP_VERSION"

# Common definitions

QXMPP_VERSION = 0.2.0
QXMPP_INCLUDE_DIR = $$PWD/src
QXMPP_LIBRARY_DIR = $$PWD/lib

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

DEFINES = "QXMPP_VERSION=$$QXMPP_VERSION"


options: Developer-build disabled again.

Was added accidently.


Update libqmatrixclient.pri

Update libqmatrixclient.pri

QT += network
CONFIG += c++11

INCLUDEPATH += $$PWD $$PWD/kcoreaddons/src/lib/jobs

HEADERS += \
    $$PWD/connectiondata.h \
    $$PWD/connection.h \
    $$PWD/connectionprivate.h \
    $$PWD/room.h \
    $$PWD/user.h \
    $$PWD/logmessage.h \
    $$PWD/state.h \
    $$PWD/events/event.h \
    $$PWD/events/roommessageevent.h \
    $$PWD/events/roomnameevent.h \
    $$PWD/events/roomaliasesevent.h \
    $$PWD/events/roomcanonicalaliasevent.h \
    $$PWD/events/roommemberevent.h \
    $$PWD/events/roomtopicevent.h \
    $$PWD/events/typingevent.h \
    $$PWD/events/receiptevent.h \
    $$PWD/events/unknownevent.h \
    $$PWD/jobs/basejob.h \
    $$PWD/jobs/checkauthmethods.h \
    $$PWD/jobs/passwordlogin.h \
    $$PWD/jobs/postmessagejob.h \
    $$PWD/jobs/postreceiptjob.h \
    $$PWD/jobs/joinroomjob.h \
    $$PWD/jobs/leaveroomjob.h \
    $$PWD/jobs/roommembersjob.h \
    $$PWD/jobs/roommessagesjob.h \
    $$PWD/jobs/syncjob.h \
    $$PWD/jobs/mediathumbnailjob.h \
    $$PWD/jobs/logoutjob.h

SOURCES += \
    $$PWD/connectiondata.cpp \
    $$PWD/connection.cpp \
    $$PWD/connectionprivate.cpp \
    $$PWD/room.cpp \
    $$PWD/user.cpp \
    $$PWD/logmessage.cpp \
    $$PWD/state.cpp \
    $$PWD/events/event.cpp \
    $$PWD/events/roommessageevent.cpp \
    $$PWD/events/roomnameevent.cpp \
    $$PWD/events/roomaliasesevent.cpp \
    $$PWD/events/roomcanonicalaliasevent.cpp \
    $$PWD/events/roommemberevent.cpp \
    $$PWD/events/roomtopicevent.cpp \
    $$PWD/events/typingevent.cpp \
    $$PWD/events/receiptevent.cpp \
    $$PWD/events/unknownevent.cpp \
    $$PWD/jobs/basejob.cpp \
    $$PWD/jobs/checkauthmethods.cpp \
    $$PWD/jobs/passwordlogin.cpp \
    $$PWD/jobs/postmessagejob.cpp \
    $$PWD/jobs/postreceiptjob.cpp \
    $$PWD/jobs/joinroomjob.cpp \
    $$PWD/jobs/leaveroomjob.cpp \
    $$PWD/jobs/roommembersjob.cpp \
    $$PWD/jobs/roommessagesjob.cpp \
    $$PWD/jobs/syncjob.cpp \
    $$PWD/jobs/mediathumbnailjob.cpp \
    $$PWD/jobs/logoutjob.cpp

QT += network
CONFIG += c++11

INCLUDEPATH += $$PWD $$PWD/kcoreaddons/src/lib/jobs

HEADERS += \
    $$PWD/connectiondata.h \
    $$PWD/connection.h \
    $$PWD/connectionprivate.h \
    $$PWD/room.h \
    $$PWD/user.h \
    $$PWD/logmessage.h \
    $$PWD/state.h \
    $$PWD/events/event.h \
    $$PWD/events/roommessageevent.h \
    $$PWD/events/roomnameevent.h \
    $$PWD/events/roomaliasesevent.h \
    $$PWD/events/roomcanonicalaliasevent.h \
    $$PWD/events/roommemberevent.h \
    $$PWD/events/roomtopicevent.h \
    $$PWD/events/typingevent.h \
    $$PWD/events/receiptevent.h \
    $$PWD/events/unknownevent.h \
    $$PWD/jobs/basejob.h \
    $$PWD/jobs/checkauthmethods.h \
    $$PWD/jobs/passwordlogin.h \
    $$PWD/jobs/postmessagejob.h \
    $$PWD/jobs/postreceiptjob.h \
    $$PWD/jobs/joinroomjob.h \
    $$PWD/jobs/leaveroomjob.h \
    $$PWD/jobs/roommembersjob.h \
    $$PWD/jobs/roommessagesjob.h \
    $$PWD/jobs/syncjob.h \
    $$PWD/jobs/mediathumbnailjob.h \
    $$PWD/kcoreaddons/src/lib/jobs/kjob.h \
    $$PWD/kcoreaddons/src/lib/jobs/kcompositejob.h \
    $$PWD/kcoreaddons/src/lib/jobs/kjobtrackerinterface.h \
    $$PWD/kcoreaddons/src/lib/jobs/kjobuidelegate.h

SOURCES += \
    $$PWD/connectiondata.cpp \
    $$PWD/connection.cpp \
    $$PWD/connectionprivate.cpp \
    $$PWD/room.cpp \
    $$PWD/user.cpp \
    $$PWD/logmessage.cpp \
    $$PWD/state.cpp \
    $$PWD/events/event.cpp \
    $$PWD/events/roommessageevent.cpp \
    $$PWD/events/roomnameevent.cpp \
    $$PWD/events/roomaliasesevent.cpp \
    $$PWD/events/roomcanonicalaliasevent.cpp \
    $$PWD/events/roommemberevent.cpp \
    $$PWD/events/roomtopicevent.cpp \
    $$PWD/events/typingevent.cpp \
    $$PWD/events/receiptevent.cpp \
    $$PWD/events/unknownevent.cpp \
    $$PWD/jobs/basejob.cpp \
    $$PWD/jobs/checkauthmethods.cpp \
    $$PWD/jobs/passwordlogin.cpp \
    $$PWD/jobs/postmessagejob.cpp \
    $$PWD/jobs/postreceiptjob.cpp \
    $$PWD/jobs/joinroomjob.cpp \
    $$PWD/jobs/leaveroomjob.cpp \
    $$PWD/jobs/roommembersjob.cpp \
    $$PWD/jobs/roommessagesjob.cpp \
    $$PWD/jobs/syncjob.cpp \
    $$PWD/jobs/mediathumbnailjob.cpp \
    $$PWD/kcoreaddons/src/lib/jobs/kjob.cpp \
    $$PWD/kcoreaddons/src/lib/jobs/kcompositejob.cpp \
    $$PWD/kcoreaddons/src/lib/jobs/kjobtrackerinterface.cpp \
    $$PWD/kcoreaddons/src/lib/jobs/kjobuidelegate.cpp


Adds version info & bumps it to 1.0.1

Adds version info & bumps it to 1.0.1

VERSION wasn't being used, it defaulted to 1.0.1.

Change-Id: I237feb1eb40db19cb880efc7ad23c5bbb5a24723
Reviewed-by: David Faure <581a1c40aca9d456552cf3ec4d8634e37e16a350@kdab.com>

!isEmpty(MIMETYPES_PRI_INCLUDED):error("mimetypes-no-libs.pri already included")
MIMETYPES_PRI_INCLUDED = 1

VERSION = 1.0.1

INCLUDEPATH += $$PWD/include/QtMimeTypes
INCLUDEPATH += $$PWD/src/mimetypes/inqt5
INCLUDEPATH += $$PWD/src/mimetypes

mac|darwin: {
    QMAKE_CXXFLAGS += -ansi
} else:false {
    QMAKE_CXXFLAGS += -ansi -Wc++0x-compat
} else {
    QMAKE_CXXFLAGS += -std=c++0x
}

unix {
    isEmpty(PREFIX) {
        PREFIX = /usr
    }

    INCLUDEDIR = $${PREFIX}/include
    LIBDIR = $${PREFIX}/lib
}

!isEmpty(MIMETYPES_PRI_INCLUDED):error("mimetypes-no-libs.pri already included")
MIMETYPES_PRI_INCLUDED = 1

INCLUDEPATH += $$PWD/include/QtMimeTypes
INCLUDEPATH += $$PWD/src/mimetypes/inqt5
INCLUDEPATH += $$PWD/src/mimetypes

mac|darwin: {
    QMAKE_CXXFLAGS += -ansi
} else:false {
    QMAKE_CXXFLAGS += -ansi -Wc++0x-compat
} else {
    QMAKE_CXXFLAGS += -std=c++0x
}

unix {
    isEmpty(PREFIX) {
        PREFIX = /usr
    }

    INCLUDEDIR = $${PREFIX}/include
    LIBDIR = $${PREFIX}/lib
}


Clean code[913764]

Clean code[913764]

# =================================================
# * This file is part of the TTK Music Player project
# * Copyright (C) 2015 - 2018 Greedysky Studio
#
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License as published by
# * the Free Software Foundation; either version 3 of the License, or
# * (at your option) any later version.
#
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# * GNU General Public License for more details.
#
# * You should have received a copy of the GNU General Public License along
# * with this program; If not, see <http://www.gnu.org/licenses/>.
# =================================================

INCLUDEPATH += $$PWD

SOURCES += \
    $$PWD/aes_cbc.cpp \
    $$PWD/aes_core.cpp \
    $$PWD/cbc128.cpp \
    $$PWD/base64.cpp \
    $$PWD/qaeswrap.cpp \
    $$PWD/qdeswrap.cpp

HEADERS += \
    $$PWD/aes.h \
    $$PWD/aes_locl.h \
    $$PWD/cbc128.h \
    $$PWD/base64.h \
    $$PWD/qaeswrap.h \
    $$PWD/qdeswrap.h

# =================================================
# * This file is part of the TTK Music Player project
# * Copyright (C) 2015 - 2018 Greedysky Studio
#
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License as published by
# * the Free Software Foundation; either version 3 of the License, or
# * (at your option) any later version.
#
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# * GNU General Public License for more details.
#
# * You should have received a copy of the GNU General Public License along
# * with this program; If not, see <http://www.gnu.org/licenses/>.
# =================================================

INCLUDEPATH += $$PWD

SOURCES += \
    $$PWD/aes_cbc.cpp \
    $$PWD/aes_core.cpp \
    $$PWD/cbc128.cpp \
    $$PWD/base64.cpp \
    $$PWD/qaeswrap.cpp \
    $$PWD/qdeswrap.cpp \
    $$PWD/qgrywrap.cpp

HEADERS += \
    $$PWD/aes.h \
    $$PWD/aes_locl.h \
    $$PWD/cbc128.h \
    $$PWD/base64.h \
    $$PWD/qaeswrap.h \
    $$PWD/qdeswrap.h \
    $$PWD/qgrywrap.h


debug -> release

debug -> release

################################################################
# Qwt Widget Library
# Copyright (C) 1997   Josef Wilgen
# Copyright (C) 2002   Uwe Rathmann
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the Qwt License, Version 1.0
################################################################

######################################################################
# qmake internal options
######################################################################

CONFIG           += qt
CONFIG           += warn_on
CONFIG           += no_keywords
CONFIG           += silent

######################################################################
# release/debug mode
######################################################################

win32 {
    # On Windows you can't mix release and debug libraries.
    # The designer is built in release mode. If you like to use it
    # you need a release version. For your own application development you
    # might need a debug version.
    # Enable debug_and_release + build_all if you want to build both.

    CONFIG           += debug_and_release
    CONFIG           += build_all
}
else {

    CONFIG           += release

    VER_MAJ           = $${QWT_VER_MAJ}
    VER_MIN           = $${QWT_VER_MIN}
    VER_PAT           = $${QWT_VER_PAT}
    VERSION           = $${QWT_VERSION}
}

linux-g++ {
    #CONFIG           += separate_debug_info
    #QMAKE_CXXFLAGS   *= -Wfloat-equal
    #QMAKE_CXXFLAGS   *= -Wshadow
    #QMAKE_CXXFLAGS   *= -Wpointer-arith
    #QMAKE_CXXFLAGS   *= -Wconversion
    #QMAKE_CXXFLAGS   *= -Wsign-compare
    #QMAKE_CXXFLAGS   *= -Wsign-conversion
    #QMAKE_CXXFLAGS   *= -Wlogical-op
    #QMAKE_CXXFLAGS   *= -Werror=format-security

    # when using the gold linker ( Qt < 4.8 ) - might be
    # necessary on non linux systems too
    #QMAKE_LFLAGS += -lrt
}

######################################################################
# paths for building qwt
######################################################################

MOC_DIR      = moc
RCC_DIR      = resources
!debug_and_release {
    OBJECTS_DIR       = obj
}

unix {

    exists( $${QMAKE_LIBDIR_QT}/libqwt.* ) {

        # On some Linux distributions the Qwt libraries are installed
        # in the same directory as the Qt libraries. Unfortunately
        # qmake always adds QMAKE_LIBDIR_QT at the beginning of the
        # linker path, so that the installed libraries will be
        # used instead of the local ones.

        error( "local build will conflict with $${QMAKE_LIBDIR_QT}/libqwt.*" )
    }
}

################################################################
# Qwt Widget Library
# Copyright (C) 1997   Josef Wilgen
# Copyright (C) 2002   Uwe Rathmann
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the Qwt License, Version 1.0
################################################################

######################################################################
# qmake internal options
######################################################################

CONFIG           += qt
CONFIG           += warn_on
CONFIG           += no_keywords
CONFIG           += silent

######################################################################
# release/debug mode
######################################################################

win32 {
    # On Windows you can't mix release and debug libraries.
    # The designer is built in release mode. If you like to use it
    # you need a release version. For your own application development you
    # might need a debug version.
    # Enable debug_and_release + build_all if you want to build both.

    CONFIG           += debug_and_release
    CONFIG           += build_all
}
else {

    CONFIG           += debug

    VER_MAJ           = $${QWT_VER_MAJ}
    VER_MIN           = $${QWT_VER_MIN}
    VER_PAT           = $${QWT_VER_PAT}
    VERSION           = $${QWT_VERSION}
}

linux-g++ {
    #CONFIG           += separate_debug_info
    #QMAKE_CXXFLAGS   *= -Wfloat-equal
    #QMAKE_CXXFLAGS   *= -Wshadow
    #QMAKE_CXXFLAGS   *= -Wpointer-arith
    #QMAKE_CXXFLAGS   *= -Wconversion
    #QMAKE_CXXFLAGS   *= -Wsign-compare
    #QMAKE_CXXFLAGS   *= -Wsign-conversion
    #QMAKE_CXXFLAGS   *= -Wlogical-op
    #QMAKE_CXXFLAGS   *= -Werror=format-security

    # when using the gold linker ( Qt < 4.8 ) - might be
    # necessary on non linux systems too
    #QMAKE_LFLAGS += -lrt
}

######################################################################
# paths for building qwt
######################################################################

MOC_DIR      = moc
RCC_DIR      = resources
!debug_and_release {
    OBJECTS_DIR       = obj
}

unix {

    exists( $${QMAKE_LIBDIR_QT}/libqwt.* ) {

        # On some Linux distributions the Qwt libraries are installed
        # in the same directory as the Qt libraries. Unfortunately
        # qmake always adds QMAKE_LIBDIR_QT at the beginning of the
        # linker path, so that the installed libraries will be
        # used instead of the local ones.

        error( "local build will conflict with $${QMAKE_LIBDIR_QT}/libqwt.*" )
    }
}


Remove stray warn_off in pri file

Remove stray warn_off in pri file

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

CONFIG += warn_off

INCLUDEPATH += $$PWD
INCLUDEPATH += $$OUT_PWD

SOURCES += \
    $$PWD/qv4engine.cpp \
    $$PWD/qv4context.cpp \
    $$PWD/qv4runtime.cpp \
    $$PWD/qv4value.cpp \
    $$PWD/qv4debugging.cpp \
    $$PWD/qv4lookup.cpp \
    $$PWD/qv4identifier.cpp \
    $$PWD/qv4identifiertable.cpp \
    $$PWD/qv4mm.cpp \
    $$PWD/qv4managed.cpp \
    $$PWD/qv4internalclass.cpp \
    $$PWD/qv4sparsearray.cpp \
    $$PWD/qv4arrayobject.cpp \
    $$PWD/qv4argumentsobject.cpp \
    $$PWD/qv4booleanobject.cpp \
    $$PWD/qv4dateobject.cpp \
    $$PWD/qv4errorobject.cpp \
    $$PWD/qv4function.cpp \
    $$PWD/qv4functionobject.cpp \
    $$PWD/qv4globalobject.cpp \
    $$PWD/qv4jsonobject.cpp \
    $$PWD/qv4mathobject.cpp \
    $$PWD/qv4numberobject.cpp \
    $$PWD/qv4object.cpp \
    $$PWD/qv4objectproto.cpp \
    $$PWD/qv4regexpobject.cpp \
    $$PWD/qv4stringobject.cpp \
    $$PWD/qv4variantobject.cpp \
    $$PWD/qv4string.cpp \
    $$PWD/qv4objectiterator.cpp \
    $$PWD/qv4regexp.cpp \
    $$PWD/qv4serialize.cpp \
    $$PWD/qv4script.cpp \
    $$PWD/qv4executableallocator.cpp \
    $$PWD/qv4sequenceobject.cpp \
    $$PWD/qv4include.cpp \
    $$PWD/qv4qobjectwrapper.cpp \
    $$PWD/qv4qmlextensions.cpp \
    $$PWD/qv4vme_moth.cpp

HEADERS += \
    $$PWD/qv4global_p.h \
    $$PWD/qv4engine_p.h \
    $$PWD/qv4context_p.h \
    $$PWD/qv4runtime_p.h \
    $$PWD/qv4math_p.h \
    $$PWD/qv4value_p.h \
    $$PWD/qv4value_def_p.h \
    $$PWD/qv4debugging_p.h \
    $$PWD/qv4lookup_p.h \
    $$PWD/qv4identifier_p.h \
    $$PWD/qv4identifiertable_p.h \
    $$PWD/qv4mm_p.h \
    $$PWD/qv4managed_p.h \
    $$PWD/qv4internalclass_p.h \
    $$PWD/qv4sparsearray_p.h \
    $$PWD/qv4arrayobject_p.h \
    $$PWD/qv4argumentsobject_p.h \
    $$PWD/qv4booleanobject_p.h \
    $$PWD/qv4dateobject_p.h \
    $$PWD/qv4errorobject_p.h \
    $$PWD/qv4function_p.h \
    $$PWD/qv4functionobject_p.h \
    $$PWD/qv4globalobject_p.h \
    $$PWD/qv4jsonobject_p.h \
    $$PWD/qv4mathobject_p.h \
    $$PWD/qv4numberobject_p.h \
    $$PWD/qv4object_p.h \
    $$PWD/qv4objectproto_p.h \
    $$PWD/qv4regexpobject_p.h \
    $$PWD/qv4stringobject_p.h \
    $$PWD/qv4variantobject_p.h \
    $$PWD/qv4string_p.h \
    $$PWD/qv4property_p.h \
    $$PWD/qv4objectiterator_p.h \
    $$PWD/qv4regexp_p.h \
    $$PWD/qv4serialize_p.h \
    $$PWD/qv4script_p.h \
    $$PWD/qv4scopedvalue_p.h \
    $$PWD/qv4util_p.h \
    $$PWD/qv4executableallocator_p.h \
    $$PWD/qv4sequenceobject_p.h \
    $$PWD/qv4include_p.h \
    $$PWD/qv4qobjectwrapper_p.h \
    $$PWD/qv4qmlextensions_p.h \
    $$PWD/qv4vme_moth_p.h

# Use SSE2 floating point math on 32 bit instead of the default
# 387 to make test results pass on 32 and on 64 bit builds.
linux-g++*:isEqual(QT_ARCH,i386) {
    QMAKE_CFLAGS += -march=pentium4 -msse2 -mfpmath=sse
    QMAKE_CXXFLAGS += -march=pentium4 -msse2 -mfpmath=sse
}

valgrind {
    DEFINES += V4_USE_VALGRIND
}

ios: DEFINES += ENABLE_ASSEMBLER_WX_EXCLUSIVE=1

include(../../3rdparty/double-conversion/double-conversion.pri)


Symbian: Removing a nonexistent SIM contact now gives DoesNotExistError.

Task QTMOBILITY-178

symbian: {
    # Uncomment this to use Etel test server (instead of real Etel APIs)
    #DEFINES += SYMBIANSIM_BACKEND_USE_ETEL_TESTSERVER

    # add either real or test libraries for Etel
    contains(DEFINES, SYMBIANSIM_BACKEND_USE_ETEL_TESTSERVER): {
        message("Using Etel Test Server (not real Etel)")
        INCLUDEPATH +=$${EPOCROOT}epoc32/include/internal
        LIBS += -leteltestserverclient
    } else {
        message("Using real Etel APIs")
        LIBS += -letel \
                -letelmm
    }

    contains(S60_VERSION, 3.1) {

        # In S60 3.1 we need to use TMobilePhoneBookInfoV1 instead of TMobilePhoneBookInfoV5.
        # Note: Etel testsserver uses V5 always.
        !contains(DEFINES, SYMBIANSIM_BACKEND_USE_ETEL_TESTSERVER) {
            	DEFINES += SYMBIANSIM_BACKEND_PHONEBOOKINFOV1
        }
    }

    # Enable checking the existence of a contact before trying to remove it.
    # This is needed because a contact backend is supposed to give an error
    # when trying to remove a nonexistent contact, but SIM store does not
    # give an error in such situations.
    # In S60 3.1 devices the consequences are even worse; the device will
    # reboot when trying to remove several nonexistent contacts in a row.
    # The first remove operation will succeed but right after the second
    # remove operation has completed the device reboots.
    DEFINES += SYMBIANSIM_BACKEND_CHECK_BEFORE_REMOVE

    # In pre 10.1 platforms we need a small delay between requests to prevent
    # S60 3.2 devices from rebooting and S60 5.0 devices from reporting a
    # server busy error. Not sure if this is really needed for S60 3.1 but
    # it does not hurt.
    contains(S60_VERSION, 3.1) | contains(S60_VERSION, 3.2) | contains(S60_VERSION, 5.0) {
       DEFINES += SYMBIANSIM_BACKEND_USE_DELAY
    }
}

symbian: {
    # Uncomment this to use Etel test server (instead of real Etel APIs)
    #DEFINES += SYMBIANSIM_BACKEND_USE_ETEL_TESTSERVER

    # add either real or test libraries for Etel
    contains(DEFINES, SYMBIANSIM_BACKEND_USE_ETEL_TESTSERVER): {
        message("Using Etel Test Server (not real Etel)")
        INCLUDEPATH +=$${EPOCROOT}epoc32/include/internal
        LIBS += -leteltestserverclient
    } else {
        message("Using real Etel APIs")
        LIBS += -letel \
                -letelmm
    }

    contains(S60_VERSION, 3.1) {

        # In S60 3.1 we need to use TMobilePhoneBookInfoV1 instead of TMobilePhoneBookInfoV5.
        # Note: Etel testsserver uses V5 always.
        !contains(DEFINES, SYMBIANSIM_BACKEND_USE_ETEL_TESTSERVER) {
            	DEFINES += SYMBIANSIM_BACKEND_PHONEBOOKINFOV1
        }

        # S60 3.1 device will reboot when removing several nonexisting contacts in
        # sequence. The first remove operation will succeed but right after the second
        # remove operation has completed the device reboots. To prevent rebooting
        # we read the reserved slots before and really remove those contacts that
        # really exist.
        DEFINES += SYMBIANSIM_BACKEND_CHECK_BEFORE_REMOVE
    }

    # In pre 10.1 platforms we need a small delay between requests to prevent
    # S60 3.2 devices from rebooting and S60 5.0 devices from reporting a
    # server busy error. Not sure if this is really needed for S60 3.1 but
    # it does not hurt.
    contains(S60_VERSION, 3.1) | contains(S60_VERSION, 3.2) | contains(S60_VERSION, 5.0) {
       DEFINES += SYMBIANSIM_BACKEND_USE_DELAY
    }
}


Check for files in lib/ dir for Brew

Check for files in lib/ dir for Brew

packagesExist(brew) {
    BREW_PREFIX = $$system(brew --prefix)
    exists($$BREW_PREFIX/opt/admesh/lib/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/admesh/include
        LIBS += -L/usr/local/opt/admesh/lib
    }
    exists($$BREW_PREFIX/opt/stlsplit/lib/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/stlsplit/include
        LIBS += -L/usr/local/opt/stlsplit/lib
    }
    exists($$BREW_PREFIX/opt/gettext/lib/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/gettext/include
        LIBS += -L/usr/local/opt/gettext/lib
    }
}

packagesExist(brew) {
    BREW_PREFIX = $$system(brew --prefix)
    exists($$BREW_PREFIX/opt/admesh/stl.h){
        QMAKE_CXXFLAGS += -I/usr/local/opt/admesh/include
        LIBS += -L/usr/local/opt/admesh/lib
    }
    exists($$BREW_PREFIX/opt/stlsplit/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/stlsplit/include
        LIBS += -L/usr/local/opt/stlsplit/lib
    }
    exists($$BREW_PREFIX/opt/gettext/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/gettext/include
        LIBS += -L/usr/local/opt/gettext/lib
    }
}