@@ -14,18 +14,16 @@ ENDIF()
14
14
PROJECT (libfreenect2_tools_SR)
15
15
16
16
SET (MY_DIR ${libfreenect2_tools_SR_SOURCE_DIR} )
17
- SET (DEPENDS_DIR "${MY_DIR} /../../depends" CACHE STRING "Dependency directory" )
17
+ SET (DEPENDS_DIR "${MY_DIR} /../../../ depends" CACHE STRING "Dependency directory" )
18
18
19
19
OPTION (ENABLE_OPENGL "Enable OpenGL support" ON )
20
20
21
- # The example build system is standalone and will work out-of-tree with these files copied
21
+ # The build system could be standalone if these files are copied instead of being referenced here.
22
22
SET (freenect2_ROOT_DIR ${MY_DIR} /../..)
23
23
SET (flextGL_SOURCES ${freenect2_ROOT_DIR} /src/flextGL.cpp)
24
24
SET (flextGL_INCLUDE_DIRS ${freenect2_ROOT_DIR} /src) # for flextGL.h
25
- SET (tools_SR_INCLUDE_DIRS ${MY_DIR} /include ) # for local include
26
25
SET (example_INCLUDE_DIRS ${freenect2_ROOT_DIR} /examples) # for protonect viewer
27
26
28
-
29
27
FIND_PACKAGE (PkgConfig) # try find PKGConfig as it will be used if found
30
28
LIST (APPEND CMAKE_MODULE_PATH ${freenect2_ROOT_DIR} /cmake_modules) # FindGLFW3.cmake
31
29
@@ -40,10 +38,15 @@ ENDIF()
40
38
41
39
INCLUDE_DIRECTORIES (
42
40
${freenect2_INCLUDE_DIR}
41
+ ${example_INCLUDE_DIRS}
42
+ ${MY_DIR} /include
43
43
)
44
44
45
45
SET (ProtonectSR_src
46
46
ProtonectSR.cpp
47
+ PracticalSocket.cpp
48
+ streamer.cpp
49
+ recorder.cpp
47
50
)
48
51
49
52
SET (ProtonectSR_LIBRARIES
@@ -54,23 +57,29 @@ SET(ProtonectSR_DLLS
54
57
${freenect2_DLLS}
55
58
)
56
59
60
+ # Add OpenCV package dependency for udp-image-streaming
61
+ FIND_PACKAGE (OpenCV REQUIRED)
62
+ INCLUDE_DIRECTORIES (${OpenCV_INCLUDE_DIRS} )
63
+ LIST (APPEND ProtonectSR_LIBRARIES
64
+ ${OpenCV_LIBS}
65
+ )
66
+ # OpenCV requires exception.
67
+ IF (UNIX AND NOT APPLE )
68
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" )
69
+ ENDIF ()
70
+
57
71
IF (ENABLE_OPENGL)
58
72
FIND_PACKAGE (GLFW3)
59
73
FIND_PACKAGE (OpenGL)
60
74
IF (GLFW3_FOUND AND OPENGL_FOUND)
61
75
INCLUDE_DIRECTORIES (
62
76
${GLFW3_INCLUDE_DIRS}
63
77
${flextGL_INCLUDE_DIRS}
64
- ${tools_SR_INCLUDE_DIRS}
65
- ${example_INCLUDE_DIRS}
66
78
)
67
79
68
80
LIST (APPEND ProtonectSR_DLLS ${GLFW3_DLL} )
69
81
LIST (APPEND ProtonectSR_src
70
82
${example_INCLUDE_DIRS} /viewer.cpp
71
- ${tools_SR_INCLUDE_DIRS} /PracticalSocket.cpp
72
- ${tools_SR_INCLUDE_DIRS} /streamer.cpp
73
- ${tools_SR_INCLUDE_DIRS} /recorder.cpp
74
83
${flextGL_SOURCES}
75
84
)
76
85
LIST (APPEND ProtonectSR_LIBRARIES
@@ -89,6 +98,16 @@ TARGET_LINK_LIBRARIES(ProtonectSR
89
98
${ProtonectSR_LIBRARIES}
90
99
)
91
100
101
+ if (EXISTS ProtonectSR)
102
+ configure_file (build /ProtonectSR freenect2-record COPYONLY )
103
+ configure_file (build /ProtonectSR freenect2-replay COPYONLY )
104
+ configure_file (build /ProtonectSR freenect2-stream COPYONLY )
105
+ endif ()
106
+
107
+ file (MAKE_DIRECTORY build /recordings)
108
+ file (MAKE_DIRECTORY build /recordings/depth)
109
+ file (MAKE_DIRECTORY build /recordings/regist)
110
+
92
111
IF (WIN32 )
93
112
INSTALL (TARGETS ProtonectSR DESTINATION bin)
94
113
LIST (REMOVE_DUPLICATES ProtonectSR_DLLS)
@@ -99,7 +118,3 @@ IF(WIN32)
99
118
ENDFOREACH (FILEI)
100
119
INSTALL (FILES ${ProtonectSR_DLLS} DESTINATION bin)
101
120
ENDIF ()
102
-
103
- # Add OpenCV package dependency for udp-image-streaming
104
- find_package ( OpenCV REQUIRED )
105
- target_link_libraries ( ProtonectSR ${OpenCV_LIBS} )
0 commit comments