cmake: refactor OpenCL detection, allow custom configurations

This commit is contained in:
Alexander Alekhin
2016-01-15 12:42:22 +03:00
parent 243c513eea
commit c35ddcba1a
4 changed files with 19 additions and 29 deletions

View File

@@ -701,7 +701,6 @@ macro(ocv_glob_module_sources)
)
if(cl_kernels)
set(OCL_NAME opencl_kernels_${name})
ocv_include_directories(${OPENCL_INCLUDE_DIRS})
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.hpp"
COMMAND ${CMAKE_COMMAND} "-DMODULE_NAME=${name}" "-DCL_DIR=${CMAKE_CURRENT_LIST_DIR}/src/opencl" "-DOUTPUT=${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" -P "${OpenCV_SOURCE_DIR}/cmake/cl2cpp.cmake"