mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
Merge pull request #8234 from alalek:issue_8121
This commit is contained in:
commit
ee9c0f5f9c
@ -519,7 +519,9 @@ endif(WIN32 AND NOT MINGW)
|
|||||||
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
|
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
find_package(PkgConfig QUIET)
|
if(NOT APPLE_FRAMEWORK)
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
endif()
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
|
|
||||||
|
@ -92,6 +92,9 @@ if(IOS)
|
|||||||
list(APPEND imgcodecs_srcs ${CMAKE_CURRENT_LIST_DIR}/src/ios_conversions.mm)
|
list(APPEND imgcodecs_srcs ${CMAKE_CURRENT_LIST_DIR}/src/ios_conversions.mm)
|
||||||
list(APPEND IMGCODECS_LIBRARIES "-framework Accelerate" "-framework CoreGraphics" "-framework QuartzCore" "-framework AssetsLibrary")
|
list(APPEND IMGCODECS_LIBRARIES "-framework Accelerate" "-framework CoreGraphics" "-framework QuartzCore" "-framework AssetsLibrary")
|
||||||
endif()
|
endif()
|
||||||
|
if(APPLE_FRAMEWORK)
|
||||||
|
list(APPEND IMGCODECS_LIBRARIES "-framework UIKit")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
#these variables are set by CHECK_MODULE macro
|
#these variables are set by CHECK_MODULE macro
|
||||||
|
@ -210,7 +210,7 @@ if(IOS)
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_video_camera.mm)
|
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_video_camera.mm)
|
||||||
|
|
||||||
list(APPEND VIDEOIO_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework AssetsLibrary")
|
list(APPEND VIDEOIO_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework AssetsLibrary")
|
||||||
if(APPLE_FRAMEWORK AND BUILD_SHARED_LIBS)
|
if(APPLE_FRAMEWORK)
|
||||||
list(APPEND VIDEOIO_LIBRARIES "-framework UIKit")
|
list(APPEND VIDEOIO_LIBRARIES "-framework UIKit")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -122,37 +122,32 @@ class Builder:
|
|||||||
|
|
||||||
def getCMakeArgs(self, arch, target):
|
def getCMakeArgs(self, arch, target):
|
||||||
|
|
||||||
if self.dynamic:
|
args = [
|
||||||
args = [
|
"cmake",
|
||||||
"cmake",
|
"-GXcode",
|
||||||
"-GXcode",
|
"-DAPPLE_FRAMEWORK=ON",
|
||||||
"-DAPPLE_FRAMEWORK=ON",
|
"-DCMAKE_INSTALL_PREFIX=install",
|
||||||
"-DCMAKE_INSTALL_PREFIX=install",
|
"-DCMAKE_BUILD_TYPE=Release",
|
||||||
"-DCMAKE_BUILD_TYPE=Release",
|
] + ([
|
||||||
"-DBUILD_SHARED_LIBS=ON",
|
"-DBUILD_SHARED_LIBS=ON",
|
||||||
"-DCMAKE_MACOSX_BUNDLE=ON",
|
"-DCMAKE_MACOSX_BUNDLE=ON",
|
||||||
"-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=NO",
|
"-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=NO",
|
||||||
]
|
] if self.dynamic else [])
|
||||||
else:
|
|
||||||
args = [
|
|
||||||
"cmake",
|
|
||||||
"-GXcode",
|
|
||||||
"-DAPPLE_FRAMEWORK=ON",
|
|
||||||
"-DCMAKE_INSTALL_PREFIX=install",
|
|
||||||
"-DCMAKE_BUILD_TYPE=Release",
|
|
||||||
]
|
|
||||||
|
|
||||||
if len(self.exclude) > 0:
|
if len(self.exclude) > 0:
|
||||||
args += ["-DBUILD_opencv_world=OFF"]
|
args += ["-DBUILD_opencv_world=OFF"] if not self.dynamic else []
|
||||||
args += ("-DBUILD_opencv_%s=OFF" % m for m in self.exclude)
|
args += ["-DBUILD_opencv_%s=OFF" % m for m in self.exclude]
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
def getBuildCommand(self, archs, target):
|
def getBuildCommand(self, archs, target):
|
||||||
|
|
||||||
|
buildcmd = [
|
||||||
|
"xcodebuild",
|
||||||
|
]
|
||||||
|
|
||||||
if self.dynamic:
|
if self.dynamic:
|
||||||
buildcmd = [
|
buildcmd += [
|
||||||
"xcodebuild",
|
|
||||||
"IPHONEOS_DEPLOYMENT_TARGET=8.0",
|
"IPHONEOS_DEPLOYMENT_TARGET=8.0",
|
||||||
"ONLY_ACTIVE_ARCH=NO",
|
"ONLY_ACTIVE_ARCH=NO",
|
||||||
]
|
]
|
||||||
@ -160,25 +155,19 @@ class Builder:
|
|||||||
for arch in archs:
|
for arch in archs:
|
||||||
buildcmd.append("-arch")
|
buildcmd.append("-arch")
|
||||||
buildcmd.append(arch.lower())
|
buildcmd.append(arch.lower())
|
||||||
|
else:
|
||||||
|
arch = ";".join(archs)
|
||||||
buildcmd += [
|
buildcmd += [
|
||||||
|
"IPHONEOS_DEPLOYMENT_TARGET=6.0",
|
||||||
|
"ARCHS=%s" % arch,
|
||||||
|
]
|
||||||
|
|
||||||
|
buildcmd += [
|
||||||
"-sdk", target.lower(),
|
"-sdk", target.lower(),
|
||||||
"-configuration", "Release",
|
"-configuration", "Release",
|
||||||
"-parallelizeTargets",
|
"-parallelizeTargets",
|
||||||
"-jobs", "4",
|
"-jobs", "4",
|
||||||
"-target","ALL_BUILD",
|
] + (["-target","ALL_BUILD"] if self.dynamic else [])
|
||||||
]
|
|
||||||
else:
|
|
||||||
arch = ";".join(archs)
|
|
||||||
buildcmd = [
|
|
||||||
"xcodebuild",
|
|
||||||
"IPHONEOS_DEPLOYMENT_TARGET=6.0",
|
|
||||||
"ARCHS=%s" % arch,
|
|
||||||
"-sdk", target.lower(),
|
|
||||||
"-configuration", "Release",
|
|
||||||
"-parallelizeTargets",
|
|
||||||
"-jobs", "4"
|
|
||||||
]
|
|
||||||
|
|
||||||
return buildcmd
|
return buildcmd
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user