1
2
3
4
5
6
7
8
9
10
11
12
13
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
PROJECT(CppSampleQt01)

FIND_PACKAGE(PCL 1.3 REQUIRED)
FIND_PACKAGE(Qt4 4.8.2 REQUIRED)

FIND_LIBRARY(SIMPLONLIB lv.simplon lib)
FIND_LIBRARY(SIMPLONIMGPROC lv.simplon.imgproc lib)

SET(CppSampleQt01_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/include/lv.simplon.class.cpp camera.cpp main.cpp mainwindow.cpp osdep.cpp paint.cpp)
SET(CppSampleQt01_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/lv.simplon.class.h camera.h mainwindow.h osdep.h paint.h)
SET(CppSampleQt01_RESOURCES icons.qrc)

SET(QExtSerialPort_HEADERS QExtSerialPort/src/qextwineventnotifier_p.h 
            QExtSerialPort/src/qextserialport_p.h 
            QExtSerialPort/src/qextserialport_global.h 
            QExtSerialPort/src/qextserialport.h 
            QExtSerialPort/src/qextserialenumerator_p.h 
            QExtSerialPort/src/qextserialenumerator.h)
SET(QExtSerialPort_SOURCES QExtSerialPort/src/qextserialenumerator.cpp
          QExtSerialPort/src/qextserialport.cpp
          QExtSerialPort/src/qextwineventnotifier_p.cpp)
          
if (WIN32)
  #Check syntax for this. QExt... may need to be wrapped in parentheses. 
  LIST(APPEND QExtSerialPort_SOURCES QExtSerialPort/src/qextserialport_win.cpp) 
  #SET(QExtSerialPort_SOURCES ${QExtSerialPort_SOURCES} QExtSerialPort/src/qextserialport_win.cpp)
  #  add_definitions(-DWINVER=0x0501) # needed for mingw (dbt business??
  LINK_LIBRARIES(${QT_QTGUI_LIBRARY} setupapi advapi32 user32)
endif(WIN32)

if (UNIX)
  LIST(APPEND QExtSerialPort_SOURCES QExtSerialPort/src/qextserialport_unix.cpp)
endif (UNIX)

if (OSX)
  LINK_LIBRARIES(framework IOKit)
  LIST(APPEND QExtSerialPort_SOURCES QExtSerialPort/src/qextserialport_osx.cpp)
endif (OSX)

QT4_WRAP_CPP(CppSampleQt01_HEADERS_MOC ${CppSampleQt01_HEADERS} ${QExtSerialPort_HEADERS})
  
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})

INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${PCL_DEFINITIONS} ${QT_DEFINITIONS})

LINK_DIRECTORIES(${PCL_LIBRARY_DIRS})

INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include QExtSerialPort/src )
ADD_EXECUTABLE(CppSampleQt01 ${CppSampleQt01_SOURCES}
        ${QExtSerialPort_SOURCES}
        ${CppSampleQt01_HEADERS_MOC}
        ${CppSampleQt01_RESOURCES_RCC})

TARGET_LINK_LIBRARIES(CppSampleQt01 ${PCL_LIBRARIES} ${SIMPLONLIB} ${SIMPLONIMGPROC} QVTK)