ocl: move program names into opencl_kernels.hpp

This commit is contained in:
Alexander Alekhin
2013-09-27 16:41:25 +04:00
parent e8d9ed8955
commit b00f79ac5f
35 changed files with 154 additions and 428 deletions

View File

@@ -1,6 +1,20 @@
file(GLOB cl_list "${CL_DIR}/*.cl" )
list(SORT cl_list)
file(WRITE ${OUTPUT} "// This file is auto-generated. Do not edit!
string(REPLACE ".cpp" ".hpp" OUTPUT_HPP "${OUTPUT}")
get_filename_component(OUTPUT_HPP_NAME "${OUTPUT_HPP}" NAME)
set(STR_CPP "// This file is auto-generated. Do not edit!
#include \"${OUTPUT_HPP_NAME}\"
namespace cv
{
namespace ocl
{
")
set(STR_HPP "// This file is auto-generated. Do not edit!
namespace cv
{
@@ -29,7 +43,12 @@ foreach(cl ${cl_list})
string(REGEX REPLACE "\"$" "" lines "${lines}") # unneeded " at the eof
file(APPEND ${OUTPUT} "const char* ${cl_filename}=\"${lines};\n")
set(STR_CPP "${STR_CPP}const char* ${cl_filename}=\"${lines};\n")
set(STR_HPP "${STR_HPP}extern const char* ${cl_filename};\n")
endforeach()
file(APPEND ${OUTPUT} "}\n}\n")
set(STR_CPP "${STR_CPP}}\n}\n")
set(STR_HPP "${STR_HPP}}\n}\n")
file(WRITE ${OUTPUT} "${STR_CPP}")
file(WRITE ${OUTPUT_HPP} "${STR_HPP}")