Subversion Repositories seema-scanner

Rev

Rev 221 | Rev 229 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#------------------------------------------------------------
#
# SMScanner
#
# Control Interface and point cloud reconstruction interface
# for the SeeMa Lab Structured Light Scanner.
#
# Supported OS: Ubuntu 16.04
#
# Dependencies: Qt 5, OpenCV, PCL 1.7.2
#
# Image Analysis and Computer Graphics, DTU, 2017
#
#------------------------------------------------------------

QT += core gui testlib

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = SMScanner
TEMPLATE = app

HEADERS  += SMScanner.h \
        SMVideoWidget.h \
        SMPointCloudWidget.h \
        camera/Camera.h \
        projector/Projector.h \
        projector/ProjectorOpenGL.h \
        projector/OpenGLContext.h \
        cvtools.h \
        SMCaptureWorker.h \
        rotationstage/RotationStage.h \
        SMPreferenceDialog.h \
        SMTypes.h \
        SMCalibrationWorker.h \
        #SMCalibrationWorkerArUco.h \
        SMCalibrationParameters.h \
        SMReconstructionWorker.h \
        #SMMeshingWorker.h \
        algorithm/Algorithm.h \
        algorithm/AlgorithmGrayCode.h \
        algorithm/AlgorithmGrayCodeHorzVert.h \
        algorithm/AlgorithmLineShift.h \
        algorithm/AlgorithmPhaseShiftThreeFreq.h \
        algorithm/AlgorithmPhaseShiftTwoFreq.h \
        algorithm/AlgorithmPhaseShiftTwoFreqHorzVert.h \
        algorithm/AlgorithmPhaseShiftEmbedded.h \
        algorithm/algorithmtools.h \
        SMVideoZoomWidget.h \
    SMLogDialog.h

SOURCES += main.cpp\
        SMScanner.cpp \
        SMVideoWidget.cpp \
        SMPointCloudWidget.cpp \
        camera/Camera.cpp \
        projector/ProjectorOpenGL.cpp \
        cvtools.cpp \
        SMCaptureWorker.cpp \
        rotationstage/RotationStage.cpp \
        SMPreferenceDialog.cpp \
        SMCalibrationWorker.cpp \
        #SMCalibrationWorkerArUco.cpp \
        SMCalibrationParameters.cpp \
        SMReconstructionWorker.cpp \
        #SMMeshingWorker.cpp \
        algorithm/AlgorithmGrayCode.cpp \
        algorithm/AlgorithmGrayCodeHorzVert.cpp \
        algorithm/AlgorithmLineShift.cpp \
        algorithm/AlgorithmPhaseShiftThreeFreq.cpp \
        algorithm/AlgorithmPhaseShiftTwoFreq.cpp \
        algorithm/AlgorithmPhaseShiftTwoFreqHorzVert.cpp \
        algorithm/AlgorithmPhaseShiftEmbedded.cpp \
        SMVideoZoomWidget.cpp \
    SMLogDialog.cpp

FORMS    += SMScanner.ui \
        SMAboutDialog.ui \
        SMPreferenceDialog.ui \
    SMLogDialog.ui

INCLUDEPATH += camera/ projector/ algorithm/ triangulator/ rotationstage/ calibration/


# Operating System dependant linking and including
# Linux
unix:!macx {
    CONFIG += link_pkgconfig
    # Link VTK (no pkg-config, only cmake files, hence we link manually for now)
    INCLUDEPATH += /usr/include/vtk-6.2/
    LIBS += -lvtkViewsQt-6.2 -lvtkRenderingQt-6.2 -lvtkGUISupportQt-6.2 -lvtkRenderingCore-6.2 -lvtkCommonExecutionModel-6.2 \
            -lvtkCommonDataModel-6.2 -lvtkCommonMath-6.2 -lvtkCommonCore-6.2 -lvtkIOImage-6.2 -lvtkCommonColor-6.2
    # PCL pkg-config workaround
    LIBS += -lboost_system # -lpcl_visualization -lpcl_common -lpcl_io -lpcl_search -lpcl_surface
    # PKG-config libs
    INCLUDEPATH += /usr/include/pcl-1.8 /usr/include/eigen3/
    PKGCONFIG += gl x11 opencv pcl_visualization-1.8 pcl_surface-1.8 pcl_search-1.8 \
                 pcl_filters-1.8 pcl_kdtree-1.8 pcl_tracking-1.8 flann eigen3
    # Ceres
    CONFIG += c++11
    LIBS += -fopenmp # -ltbb -ltbbmalloc -ltbbmalloc_proxy
    LIBS += -lceres -lglog
    #LIBS += -lcholmod
    QMAKE_CXXFLAGS += -fopenmp -openmp
}


# Windows
win32 {
    # Boost join
    DEFINES += DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED

    # opencv
    INCLUDEPATH += "$$(OPENCV_INCLUDE_DIR)/" #C:\opencv\build\include

    CONFIG(debug,debug|release){
    #debug
    LIBS += -L"$$(OPENCV_DIR)" \ #C:\opencv\build\x64\vc10\lib
            -lopencv_core247d \
            -lopencv_highgui247d \
            -lopencv_imgproc247d \
            -lopencv_calib3d247d
    } else {
    #release
    LIBS += -L"$$(OPENCV_DIR)" \
            -lopencv_core247 \
            -lopencv_highgui247 \
            -lopencv_imgproc247 \
            -lopencv_calib3d247
    }

    # pcl
    INCLUDEPATH += "$$(PCL_INCLUDE_DIR)/" #C:\Program Files\PCL\include\pcl-1.7

    CONFIG(debug,debug|release){
    #debug
    LIBS += -L"$$(PCL_DIR)" \ #C:\Program Files\PCL\lib
            -lpcl_visualization_debug \
            -lpcl_io_debug \
            -lpcl_common_debug \
            -lpcl_features_debug \
            -lpcl_filters_debug \
            -lpcl_io_debug \
            -lpcl_io_ply_debug \
            -lpcl_kdtree_debug \
            -lpcl_keypoints_debug \
            -lpcl_octree_debug \
            -lpcl_registration_debug \
            -lpcl_sample_consensus_debug \
            -lpcl_search_debug \
            -lpcl_segmentation_debug \
            -lpcl_surface_debug \
            -lpcl_tracking_debug \
            -lpcl_visualization_debug
    } else {
    # release
    LIBS += -L"$$(PCL_DIR)" \
            -lpcl_visualization_release \
            -lpcl_io_release \
            -lpcl_common_release \
            -lpcl_features_release \
            -lpcl_filters_release \
            -lpcl_io_release \
            -lpcl_io_ply_release \
            -lpcl_kdtree_release \
            -lpcl_keypoints_release \
            -lpcl_octree_release \
            -lpcl_registration_release \
            -lpcl_sample_consensus_release \
            -lpcl_search_release \
            -lpcl_segmentation_release \
            -lpcl_surface_release \
            -lpcl_tracking_release \
            -lpcl_visualization_release
    }

    # pcl dependencies
    INCLUDEPATH += "$$(BOOST_ROOT)/include" \
                   "$$(EIGEN_ROOT)/include" \
                   "$$(FLANN_ROOT)/include"
    LIBS += -L"$$(BOOST_ROOT)/lib" -lboost_system-vc100-mt-1_50 -lboost_system-vc100-mt-gd-1_50

    # vtk
    INCLUDEPATH += "$$(VTK_INCLUDE_DIR)" #C:\Program Files\VTK\include\vtk-5.10

    CONFIG(debug,debug|release){
    #debug
    LIBS += -L"$$(VTK_DIR)" \ #C:\Program Files\VTK\lib\vtk-5.10
            -lvtkGraphics-gd \
            -lQVTK-gd \
            -lvtkCommon-gd \
            -lvtkFiltering-gd \
            -lvtkRendering-gd \
            -lvtkIO-gd \
            -lvtkpng-gd \
            -lvtksys-gd \
            -lvtktiff-gd \
            -lvtkjpeg-gd \
            -lvtkexpat-gd \
            -lvtkzlib-gd
    } else {
    # release
    LIBS += -L"$$(VTK_DIR)" \
            -lvtkGraphics \
            -lQVTK \
            -lvtkCommon \
            -lvtkFiltering \
            -lvtkRendering \
            -lvtkIO \
            -lvtkpng \
            -lvtksys \
            -lvtktiff \
            -lvtkjpeg \
            -lvtkexpat \
            -lvtkzlib
    }

}
# Mac OS X
macx {
    INCLUDEPATH += /opt/local/include/vtk-5.10/
    LIBS += -L/opt/local/lib/vtk-5.10/ -lQVTK -lvtkCommon -lvtkFiltering -lvtkRendering -lvtkIO -lvtkGraphics
    LIBS += -L/opt/local/lib/ -lboost_system-mt
    CONFIG += link_pkgconfig
    PKGCONFIG += opencv pcl_visualization-1.7 pcl_filters-1.7 pcl_search-1.7 pcl_registration-1.7
    DEFINES += BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
}


# Compile with system dependent OpenGL Context code
unix:!macx{
    SOURCES += projector/OpenGLContext.Xscreens.cpp
    LIBS += -lXxf86vm
}
win32{
    SOURCES += projector/OpenGLContext.Win.cpp
}
macx{
    CONFIG += objective_c
    OBJECTIVE_SOURCES += projector/OpenGLContext.Mac.mm
    LIBS += -framework Cocoa -framework OpenGL
}


# Compile with camera driver bindings

# Point Grey flycapture
unix:!macx:exists(/usr/include/flycapture/FlyCapture2.h){
    INCLUDEPATH += /usr/include/flycapture
    DEFINES += WITH_CAMERAPOINTGREY
    LIBS += -lflycapture
}
win32:exists("C:/Program Files/Point Grey Research/FlyCapture2/include/FlyCapture2.h"){
    DEFINES += WITH_CAMERAPOINTGREY
    INCLUDEPATH += "C:/Program Files/Point Grey Research/FlyCapture2/include/"
    LIBS += -L"C:/Program Files/Point Grey Research/FlyCapture2/lib64" -lFlyCapture2
}
contains(DEFINES, WITH_CAMERAPOINTGREY) {
    HEADERS += camera/CameraPointGrey.h
    SOURCES += camera/CameraPointGrey.cpp
}

# Compile with rotation stage driver
SOURCES += rotationstage/ArcusPerformaxDriver.c
unix:!macx{
    PKGCONFIG += libusb-1.0
}