Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
c1f2b1fc
Commit
c1f2b1fc
authored
Oct 12, 2012
by
KOLANICH
Committed by
Anatoly Baksheev
Oct 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced python build script with WSH one for windows platforms
parent
cfe28e3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
CMakeLists.txt
modules/ocl/CMakeLists.txt
+9
-1
cl2cpp.js
modules/ocl/cl2cpp.js
+40
-0
No files found.
modules/ocl/CMakeLists.txt
View file @
c1f2b1fc
...
...
@@ -11,11 +11,19 @@ ocv_module_include_directories()
file
(
GLOB CL_FILES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/kernels/*.cl"
)
set
(
kernels_cpp
"
${
CMAKE_CURRENT_BINARY_DIR
}
/kernels.cpp"
)
set
(
cl2cpp_script
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cl2cpp.py"
)
set
(
cl2cpp_script_W32
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cl2cpp.js"
)
add_custom_command
(
IF
(
WIN32
)
add_custom_command
(
OUTPUT
${
kernels_cpp
}
COMMAND wscript.exe
${
cl2cpp_script_W32
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/kernels"
${
kernels_cpp
}
DEPENDS
${
CL_FILES
}
${
cl2cpp_script_W32
}
)
else
()
add_custom_command
(
OUTPUT
${
kernels_cpp
}
COMMAND
${
PYTHON_EXECUTABLE
}
${
cl2cpp_script
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/kernels"
${
kernels_cpp
}
DEPENDS
${
CL_FILES
}
${
cl2cpp_script
}
)
ENDIF
()
file
(
GLOB lib_hdrs
"include/opencv2/
${
name
}
/*.hpp"
"include/opencv2/
${
name
}
/*.h"
)
file
(
GLOB lib_srcs
"src/*.cpp"
)
...
...
modules/ocl/cl2cpp.js
0 → 100644
View file @
c1f2b1fc
var
fso
=
new
ActiveXObject
(
"Scripting.FileSystemObject"
),
shell
=
new
ActiveXObject
(
"WScript.Shell"
),
args
=
WScript
.
Arguments
,
indir
=
args
[
0
],
outname
=
args
[
1
],
outDir
,
scriptFullPath
=
WScript
.
ScriptFullName
;
function
getDir
(
a
)
{
return
a
.
substring
(
0
,
a
.
lastIndexOf
(
"
\
\"
) || a.lastIndexOf("
/
"))
}
if (!indir || !outname) {
var scriptPath = getDir(WScript.ScriptFullName.toString()),
indir = indir || scriptPath + "
/
src
/
kernels
";
outname || (outname = scriptPath + "
/
kernels
.
cpp
", outDir = scriptPath)
} else {
outDir = getDir(outname);
try {
fso.CreateFolder(outDir)
} catch (err) {}
}
var infldr = fso.GetFolder(indir), clrx = /([
\
w-]+)
\
.cl$/i, stripBeginningRx = /^(
\
s)+/i, stripSinglelineMstyle = /
\
/
\
*.*?
\
*
\
//ig, outStream = fso.OpenTextFile(outname, 2, !0, -2);
outStream.write("
// This file is auto-generated. Do not edit!\n\nnamespace cv{\n\tnamespace ocl{\n");
for
(
var
res
,
cl_file
,
l
,
state
,
countFiles
=
0
,
codeRows
=
0
,
removedRows
=
0
,
filei
=
new
Enumerator
(
infldr
.
Files
);
!
filei
.
atEnd
();
filei
.
moveNext
())
if
(
cl_file
=
filei
.
item
(),
res
=
cl_file
.
Name
.
match
(
clrx
))
{
var
cl_filename
=
res
[
1
],
inStream
=
cl_file
.
OpenAsTextStream
(
1
);
outStream
.
writeLine
(
"
\
t
\
tconst char* "
+
cl_filename
+
"="
);
state
=
0
;
for
(
countFiles
++
;
!
inStream
.
AtEndOfStream
;
)
{
l
=
inStream
.
readLine
();
stripSinglelineMstyle
.
lastIndex
=
0
;
l
=
l
.
replace
(
stripSinglelineMstyle
,
""
);
var
mline
=
l
.
indexOf
(
"/*"
);
0
<=
mline
?
(
l
=
l
.
substr
(
0
,
mline
),
state
=
1
)
:
(
mline
=
l
.
indexOf
(
"*/"
),
0
<=
mline
&&
(
l
=
l
.
substr
(
mline
+
2
),
state
=
0
));
var
slineBegin
=
l
.
indexOf
(
"//"
);
0
<=
slineBegin
&&
(
l
=
l
.
substr
(
0
,
slineBegin
));
1
==
state
||
!
l
?
removedRows
++
:
(
l
=
l
.
replace
(
stripBeginningRx
,
"$1"
),
l
=
l
.
replace
(
"
\
\"
, "
\\\\
"), l = l.replace("
\
r
", ""), l = l.replace('"
', '
\\
"'), l = l.replace("
\
t
", "
"), codeRows++, outStream.writeLine('
\
t
\
t
\
t"
' + l + '
\\
n
"'))
}
outStream.writeLine("
\
t
\
t
;
");
inStream.close()
}
outStream.writeLine("
\
t
\
t
}
\
n
\
t
}
");
outStream.close();
shell.Popup("
Merging
OpenCL
Kernels
into
cpp
file
has
been
FINISHED
!
\
nFiles
:
" + countFiles + "
\
nCode
rows
:
" + codeRows + "
\
nRemoved
rows
:
" + removedRows, 1, "
OpenCL
Kernels
to
cpp
file
", 64);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment