Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/protonect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SET(CMAKE_BUILD_TYPE RelWithDebInfo)
SET(MY_DIR ${libfreenect2_SOURCE_DIR})

OPTION(ENABLE_CXX11 "Enable C++11 support" OFF)
OPTION(ENABLE_OPENCL "Enable OpenCL support" ON)

IF(ENABLE_CXX11)
INCLUDE(CheckCXXCompilerFlag)
Expand Down Expand Up @@ -131,7 +132,7 @@ LIST(APPEND RESOURCES
src/shader/stage2.fs
)

IF(OPENCL_FOUND)
IF(ENABLE_OPENCL AND OPENCL_FOUND)
ADD_DEFINITIONS(-DWITH_OPENCL_SUPPORT)
INCLUDE_DIRECTORIES(${OPENCL_INCLUDE_DIRS})

Expand All @@ -146,7 +147,7 @@ IF(OPENCL_FOUND)
LIST(APPEND RESOURCES
src/opencl_depth_packet_processor.cl
)
ENDIF(OPENCL_FOUND)
ENDIF(ENABLE_OPENCL AND OPENCL_FOUND)

GENERATE_RESOURCES(${RESOURCES_INC_FILE} ${MY_DIR} ${RESOURCES})

Expand Down
2 changes: 2 additions & 0 deletions examples/protonect/include/libfreenect2/packet_pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class OpenGLPacketPipeline : public BasePacketPipeline
virtual ~OpenGLPacketPipeline();
};

#ifdef WITH_OPENCL_SUPPORT
class OpenCLPacketPipeline : public BasePacketPipeline
{
protected:
Expand All @@ -98,6 +99,7 @@ class OpenCLPacketPipeline : public BasePacketPipeline
OpenCLPacketPipeline();
virtual ~OpenCLPacketPipeline();
};
#endif // WITH_OPENCL_SUPPORT

typedef OpenGLPacketPipeline DefaultPacketPipeline;

Expand Down
4 changes: 4 additions & 0 deletions examples/protonect/src/packet_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ DepthPacketProcessor *OpenGLPacketPipeline::createDepthPacketProcessor()
return depth_processor;
}


#ifdef WITH_OPENCL_SUPPORT

OpenCLPacketPipeline::OpenCLPacketPipeline()
{
initialize();
Expand All @@ -129,5 +132,6 @@ DepthPacketProcessor *OpenCLPacketPipeline::createDepthPacketProcessor()

return depth_processor;
}
#endif // WITH_OPENCL_SUPPORT

} /* namespace libfreenect2 */