-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
85 lines (70 loc) · 4 KB
/
CMakeLists.txt
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required (VERSION 2.8.10)
project (VirtualTouchScreen)
set (CMAKE_PREFIX_PATH "D:/Qt/Qt5.1.0/5.1.0/msvc2012")
SET (PCSDK_DIR "D:/Program Files (x86)/Intel/PCSDK")
SET (OpenCV_DIR "D:/opencv/build")
find_package (Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package (OpenCV REQUIRED core video)
include_directories (${CMAKE_SOURCE_DIR}
${QT_QTDECLARATIVE_INCLUDE_DIR}
${PCSDK_DIR}/sample/common/include
${PCSDK_DIR}/include
${OpenCV_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
qt5_wrap_ui(UIS_HDRS configuration.ui)
set (VirtualTouchScreen_HDRS VirtualTouchScreen.h GestureThread.h TouchInputEmulator.h ConfigDialog.h)
set (VirtualTouchScreen_SRCS VirtualTouchScreen.cpp GestureThread.cpp GestureAlgos.cpp
TouchInputEmulator.cpp ConfigDialog.cpp main.cpp VirtualTouchScreen.rc)
set (VirtualTouchScreen_RSC icons.qrc)
QT5_ADD_RESOURCES (RSCS ${VirtualTouchScreen_RSC})
IF (CMAKE_BUILD_TYPE MATCHES "[Rr]elease")
SET (PCSDK_LIBS "libpxc.lib;libpxcutils.lib")
ELSE()
SET (PCSDK_LIBS "libpxc_d.lib;libpxcutils_d.lib")
ENDIF()
LINK_DIRECTORIES(${PCSDK_DIR}/lib/Win32/;${PCSDK_DIR}/sample/common/lib/Win32/v110/)
add_executable (${CMAKE_PROJECT_NAME} WIN32 ${VirtualTouchScreen_SRCS}
${RSCS} ${UIS_HDRS})
target_link_libraries (${CMAKE_PROJECT_NAME} Qt5::WinMain ${PCSDK_LIBS} ${OpenCV_LIBS})
qt5_use_modules (${CMAKE_PROJECT_NAME} Widgets)
#add unit tests
ADD_SUBDIRECTORY(tests)
install(TARGETS VirtualTouchScreen RUNTIME DESTINATION .)
install(FILES ${CMAKE_SOURCE_DIR}/icons/VirtualTouchScreen.ico DESTINATION .)
install(FILES ${CMAKE_SOURCE_DIR}/README.md DESTINATION .)
set(OPENCV_DLLS "opencv_video246.dll;opencv_core246.dll;opencv_imgproc246.dll")
foreach(line ${OPENCV_DLLS})
install(FILES ${OpenCV_DIR}/x86/vc11/bin/${line} DESTINATION .)
endforeach()
set(QT5_DLLS "Qt5Widgets.dll;Qt5Gui.dll;Qt5Core.dll;libGLESv2.dll;icuin51.dll;icuuc51.dll;icudt51.dll;libegl.dll")
foreach(line ${QT5_DLLS})
install(FILES ${CMAKE_PREFIX_PATH}/bin/${line} DESTINATION .)
endforeach()
install(FILES ${CMAKE_PREFIX_PATH}/plugins/platforms/qwindows.dll DESTINATION platforms)
install(FILES ${CMAKE_PREFIX_PATH}/plugins/imageformats/qjpeg.dll DESTINATION imageformats)
SET(MSVC_DLLS "msvcp110.dll;msvcr110.dll")
foreach(line ${MSVC_DLLS})
install(FILES "C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/redist/x86/Microsoft.VC110.CRT/${line}" DESTINATION .)
endforeach()
INSTALL (FILES "D:/Users/b/Documents/C++/DepthSenseSDK-1.2.1.840-win32-VS2010-Release-redist_signed.exe" DESTINATION runtime)
INSTALL (FILES "${PCSDK_DIR}/runtime/intel_pc_sdk_runtime_ia32_9302.msi" DESTINATION runtime)
#setup installers
set(CPACK_PACKAGE_NAME "VirtualTouchScreen")
set(CPACK_PACKAGE_VENDOR "Bogdan Cristea")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "uses gesture camera in order to implement a virtual touch screen")
set(CPACK_PACKAGE_VERSION "1.0")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/Copyright.txt)
set(CPACK_GENERATOR "NSIS")
set(CPACK_NSIS_CONTACT "Bogdan Cristea <cristeab\@gmail.com>")
set(CPACK_NSIS_INSTALLED_ICON_NAME "VirtualTouchScreen.exe")
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/icons/VirtualTouchScreen.ico")
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/icons/VirtualTouchScreen.ico")
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\runtime\\\\DepthSenseSDK-1.2.1.840-win32-VS2010-Release-redist_signed.exe\\\"'
ExecWait 'msiexec /i \\\"$INSTDIR\\\\runtime\\\\intel_pc_sdk_runtime_ia32_9302.msi\\\"'
CreateShortCut \\\"$DESKTOP\\\\VirtualTouchScreen.lnk\\\" \\\"$INSTDIR\\\\VirtualTouchScreen.exe\\\" \\\"\\\" \\\"$INSTDIR\\\\VirtualTouchScreen.ico\\\"
CreateShortCut \\\"$SMPROGRAMS\\\\VirtualTouchScreen.lnk\\\" \\\"$INSTDIR\\\\VirtualTouchScreen.exe\\\" \\\"\\\" \\\"$INSTDIR\\\\VirtualTouchScreen.ico\\\"")
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete \\\"$DESKTOP\\\\VirtualTouchScreen.lnk\\\"
Delete \\\"$SMPROGRAMS\\\\VirtualTouchScreen.lnk\\\"")
include(CPack)