Skip to content

Commit 0dd6abd

Browse files
committed
Merge pull request #94 from christiankerl/fix_packet_pipeline_without_opencl
fix compilation without OpenCL support
2 parents 47b77da + d3828e0 commit 0dd6abd

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

examples/protonect/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SET(CMAKE_BUILD_TYPE RelWithDebInfo)
66
SET(MY_DIR ${libfreenect2_SOURCE_DIR})
77

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

1011
IF(ENABLE_CXX11)
1112
INCLUDE(CheckCXXCompilerFlag)
@@ -131,7 +132,7 @@ LIST(APPEND RESOURCES
131132
src/shader/stage2.fs
132133
)
133134

134-
IF(OPENCL_FOUND)
135+
IF(ENABLE_OPENCL AND OPENCL_FOUND)
135136
ADD_DEFINITIONS(-DWITH_OPENCL_SUPPORT)
136137
INCLUDE_DIRECTORIES(${OPENCL_INCLUDE_DIRS})
137138

@@ -146,7 +147,7 @@ IF(OPENCL_FOUND)
146147
LIST(APPEND RESOURCES
147148
src/opencl_depth_packet_processor.cl
148149
)
149-
ENDIF(OPENCL_FOUND)
150+
ENDIF(ENABLE_OPENCL AND OPENCL_FOUND)
150151

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

examples/protonect/include/libfreenect2/packet_pipeline.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class OpenGLPacketPipeline : public BasePacketPipeline
9090
virtual ~OpenGLPacketPipeline();
9191
};
9292

93+
#ifdef WITH_OPENCL_SUPPORT
9394
class OpenCLPacketPipeline : public BasePacketPipeline
9495
{
9596
protected:
@@ -98,6 +99,7 @@ class OpenCLPacketPipeline : public BasePacketPipeline
9899
OpenCLPacketPipeline();
99100
virtual ~OpenCLPacketPipeline();
100101
};
102+
#endif // WITH_OPENCL_SUPPORT
101103

102104
typedef OpenGLPacketPipeline DefaultPacketPipeline;
103105

examples/protonect/src/packet_pipeline.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ DepthPacketProcessor *OpenGLPacketPipeline::createDepthPacketProcessor()
113113
return depth_processor;
114114
}
115115

116+
117+
#ifdef WITH_OPENCL_SUPPORT
118+
116119
OpenCLPacketPipeline::OpenCLPacketPipeline()
117120
{
118121
initialize();
@@ -129,5 +132,6 @@ DepthPacketProcessor *OpenCLPacketPipeline::createDepthPacketProcessor()
129132

130133
return depth_processor;
131134
}
135+
#endif // WITH_OPENCL_SUPPORT
132136

133137
} /* namespace libfreenect2 */

0 commit comments

Comments
 (0)