#-------------------------------------------------
#
# Project created by QtCreator 2013-11-26T20:21:15
#
#-------------------------------------------------

QT       += core gui
QT       += sql
CONFIG   += no_keywords


CONFIG += python


unix:!macx {
    # Python library and header files
    python_home = $$(PYTHON_HOME)
    isEmpty(python_home) {
        python_home = /opt/python/lib
    }
    message(Python home is $${python_home})

    python_headers = $$(PYTHON_HEADERS)
    isEmpty(python_headers) {
        python_headers = /opt/python/include/python3.5m
    }
    message(Getting python headers from $${python_headers})

    QMAKE_CXXFLAGS += -std=c++11
    CONFIG += qwt
    QMAKE_CXXFLAGS += -Xlinker -export-dynamic
    QMAKE_RPATHDIR += $${libqwt_home}
    message(Linker options QMAKE_RPATHDIR is $${QMAKE_RPATHDIR})
	
    CONFIG(python){
    	libpython_vers = $$(LIBPYTHON_VERSION)
    	isEmpty(libpython_vers) {
    		libpython_vers = 3.5m
    	}
    	message(Lib Python version is $${libpython_vers})
        LIBS += -L$${python_home} -lpython$${libpython_vers}
        INCLUDEPATH += $${python_headers}
    }
}

macx: {
    message(Building on a MAC)

    CONFIG += c++11
    QMAKE_CXXFLAGS += -std=c++0x -stdlib=libc++

    QMAKE_LFLAGS += -F$$(LIBQWT_HOME)
    LIBS += -F$$(LIBQWT_HOME) -framework qwt
    INCLUDEPATH += $$(LIBQWT_HEADERS)
    DEPENDPATH += $$replace(LIBQWT_HOME, lib, )

    INCLUDEPATH += /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/Headers/
    LIBS += -L/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/ -lpython3.6

    CONFIG-=app_bundle
}

# QWT library and header files
libqwt_home = $$(LIBQWT_HOME)
isEmpty(libqwt_home) {
    libqwt_home = /opt/qwt/lib
}
message(LIBQWT path is $${libqwt_home})


libqwt_headers = $$(LIBQWT_HEADERS)
isEmpty(libqwt_headers) {
    libqwt_headers = /opt/qwt/include
}
message(Getting LIBQWT headers from $${libqwt_headers})

CONFIG(qwt){
    LIBS += -L$${libqwt_home}/ -lqwt -lutil
    INCLUDEPATH += $${libqwt_headers}
}

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = traceAnalyzer
TEMPLATE = app

#copy python scripts
config.path    = $${OUT_PWD}/scripts
config.files   = scripts/*
INSTALLS       += config

SOURCES += main.cpp\
    businessObjects/transaction.cpp \
    businessObjects/timespan.cpp \
    data/tracedb.cpp \
    presentation/tracenavigator.cpp \
    presentation/util/colorgenerator.cpp \
    presentation/tracedrawing.cpp \
    presentation/traceplotitem.cpp \
    gototimedialog.cpp \
    presentation/traceplot.cpp \
    tracefiletab.cpp \
    presentation/pornotracescroller.cpp \
    traceanalyzer.cpp \
    presentation/transactiontreewidget.cpp \
    presentation/commenttreewidget.cpp \
    presentation/util/clkgrid.cpp \
    queryeditor.cpp \
    presentation/selectedtransactiontreewidget.cpp \
    businessObjects/phases/phasefactory.cpp \
    presentation/debugmessagetreewidget.cpp \
    presentation/tracePlotMouseLabel.cpp \
    evaluationtool.cpp \
    selectmetrics.cpp \
    presentation/util/testlight.cpp \
    presentation/tracetesttreewidget.cpp \
    businessObjects/pythoncaller.cpp \
    businessObjects/tracetestresults.cpp \
    presentation/tracemetrictreewidget.cpp \
    businessObjects/phases/phase.cpp

HEADERS  += businessObjects/transaction.h \
    businessObjects/timespan.h \
    businessObjects/generalinfo.h \
    data/tracedb.h \
    presentation/tracenavigator.h \
    presentation/util/colorgenerator.h \
    presentation/util/engineeringScaleDraw.h \
    presentation/tracedrawingproperties.h \
    presentation/tracedrawing.h \
    presentation/traceplotitem.h \
    gototimedialog.h \
    presentation/traceplot.h \
    tracefiletab.h \
    presentation/pornotracescroller.h \
    traceanalyzer.h \
    presentation/transactiontreewidget.h \
    businessObjects/comment.h \
    presentation/commenttreewidget.h \
    businessObjects/tracetime.h \
    presentation/util/clkgrid.h \
    presentation/util/customlabelscaledraw.h \
    data/QueryTexts.h \
    queryeditor.h \
    presentation/selectedtransactiontreewidget.h \
    businessObjects/phases/phasefactory.h \
    presentation/debugmessagetreewidget.h \
    presentation/tracePlotMouseLabel.h \
    evaluationtool.h \
    selectmetrics.h \
    presentation/util/testlight.h \
    presentation/tracetesttreewidget.h \
    businessObjects/pythoncaller.h \
    businessObjects/testresult.h \
    businessObjects/tracetestresults.h \
    presentation/tracemetrictreewidget.h \
    businessObjects/calculatedMetric.h \
    businessObjects/tracecalculatedmetrics.h \
    businessObjects/phases/phase.h


FORMS    += \
    gototimedialog.ui \
    tracefiletab.ui \
    traceanalyzer.ui \
    queryeditor.ui \
    preferences.ui \
    selectmetrics.ui \
    evaluationtool.ui

# Additional Files:
include(scripts/scripts.pri)

DISTFILES += ../DRAMSys.astylerc
