EyeRecToo.pro 5.06 KB
Newer Older
Thiago Santini's avatar
Thiago Santini committed
1 2 3 4 5 6 7 8 9 10
QT       += core gui multimedia

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TOP = $$PWD

TARGET = EyeRecToo
TEMPLATE = app
win32: RC_ICONS = $${TOP}/icons/eyerectoo.ico

11 12 13
# For profiling with msvc
#TEMPLATE = vcapp

Thiago Santini's avatar
Thiago Santini committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
DEFINES += TURBOJPEG

# Note: Starburst and Swirski are not currently included in the repository; do not enable
#DEFINES += STARBURST
#DEFINES += SWIRSKI

SOURCES +=\
    $${TOP}/src/main.cpp\
    $${TOP}/src/MainWindow.cpp \
    $${TOP}/src/utils.cpp\
    $${TOP}/src/FrameGrabber.cpp \
    $${TOP}/src/Camera.cpp \
    $${TOP}/src/ImageProcessor.cpp \
    $${TOP}/src/EyeImageProcessor.cpp \
    $${TOP}/src/pupil-detection/ElSe.cpp \
    $${TOP}/src/pupil-detection/ExCuSe.cpp \
    $${TOP}/src/CameraWidget.cpp \
    $${TOP}/src/FieldImageProcessor.cpp \
    $${TOP}/src/Synchronizer.cpp \
    $${TOP}/src/GazeEstimationWidget.cpp \
    $${TOP}/src/GazeEstimation.cpp \
    $${TOP}/src/gaze-estimation/PolyFit.cpp \
    $${TOP}/src/gaze-estimation/Homography.cpp \
    $${TOP}/src/DataRecorder.cpp \
    $${TOP}/src/NetworkStream.cpp \
Thiago Santini's avatar
Thiago Santini committed
39
    $${TOP}/src/Reference.cpp \
40 41
    $${TOP}/src/LogWidget.cpp \
    $${TOP}/src/PerformanceMonitor.cpp \
42
    $${TOP}/src/PerformanceMonitorWidget.cpp \
43
	$${TOP}/src/CameraCalibration.cpp \
Thiago Santini's avatar
Thiago Santini committed
44 45
	$${TOP}/src/pupil-detection/PupilDetectionMethod.cpp \
	$${TOP}/src/Overlay.cpp
Thiago Santini's avatar
Thiago Santini committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

HEADERS  += \
    $${TOP}/src/MainWindow.h\
    $${TOP}/src/utils.h \
    $${TOP}/src/FrameGrabber.h \
    $${TOP}/src/Camera.h \
    $${TOP}/src/ImageProcessor.h \
    $${TOP}/src/EyeImageProcessor.h \
    $${TOP}/src/pupil-detection/PupilDetectionMethod.h \
    $${TOP}/src/pupil-detection/ElSe.h \
    $${TOP}/src/pupil-detection/ExCuSe.h \
    $${TOP}/src/CameraWidget.h \
    $${TOP}/src/InputWidget.h \
    $${TOP}/src/FieldImageProcessor.h \
    $${TOP}/src/Synchronizer.h \
    $${TOP}/src/GazeEstimationWidget.h \
    $${TOP}/src/GazeEstimation.h \
    $${TOP}/src/gaze-estimation/GazeEstimationMethod.h \
    $${TOP}/src/gaze-estimation/PolyFit.h \
    $${TOP}/src/gaze-estimation/Homography.h \
    $${TOP}/src/DataRecorder.h \
    $${TOP}/src/NetworkStream.h \
Thiago Santini's avatar
Thiago Santini committed
68
    $${TOP}/src/Reference.h \
69 70
    $${TOP}/src/LogWidget.h \
    $${TOP}/src/PerformanceMonitor.h \
71
    $${TOP}/src/PerformanceMonitorWidget.h \
Thiago Santini's avatar
Thiago Santini committed
72 73
	$${TOP}/src/CameraCalibration.h \
	$${TOP}/src/Overlay.h
Thiago Santini's avatar
Thiago Santini committed
74 75 76 77

FORMS    += \
    $${TOP}/src/MainWindow.ui \
    $${TOP}/src/CameraWidget.ui \
Thiago Santini's avatar
Thiago Santini committed
78
    $${TOP}/src/GazeEstimationWidget.ui \
79 80
    $${TOP}/src/LogWidget.ui \
    $${TOP}/src/PerformanceMonitorWidget.ui
Thiago Santini's avatar
Thiago Santini committed
81 82 83 84 85

RESOURCES += \
    $${TOP}/resources.qrc

INCLUDEPATH += "$${TOP}/src"
Thiago Santini's avatar
Thiago Santini committed
86 87 88
unix{
    LIBS += "-L$${TOP}/deps/runtime/x86_64-linux-gnu/"
}
Thiago Santini's avatar
Thiago Santini committed
89 90 91 92 93

Debug:DBG_SUFFIX = "d"

OPENCVPATH="$${TOP}/deps/opencv-3.2.0"
INCLUDEPATH += $${OPENCVPATH}/include/
Thiago Santini's avatar
Thiago Santini committed
94 95
win32:CV_SUFFIX=320$${DBG_SUFFIX}
unix:CV_SUFFIX=$${DBG_SUFFIX}
Thiago Santini's avatar
Thiago Santini committed
96 97 98 99 100 101 102 103
win32:contains(QMAKE_HOST.arch, x86_64) {
    LIBS += "-L$${OPENCVPATH}/x64/vc14/lib/"
} else {
    LIBS += "-L$${OPENCVPATH}/x86/vc14/lib/"
}
LIBS += \
    -lopencv_calib3d$${CV_SUFFIX} \
    -lopencv_core$${CV_SUFFIX} \
Thiago Santini's avatar
Thiago Santini committed
104 105
    -lopencv_features2d$${CV_SUFFIX} \
    -lopencv_flann$${CV_SUFFIX} \
Thiago Santini's avatar
Thiago Santini committed
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
    -lopencv_highgui$${CV_SUFFIX} \
    -lopencv_imgcodecs$${CV_SUFFIX} \
    -lopencv_imgproc$${CV_SUFFIX} \
    -lopencv_videoio$${CV_SUFFIX} \
    -lopencv_aruco$${CV_SUFFIX}

# JPEG-TURBO
contains(DEFINES, TURBOJPEG) {
    INCLUDEPATH += "$${TOP}/deps/libjpeg-turbo-1.5.1/libjpeg-turbo64/include/"
    win32:contains(QMAKE_HOST.arch, x86_64) {
        LIBS += "-L$${TOP}/deps/libjpeg-turbo-1.5.1/libjpeg-turbo64/lib/"
    } else {
        LIBS += "-L$${TOP}/deps/libjpeg-turbo-1.5.1/libjpeg-turbo32/lib/"
    }
    LIBS += -lturbojpeg
}

contains(DEFINES, STARBURST) {
124 125
	SOURCES += $${TOP}/src/pupil-detection/Starburst.cpp
	HEADERS += $${TOP}/src/pupil-detection/Starburst.h
Thiago Santini's avatar
Thiago Santini committed
126 127
}
contains(DEFINES, SWIRSKI) {
128 129
	SOURCES += $${TOP}/src/pupil-detection/Swirski.cpp
	HEADERS += $${TOP}/src/pupil-detection/Swirski.h
Thiago Santini's avatar
Thiago Santini committed
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155

    TBB_INC_DIR = $${TOP}/deps/tbb43/include
    TBB_LIB_DIR = $${TOP}/deps/tbb43/lib/ia32/vc11
    INCLUDEPATH += "$${TBB_INC_DIR}"
    LIBS += "-L$${TBB_LIB_DIR}"
    LIBS += -ltbb
}

# Work around for bad visual studio update (msvc14)
win32{
    INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"
    contains(QMAKE_HOST.arch, x86_64) {
        LIBS += -L"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/ucrt/x64"
    } else {
        LIBS += -L"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/ucrt/x86"
    }
}

# Copy plugins
win32{
    copydata.commands = (robocopy $$PWD/deps/runtime/x64/Release/plugins $$OUT_PWD/plugins /E) ^& exit 0
    first.depends = $(first) copydata
    export(first.depends)
    export(copydata.commands)
    QMAKE_EXTRA_TARGETS += first copydata
}
Thiago Santini's avatar
Thiago Santini committed
156 157 158 159 160 161 162
unix{
    copydata.commands = $(COPY_DIR) $$PWD/deps/runtime/x86_64-linux-gnu/plugins $$OUT_PWD
    first.depends = $(first) copydata
    export(first.depends)
    export(copydata.commands)
    QMAKE_EXTRA_TARGETS += first copydata
}
Thiago Santini's avatar
Thiago Santini committed
163 164 165 166 167 168 169

system("git --version"):{
    GIT_VERSION=$$system(git --git-dir $${TOP}/../.git --work-tree $$TOP describe --always --tags)
    DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\"
} else {
    GIT_VERSION=""
}