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
009aec51
Commit
009aec51
authored
Dec 15, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3491 from mshabunin:ios-extra-world
parents
3c74c23b
c28fea32
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
16 deletions
+54
-16
OpenCVGenInfoPlist.cmake
cmake/OpenCVGenInfoPlist.cmake
+8
-0
OpenCVModule.cmake
cmake/OpenCVModule.cmake
+6
-1
cl2cpp.cmake
cmake/cl2cpp.cmake
+1
-0
CMakeLists.txt
modules/world/CMakeLists.txt
+3
-3
Info.plist.in
platforms/ios/Info.plist.in
+2
-2
build_framework.py
platforms/ios/build_framework.py
+32
-8
Info.plist.in
platforms/osx/Info.plist.in
+2
-2
No files found.
cmake/OpenCVGenInfoPlist.cmake
View file @
009aec51
if
(
OPENCV_EXTRA_WORLD
)
set
(
OPENCV_APPLE_BUNDLE_NAME
"OpenCV_contrib"
)
set
(
OPENCV_APPLE_BUNDLE_ID
"org.opencv_contrib"
)
else
()
set
(
OPENCV_APPLE_BUNDLE_NAME
"OpenCV"
)
set
(
OPENCV_APPLE_BUNDLE_ID
"org.opencv"
)
endif
()
if
(
IOS
)
configure_file
(
"
${
OpenCV_SOURCE_DIR
}
/platforms/ios/Info.plist.in"
"
${
CMAKE_BINARY_DIR
}
/ios/Info.plist"
)
...
...
cmake/OpenCVModule.cmake
View file @
009aec51
...
...
@@ -159,8 +159,13 @@ macro(ocv_add_module _name)
endif
()
# add self to the world dependencies
# add to world only extra modules (ON) or only main modules (OFF)
set
(
__expected_extra 0
)
if
(
OPENCV_EXTRA_WORLD
)
set
(
__expected_extra 1
)
endif
()
if
((
NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD AND NOT OPENCV_MODULE_
${
the_module
}
_CLASS STREQUAL
"BINDINGS"
AND
NOT
OPENCV_PROCESSING_EXTRA_MODULES
)
AND
__expected_extra EQUAL
OPENCV_PROCESSING_EXTRA_MODULES
)
OR OPENCV_MODULE_IS_PART_OF_WORLD
)
set
(
OPENCV_MODULE_
${
the_module
}
_IS_PART_OF_WORLD ON CACHE INTERNAL
""
)
...
...
cmake/cl2cpp.cmake
View file @
009aec51
...
...
@@ -28,6 +28,7 @@ ${nested_namespace_start}
set
(
STR_HPP
"// This file is auto-generated. Do not edit!
#include
\"
opencv2/core/ocl.hpp
\"
#include
\"
opencv2/core/ocl_genbase.hpp
\"
#include
\"
opencv2/core/opencl/ocl_defs.hpp
\"
...
...
modules/world/CMakeLists.txt
View file @
009aec51
...
...
@@ -44,13 +44,13 @@ ocv_module_include_directories()
#message(STATUS "${OPENCV_MODULE_${the_module}_SOURCES}")
ocv_create_module
(
${
link_deps
}
)
if
(
BUILD_opencv_imgcodecs
)
if
(
BUILD_opencv_imgcodecs
AND OPENCV_MODULE_opencv_imgcodecs_IS_PART_OF_WORLD
)
ocv_imgcodecs_configure_target
()
endif
()
if
(
BUILD_opencv_videoio
)
if
(
BUILD_opencv_videoio
AND OPENCV_MODULE_opencv_videoio_IS_PART_OF_WORLD
)
ocv_videoio_configure_target
()
endif
()
if
(
BUILD_opencv_highgui
)
if
(
BUILD_opencv_highgui
AND OPENCV_MODULE_opencv_highgui_IS_PART_OF_WORLD
)
ocv_highgui_configure_target
()
endif
()
...
...
platforms/ios/Info.plist.in
View file @
009aec51
...
...
@@ -3,9 +3,9 @@
<plist
version=
"1.0"
>
<dict>
<key>
CFBundleName
</key>
<string>
OpenCV
</string>
<string>
${OPENCV_APPLE_BUNDLE_NAME}
</string>
<key>
CFBundleIdentifier
</key>
<string>
org.opencv
</string>
<string>
${OPENCV_APPLE_BUNDLE_ID}
</string>
<key>
CFBundleVersion
</key>
<string>
${OPENCV_LIBVERSION}
</string>
<key>
CFBundleShortVersionString
</key>
...
...
platforms/ios/build_framework.py
View file @
009aec51
...
...
@@ -25,7 +25,9 @@ The script should handle minor OpenCV updates efficiently
However, opencv2.framework directory is erased and recreated on each run.
"""
import
glob
,
re
,
os
,
os
.
path
,
shutil
,
string
,
sys
,
exceptions
,
subprocess
import
glob
,
re
,
os
,
os
.
path
,
shutil
,
string
,
sys
,
exceptions
,
subprocess
,
argparse
opencv_contrib_path
=
None
def
execute
(
cmd
):
try
:
...
...
@@ -57,6 +59,9 @@ def build_opencv(srcroot, buildroot, target, arch):
if
arch
.
startswith
(
"armv"
):
cmakeargs
+=
" -DENABLE_NEON=ON"
if
opencv_contrib_path
is
not
None
:
cmakeargs
+=
" -DOPENCV_EXTRA_MODULES_PATH=
%
s -DOPENCV_EXTRA_WORLD=ON"
%
opencv_contrib_path
# if cmake cache exists, just rerun cmake to update OpenCV.xcodeproj if necessary
if
os
.
path
.
isfile
(
os
.
path
.
join
(
builddir
,
"CMakeCache.txt"
)):
execute
(
"cmake
%
s ."
%
(
cmakeargs
,))
...
...
@@ -75,13 +80,15 @@ def build_opencv(srcroot, buildroot, target, arch):
def
put_framework_together
(
srcroot
,
dstroot
):
"constructs the framework directory after all the targets are built"
name
=
"opencv2"
if
opencv_contrib_path
is
None
else
"opencv2_contrib"
# find the list of targets (basically, ["iPhoneOS", "iPhoneSimulator"])
targetlist
=
glob
.
glob
(
os
.
path
.
join
(
dstroot
,
"build"
,
"*"
))
targetlist
=
[
os
.
path
.
basename
(
t
)
for
t
in
targetlist
]
# set the current dir to the dst root
currdir
=
os
.
getcwd
()
framework_dir
=
dstroot
+
"/
opencv2.framework"
framework_dir
=
dstroot
+
"/
%
s.framework"
%
name
if
os
.
path
.
isdir
(
framework_dir
):
shutil
.
rmtree
(
framework_dir
)
os
.
makedirs
(
framework_dir
)
...
...
@@ -97,7 +104,7 @@ def put_framework_together(srcroot, dstroot):
# make universal static lib
wlist
=
" "
.
join
([
"../build/"
+
t
+
"/lib/Release/libopencv_world.a"
for
t
in
targetlist
])
execute
(
"lipo -create "
+
wlist
+
" -o "
+
dstdir
+
"/
opencv2"
)
execute
(
"lipo -create "
+
wlist
+
" -o "
+
dstdir
+
"/
%
s"
%
name
)
# copy Info.plist
shutil
.
copyfile
(
tdir0
+
"/ios/Info.plist"
,
dstdir
+
"/Resources/Info.plist"
)
...
...
@@ -106,7 +113,7 @@ def put_framework_together(srcroot, dstroot):
os
.
symlink
(
"A"
,
"Versions/Current"
)
os
.
symlink
(
"Versions/Current/Headers"
,
"Headers"
)
os
.
symlink
(
"Versions/Current/Resources"
,
"Resources"
)
os
.
symlink
(
"Versions/Current/
opencv2"
,
"opencv2"
)
os
.
symlink
(
"Versions/Current/
%
s"
%
name
,
name
)
def
build_framework
(
srcroot
,
dstroot
):
...
...
@@ -124,12 +131,29 @@ def build_framework(srcroot, dstroot):
if
__name__
==
"__main__"
:
if
len
(
sys
.
argv
)
!=
2
:
print
"Usage:
\n\t
./build_framework.py <outputdir>
\n\n
"
sys
.
exit
(
0
)
parser
=
argparse
.
ArgumentParser
(
description
=
'The script builds OpenCV.framework for iOS.'
)
parser
.
add_argument
(
'outputdir'
,
nargs
=
1
,
help
=
'folder to put built framework'
)
parser
.
add_argument
(
'--contrib'
,
help
=
"folder with opencv_contrib repository"
)
args
=
parser
.
parse_args
()
# path to OpenCV main repository - hardcoded ../..
opencv_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
"../.."
))
print
"OpenCV:"
,
opencv_path
# path to OpenCV_contrib repository, can be empty - global variable
if
hasattr
(
args
,
"contrib"
)
and
args
.
contrib
is
not
None
:
if
os
.
path
.
isdir
(
args
.
contrib
+
"/modules"
):
opencv_contrib_path
=
os
.
path
.
abspath
(
args
.
contrib
+
"/modules"
)
print
"Contrib:"
,
opencv_contrib_path
else
:
print
"Note: contrib repository is bad: modules subfolder not found"
# result path - folder where framework will be located
output_path
=
os
.
path
.
abspath
(
args
.
outputdir
[
0
])
print
"Output:"
,
output_path
try
:
build_framework
(
o
s
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
"../.."
)),
os
.
path
.
abspath
(
sys
.
argv
[
1
])
)
build_framework
(
o
pencv_path
,
output_path
)
except
Exception
as
e
:
print
>>
sys
.
stderr
,
e
sys
.
exit
(
1
)
platforms/osx/Info.plist.in
View file @
009aec51
...
...
@@ -3,9 +3,9 @@
<plist
version=
"1.0"
>
<dict>
<key>
CFBundleName
</key>
<string>
OpenCV
</string>
<string>
${OPENCV_APPLE_BUNDLE_NAME}
</string>
<key>
CFBundleIdentifier
</key>
<string>
org.opencv
</string>
<string>
${OPENCV_APPLE_BUNDLE_ID}
</string>
<key>
CFBundleVersion
</key>
<string>
${OPENCV_LIBVERSION}
</string>
<key>
CFBundleShortVersionString
</key>
...
...
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