mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
Merge pull request #4114 from alalek:ocl_generator_error_processing
This commit is contained in:
commit
220bb14d10
@ -662,7 +662,7 @@ macro(ocv_glob_module_sources)
|
||||
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"
|
||||
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"
|
||||
DEPENDS ${cl_kernels} "${OpenCV_SOURCE_DIR}/cmake/cl2cpp.cmake")
|
||||
ocv_source_group("Src\\opencl\\kernels" FILES ${cl_kernels})
|
||||
ocv_source_group("Src\\opencl\\kernels\\autogenerated" FILES "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.hpp")
|
||||
|
@ -1,6 +1,14 @@
|
||||
if (NOT EXISTS "${CL_DIR}")
|
||||
message(FATAL_ERROR "Specified wrong OpenCL kernels directory: ${CL_DIR}")
|
||||
endif()
|
||||
|
||||
file(GLOB cl_list "${CL_DIR}/*.cl" )
|
||||
list(SORT cl_list)
|
||||
|
||||
if (NOT cl_list)
|
||||
message(FATAL_ERROR "Can't find OpenCL kernels in directory: ${CL_DIR}")
|
||||
endif()
|
||||
|
||||
string(REPLACE ".cpp" ".hpp" OUTPUT_HPP "${OUTPUT}")
|
||||
get_filename_component(OUTPUT_HPP_NAME "${OUTPUT_HPP}" NAME)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user