
################################################################################
# INCLUDE Packages
################################################################################

defineTest( qt ) {
  CONFIG *= uitools
  export(CONFIG)
  QT += opengl network script sql
  export(QT)
}

defineTest( qwt ) {
  INCLUDEPATH *= /usr/include/qwt-qt4/
  export(INCLUDEPATH)
  LIBS *= -L/usr/lib/ -lqwt-qt4
  export(LIBS)
}

defineTest( glew ) {
  INCLUDEPATH *= /usr/include/GL
  export(INCLUDEPATH)
  LIBS *= -L/usr/lib -lGLEW
  export(LIBS)
}

defineTest( glut ) {
  INCLUDEPATH *=$${ACG}/OpenGL/include
  export(INCLUDEPATH)
  LIBS *= -L/usr/X11R6/lib -lglut
  export(LIBS)
}

defineTest( openmesh ) {
  QMAKE_LIBDIR += $${TOPDIR}/lib/
  QMAKE_LIBDIR += $${TOPDIR}/lib/

  CONFIG( debug, debug|release ){
    LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshCored
    LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshToolsd
  } else {
    LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshCore
    LIBS+= -Wl,-rpath=$${TOPDIR}/lib -lOpenMeshTools   
  }

  export(QMAKE_LIBDIR)
  export(LIBS)
}

defineTest( openmp ) {

  addLib( /usr/lib/gcc/x86_64-linux-gnu/4.3 /usr/lib, gomp ) {

    QMAKE_CXXFLAGS_RELEASE += -fopenmp
    QMAKE_CXXFLAGS_DEBUG   += -fopenmp
    QMAKE_CFLAGS_RELEASE   += -fopenmp
    QMAKE_CFLAGS_DEBUG     += -fopenmp
    QMAKE_LFLAGS_DEBUG     += -fopenmp
    QMAKE_LFLAGS_RELEASE   += -fopenmp

    export(QMAKE_CXXFLAGS_RELEASE)
    export(QMAKE_CFLAGS_RELEASE)
    export(QMAKE_CXXFLAGS_DEBUG)
    export(QMAKE_CFLAGS_DEBUG)
    export(QMAKE_LFLAGS_DEBUG)
    export(QMAKE_LFLAGS_RELEASE)
  } else {
    message("Unable to find OpenMP lib for linking. OpenMP support will be disabled!!")
  }

}
