updated patch to bring in the first functions with "transparent API"
This commit is contained in:
@@ -4,6 +4,15 @@ list(SORT cl_list)
|
||||
string(REPLACE ".cpp" ".hpp" OUTPUT_HPP "${OUTPUT}")
|
||||
get_filename_component(OUTPUT_HPP_NAME "${OUTPUT_HPP}" NAME)
|
||||
|
||||
if("${MODULE_NAME}" STREQUAL "ocl")
|
||||
set(nested_namespace_start "")
|
||||
set(nested_namespace_end "")
|
||||
else()
|
||||
set(new_mode ON)
|
||||
set(nested_namespace_start "namespace ${MODULE_NAME}\n{")
|
||||
set(nested_namespace_end "}")
|
||||
endif()
|
||||
|
||||
set(STR_CPP "// This file is auto-generated. Do not edit!
|
||||
|
||||
#include \"precomp.hpp\"
|
||||
@@ -13,16 +22,19 @@ namespace cv
|
||||
{
|
||||
namespace ocl
|
||||
{
|
||||
${nested_namespace_start}
|
||||
|
||||
")
|
||||
|
||||
set(STR_HPP "// This file is auto-generated. Do not edit!
|
||||
|
||||
#include \"opencv2/ocl/private/util.hpp\"
|
||||
#include \"opencv2/core/ocl_genbase.hpp\"
|
||||
|
||||
namespace cv
|
||||
{
|
||||
namespace ocl
|
||||
{
|
||||
${nested_namespace_start}
|
||||
|
||||
")
|
||||
|
||||
@@ -49,12 +61,19 @@ foreach(cl ${cl_list})
|
||||
|
||||
string(MD5 hash "${lines}")
|
||||
|
||||
set(STR_CPP "${STR_CPP}const struct ProgramEntry ${cl_filename}={\"${cl_filename}\",\n\"${lines}, \"${hash}\"};\n")
|
||||
set(STR_HPP "${STR_HPP}extern const struct ProgramEntry ${cl_filename};\n")
|
||||
set(STR_CPP_DECL "const struct ProgramEntry ${cl_filename}={\"${cl_filename}\",\n\"${lines}, \"${hash}\"};\n")
|
||||
set(STR_HPP_DECL "extern const struct ProgramEntry ${cl_filename};\n")
|
||||
if(new_mode)
|
||||
set(STR_CPP_DECL "${STR_CPP_DECL}ProgramSource2 ${cl_filename}_oclsrc(${cl_filename}.programStr);\n")
|
||||
set(STR_HPP_DECL "${STR_HPP_DECL}extern ProgramSource2 ${cl_filename}_oclsrc;\n")
|
||||
endif()
|
||||
|
||||
set(STR_CPP "${STR_CPP}${STR_CPP_DECL}")
|
||||
set(STR_HPP "${STR_HPP}${STR_HPP_DECL}")
|
||||
endforeach()
|
||||
|
||||
set(STR_CPP "${STR_CPP}}\n}\n")
|
||||
set(STR_HPP "${STR_HPP}}\n}\n")
|
||||
set(STR_CPP "${STR_CPP}}\n${nested_namespace_end}}\n")
|
||||
set(STR_HPP "${STR_HPP}}\n${nested_namespace_end}}\n")
|
||||
|
||||
file(WRITE "${OUTPUT}" "${STR_CPP}")
|
||||
|
||||
|
Reference in New Issue
Block a user