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
9ab3b89c
Commit
9ab3b89c
authored
Jul 27, 2014
by
Alexander Mordvintsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass header list to gen2.py by a text file (avoid command line length limit on windows)
parent
42ecfc55
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
25 deletions
+14
-25
CMakeLists.txt
modules/python/CMakeLists.txt
+13
-23
gen2.py
modules/python/src2/gen2.py
+1
-2
No files found.
modules/python/CMakeLists.txt
View file @
9ab3b89c
...
...
@@ -12,18 +12,17 @@ endif()
set
(
the_description
"The python bindings"
)
set
(
candidate_deps
)
set
(
candidate_deps
""
)
foreach
(
mp
${
OPENCV_MODULES_PATH
}
${
OPENCV_EXTRA_MODULES_PATH
}
)
file
(
GLOB names
"
${
mp
}
/*"
)
foreach
(
m IN LISTS names
)
if
(
IS_DIRECTORY
${
m
}
)
get_filename_component
(
m
${
m
}
NAME
)
if
(
NOT
${
m
}
MATCHES
"^cud(a|ev)"
)
list
(
APPEND candidate_deps
"opencv_
${
m
}
"
)
endif
()
list
(
APPEND candidate_deps
"opencv_
${
m
}
"
)
endif
()
endforeach
(
m
)
endforeach
(
mp
)
ocv_list_filterout
(
candidate_deps
"^opencv_cud(a|ev)"
)
ocv_add_module
(
python BINDINGS OPTIONAL
${
candidate_deps
}
)
...
...
@@ -34,27 +33,16 @@ ocv_module_include_directories(
)
set
(
opencv_hdrs_blacklist
".h$"
"opencv2/core/cuda"
"opencv2/objdetect/detection_based_tracker.hpp"
"opencv2/optim.hpp"
)
set
(
opencv_hdrs
)
set
(
opencv_hdrs
""
)
foreach
(
m IN LISTS OPENCV_MODULE_opencv_python_DEPS
)
foreach
(
hdr IN LISTS OPENCV_MODULE_
${
m
}
_HEADERS
)
set
(
good TRUE
)
foreach
(
s IN LISTS opencv_hdrs_blacklist
)
if
(
${
hdr
}
MATCHES
${
s
}
)
set
(
good FALSE
)
endif
()
endforeach
(
s
)
if
(
${
good
}
)
list
(
APPEND opencv_hdrs
${
hdr
}
)
endif
()
endforeach
(
hdr
)
list
(
APPEND opencv_hdrs
${
OPENCV_MODULE_
${
m
}
_HEADERS
}
)
endforeach
(
m
)
ocv_list_filterout
(
opencv_hdrs
".h$"
)
ocv_list_filterout
(
opencv_hdrs
"opencv2/core/cuda"
)
ocv_list_filterout
(
opencv_hdrs
"opencv2/objdetect/detection_based_tracker.hpp"
)
ocv_list_filterout
(
opencv_hdrs
"opencv2/optim.hpp"
)
set
(
cv2_generated_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_include.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_funcs.h"
...
...
@@ -63,11 +51,13 @@ set(cv2_generated_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_type_reg.h"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_const_reg.h"
)
file
(
WRITE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/headers.txt"
"
${
opencv_hdrs
}
"
)
add_custom_command
(
OUTPUT
${
cv2_generated_hdrs
}
COMMAND
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src2/gen2.py"
${
CMAKE_CURRENT_BINARY_DIR
}
${
opencv_hdrs
}
COMMAND
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src2/gen2.py"
${
CMAKE_CURRENT_BINARY_DIR
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/headers.txt"
DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/src2/gen2.py
DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/src2/hdr_parser.py
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/headers.txt
DEPENDS
${
opencv_hdrs
}
)
add_library
(
${
the_module
}
SHARED src2/cv2.cpp
${
cv2_generated_hdrs
}
)
...
...
modules/python/src2/gen2.py
View file @
9ab3b89c
...
...
@@ -831,7 +831,6 @@ class PythonWrapperGenerator(object):
# step 1: scan the headers and build more descriptive maps of classes, consts, functions
for
hdr
in
srcfiles
:
print
(
hdr
)
decls
=
parser
.
parse
(
hdr
)
if
len
(
decls
)
==
0
:
continue
...
...
@@ -904,6 +903,6 @@ if __name__ == "__main__":
if
len
(
sys
.
argv
)
>
1
:
dstdir
=
sys
.
argv
[
1
]
if
len
(
sys
.
argv
)
>
2
:
srcfiles
=
sys
.
argv
[
2
:]
srcfiles
=
open
(
sys
.
argv
[
2
],
'r'
)
.
read
()
.
split
(
';'
)
generator
=
PythonWrapperGenerator
()
generator
.
gen
(
srcfiles
,
dstdir
)
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