@@ -14,18 +14,16 @@ ENDIF()
1414PROJECT (libfreenect2_tools_SR)
1515
1616SET (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" )
1818
1919OPTION (ENABLE_OPENGL "Enable OpenGL support" ON )
2020
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.
2222SET (freenect2_ROOT_DIR ${MY_DIR} /../..)
2323SET (flextGL_SOURCES ${freenect2_ROOT_DIR} /src/flextGL.cpp)
2424SET (flextGL_INCLUDE_DIRS ${freenect2_ROOT_DIR} /src) # for flextGL.h
25- SET (tools_SR_INCLUDE_DIRS ${MY_DIR} /include ) # for local include
2625SET (example_INCLUDE_DIRS ${freenect2_ROOT_DIR} /examples) # for protonect viewer
2726
28-
2927FIND_PACKAGE (PkgConfig) # try find PKGConfig as it will be used if found
3028LIST (APPEND CMAKE_MODULE_PATH ${freenect2_ROOT_DIR} /cmake_modules) # FindGLFW3.cmake
3129
@@ -40,10 +38,15 @@ ENDIF()
4038
4139INCLUDE_DIRECTORIES (
4240 ${freenect2_INCLUDE_DIR}
41+ ${example_INCLUDE_DIRS}
42+ ${MY_DIR} /include
4343)
4444
4545SET (ProtonectSR_src
4646 ProtonectSR.cpp
47+ PracticalSocket.cpp
48+ streamer.cpp
49+ recorder.cpp
4750)
4851
4952SET (ProtonectSR_LIBRARIES
@@ -54,23 +57,29 @@ SET(ProtonectSR_DLLS
5457 ${freenect2_DLLS}
5558)
5659
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+
5771IF (ENABLE_OPENGL)
5872 FIND_PACKAGE (GLFW3)
5973 FIND_PACKAGE (OpenGL)
6074 IF (GLFW3_FOUND AND OPENGL_FOUND)
6175 INCLUDE_DIRECTORIES (
6276 ${GLFW3_INCLUDE_DIRS}
6377 ${flextGL_INCLUDE_DIRS}
64- ${tools_SR_INCLUDE_DIRS}
65- ${example_INCLUDE_DIRS}
6678 )
6779
6880 LIST (APPEND ProtonectSR_DLLS ${GLFW3_DLL} )
6981 LIST (APPEND ProtonectSR_src
7082 ${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
7483 ${flextGL_SOURCES}
7584 )
7685 LIST (APPEND ProtonectSR_LIBRARIES
@@ -89,6 +98,16 @@ TARGET_LINK_LIBRARIES(ProtonectSR
8998 ${ProtonectSR_LIBRARIES}
9099)
91100
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+
92111IF (WIN32 )
93112 INSTALL (TARGETS ProtonectSR DESTINATION bin)
94113 LIST (REMOVE_DUPLICATES ProtonectSR_DLLS)
@@ -99,7 +118,3 @@ IF(WIN32)
99118 ENDFOREACH (FILEI)
100119 INSTALL (FILES ${ProtonectSR_DLLS} DESTINATION bin)
101120ENDIF ()
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