Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
92ead5fa
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
92ead5fa
编写于
7月 01, 2014
作者:
I
Ievgen Khvedchenia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix cmake to build OpenCV framework on OSX
上级
3f485d58
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
148 addition
and
3 deletion
+148
-3
3rdparty/libjpeg/CMakeLists.txt
3rdparty/libjpeg/CMakeLists.txt
+1
-1
cmake/OpenCVGenInfoPlist.cmake
cmake/OpenCVGenInfoPlist.cmake
+3
-0
modules/world/CMakeLists.txt
modules/world/CMakeLists.txt
+2
-2
platforms/osx/Info.plist.in
platforms/osx/Info.plist.in
+18
-0
platforms/osx/build_framework.py
platforms/osx/build_framework.py
+124
-0
未找到文件。
3rdparty/libjpeg/CMakeLists.txt
浏览文件 @
92ead5fa
...
...
@@ -9,7 +9,7 @@ ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
file
(
GLOB lib_srcs *.c
)
file
(
GLOB lib_hdrs *.h
)
if
(
ANDROID OR IOS
)
if
(
ANDROID OR IOS
OR APPLE
)
ocv_list_filterout
(
lib_srcs jmemansi.c
)
else
()
ocv_list_filterout
(
lib_srcs jmemnobs.c
)
...
...
cmake/OpenCVGenInfoPlist.cmake
浏览文件 @
92ead5fa
if
(
IOS
)
configure_file
(
"
${
OpenCV_SOURCE_DIR
}
/platforms/ios/Info.plist.in"
"
${
CMAKE_BINARY_DIR
}
/ios/Info.plist"
)
elseif
(
APPLE
)
configure_file
(
"
${
OpenCV_SOURCE_DIR
}
/platforms/osx/Info.plist.in"
"
${
CMAKE_BINARY_DIR
}
/osx/Info.plist"
)
endif
()
modules/world/CMakeLists.txt
浏览文件 @
92ead5fa
...
...
@@ -106,11 +106,11 @@ macro(ios_include_3party_libs)
ocv_list_filterout
(
objlist jmemansi
)
# <<= dirty fix
endmacro
()
if
(
IOS
AND WITH_PNG
)
if
(
(
IOS OR APPLE
)
AND WITH_PNG
)
ios_include_3party_libs
(
zlib libpng
)
endif
()
if
(
IOS
AND WITH_JPEG
)
if
(
(
IOS OR APPLE
)
AND WITH_JPEG
)
ios_include_3party_libs
(
libjpeg
)
endif
()
...
...
platforms/osx/Info.plist.in
0 → 100644
浏览文件 @
92ead5fa
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
CFBundleName
</key>
<string>
OpenCV
</string>
<key>
CFBundleIdentifier
</key>
<string>
org.opencv
</string>
<key>
CFBundleVersion
</key>
<string>
${OPENCV_LIBVERSION}
</string>
<key>
CFBundleShortVersionString
</key>
<string>
${OPENCV_LIBVERSION}
</string>
<key>
CFBundleSignature
</key>
<string>
????
</string>
<key>
CFBundlePackageType
</key>
<string>
FMWK
</string>
</dict>
</plist>
platforms/osx/build_framework.py
0 → 100755
浏览文件 @
92ead5fa
#!/usr/bin/env python
"""
The script builds OpenCV.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with OpenCV repository),
the output dir should not be a subdirectory of OpenCV source tree.
Script will create <outputdir>, if it's missing, and a few its subdirectories:
<outputdir>
build/
iPhoneOS-*/
[cmake-generated build tree for an iOS device target]
iPhoneSimulator/
[cmake-generated build tree for iOS simulator]
opencv2.framework/
[the framework content]
The script should handle minor OpenCV updates efficiently
- it does not recompile the library from scratch each time.
However, opencv2.framework directory is erased and recreated on each run.
"""
import
glob
,
re
,
os
,
os
.
path
,
shutil
,
string
,
sys
def
build_opencv
(
srcroot
,
buildroot
,
target
,
arch
):
"builds OpenCV for device or simulator"
builddir
=
os
.
path
.
join
(
buildroot
,
target
+
'-'
+
arch
)
if
not
os
.
path
.
isdir
(
builddir
):
os
.
makedirs
(
builddir
)
currdir
=
os
.
getcwd
()
os
.
chdir
(
builddir
)
# for some reason, if you do not specify CMAKE_BUILD_TYPE, it puts libs to "RELEASE" rather than "Release"
cmakeargs
=
(
"-GXcode "
+
"-DCMAKE_BUILD_TYPE=Release "
+
"-DBUILD_SHARED_LIBS=OFF "
+
"-DBUILD_DOCS=OFF "
+
"-DBUILD_EXAMPLES=OFF "
+
"-DBUILD_TESTS=OFF "
+
"-DBUILD_PERF_TESTS=OFF "
+
"-DBUILD_opencv_apps=OFF "
+
"-DBUILD_opencv_world=ON "
+
"-DBUILD_opencv_matlab=OFF "
+
"-DWITH_TIFF=OFF -DBUILD_TIFF=OFF "
+
"-DWITH_JASPER=OFF -DBUILD_JASPER=OFF "
+
"-DWITH_WEBP=OFF -DBUILD_WEBP=OFF "
+
"-DWITH_OPENEXR=OFF -DBUILD_OPENEXR=OFF "
+
"-DWITH_IPP=OFF -DWITH_IPP_A=OFF "
+
"-DCMAKE_C_FLAGS=
\"
-Wno-implicit-function-declaration
\"
"
+
"-DCMAKE_INSTALL_PREFIX=install"
)
# if cmake cache exists, just rerun cmake to update OpenCV.xproj if necessary
if
os
.
path
.
isfile
(
os
.
path
.
join
(
builddir
,
"CMakeCache.txt"
)):
os
.
system
(
"cmake %s ."
%
(
cmakeargs
,))
else
:
os
.
system
(
"cmake %s %s"
%
(
cmakeargs
,
srcroot
))
for
wlib
in
[
builddir
+
"/modules/world/UninstalledProducts/libopencv_world.a"
,
builddir
+
"/lib/Release/libopencv_world.a"
]:
if
os
.
path
.
isfile
(
wlib
):
os
.
remove
(
wlib
)
os
.
system
(
"xcodebuild -parallelizeTargets ARCHS=%s -jobs 2 -sdk %s -configuration Release -target ALL_BUILD"
%
(
arch
,
target
.
lower
()))
os
.
system
(
"xcodebuild ARCHS=%s -sdk %s -configuration Release -target install install"
%
(
arch
,
target
.
lower
()))
os
.
chdir
(
currdir
)
def
put_framework_together
(
srcroot
,
dstroot
):
"constructs the framework directory after all the targets are built"
# 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"
if
os
.
path
.
isdir
(
framework_dir
):
shutil
.
rmtree
(
framework_dir
)
os
.
makedirs
(
framework_dir
)
os
.
chdir
(
framework_dir
)
# form the directory tree
dstdir
=
"Versions/A"
os
.
makedirs
(
dstdir
+
"/Resources"
)
tdir0
=
"../build/"
+
targetlist
[
0
]
# copy headers
shutil
.
copytree
(
tdir0
+
"/install/include/opencv2"
,
dstdir
+
"/Headers"
)
# make universal static lib
wlist
=
" "
.
join
([
"../build/"
+
t
+
"/lib/Release/libopencv_world.a"
for
t
in
targetlist
])
os
.
system
(
"lipo -create "
+
wlist
+
" -o "
+
dstdir
+
"/opencv2"
)
# copy Info.plist
shutil
.
copyfile
(
tdir0
+
"/osx/Info.plist"
,
dstdir
+
"/Resources/Info.plist"
)
# make symbolic links
os
.
symlink
(
"A"
,
"Versions/Current"
)
os
.
symlink
(
"Versions/Current/Headers"
,
"Headers"
)
os
.
symlink
(
"Versions/Current/Resources"
,
"Resources"
)
os
.
symlink
(
"Versions/Current/opencv2"
,
"opencv2"
)
def
build_framework
(
srcroot
,
dstroot
):
"main function to do all the work"
targets
=
[
"MacOSX"
,
"MacOSX"
]
archs
=
[
"x86_64"
,
"i386"
]
for
i
in
range
(
len
(
targets
)):
build_opencv
(
srcroot
,
os
.
path
.
join
(
dstroot
,
"build"
),
targets
[
i
],
archs
[
i
])
put_framework_together
(
srcroot
,
dstroot
)
if
__name__
==
"__main__"
:
if
len
(
sys
.
argv
)
!=
2
:
print
"Usage:
\n\t
./build_framework.py <outputdir>
\n\n
"
sys
.
exit
(
0
)
build_framework
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
"../.."
)),
os
.
path
.
abspath
(
sys
.
argv
[
1
]))
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录