Tmp3/pibot_ros/third_party/libfreenect2/cmake_modules/CheckOpenCLICDLoader.cmake

22 lines
535 B
CMake
Raw Normal View History

2024-03-04 18:55:37 +08:00
INCLUDE(CheckCXXSourceCompiles)
INCLUDE(CheckCSourceCompiles)
SET(CMAKE_REQUIRED_INCLUDES "${MY_DIR}/include/internal" ${OpenCL_INCLUDE_DIRS})
SET(CMAKE_REQUIRED_LIBRARIES ${OpenCL_LIBRARIES})
CHECK_C_SOURCE_COMPILES("
#include <CL/cl.h>
int main() {
clGetPlatformIDs(0, 0, 0);
return 0;
}" OpenCL_C_WORKS)
CHECK_CXX_SOURCE_COMPILES("
#include <CL/cl.hpp>
int main() {
cl::Context context;
cl::Platform platform;
cl::Device device;
return 0;
}" OpenCL_CXX_WORKS)
SET(CMAKE_REQUIRED_INCLUDES)
SET(CMAKE_REQUIRED_LIBRARIES)