Commit ee9c0f5f authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #8234 from alalek:issue_8121

parents a9e33fe5 88a338a3
......@@ -519,7 +519,9 @@ endif(WIN32 AND NOT MINGW)
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
# ----------------------------------------------------------------------------
if(UNIX)
if(NOT APPLE_FRAMEWORK)
find_package(PkgConfig QUIET)
endif()
include(CheckFunctionExists)
include(CheckIncludeFile)
......
......@@ -92,6 +92,9 @@ if(IOS)
list(APPEND imgcodecs_srcs ${CMAKE_CURRENT_LIST_DIR}/src/ios_conversions.mm)
list(APPEND IMGCODECS_LIBRARIES "-framework Accelerate" "-framework CoreGraphics" "-framework QuartzCore" "-framework AssetsLibrary")
endif()
if(APPLE_FRAMEWORK)
list(APPEND IMGCODECS_LIBRARIES "-framework UIKit")
endif()
if(UNIX)
#these variables are set by CHECK_MODULE macro
......
......@@ -210,7 +210,7 @@ if(IOS)
${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")
if(APPLE_FRAMEWORK AND BUILD_SHARED_LIBS)
if(APPLE_FRAMEWORK)
list(APPEND VIDEOIO_LIBRARIES "-framework UIKit")
endif()
endif()
......
......@@ -122,37 +122,32 @@ class Builder:
def getCMakeArgs(self, arch, target):
if self.dynamic:
args = [
"cmake",
"-GXcode",
"-DAPPLE_FRAMEWORK=ON",
"-DCMAKE_INSTALL_PREFIX=install",
"-DCMAKE_BUILD_TYPE=Release",
] + ([
"-DBUILD_SHARED_LIBS=ON",
"-DCMAKE_MACOSX_BUNDLE=ON",
"-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=NO",
]
else:
args = [
"cmake",
"-GXcode",
"-DAPPLE_FRAMEWORK=ON",
"-DCMAKE_INSTALL_PREFIX=install",
"-DCMAKE_BUILD_TYPE=Release",
]
] if self.dynamic else [])
if len(self.exclude) > 0:
args += ["-DBUILD_opencv_world=OFF"]
args += ("-DBUILD_opencv_%s=OFF" % m for m in self.exclude)
args += ["-DBUILD_opencv_world=OFF"] if not self.dynamic else []
args += ["-DBUILD_opencv_%s=OFF" % m for m in self.exclude]
return args
def getBuildCommand(self, archs, target):
if self.dynamic:
buildcmd = [
"xcodebuild",
]
if self.dynamic:
buildcmd += [
"IPHONEOS_DEPLOYMENT_TARGET=8.0",
"ONLY_ACTIVE_ARCH=NO",
]
......@@ -160,25 +155,19 @@ class Builder:
for arch in archs:
buildcmd.append("-arch")
buildcmd.append(arch.lower())
buildcmd += [
"-sdk", target.lower(),
"-configuration", "Release",
"-parallelizeTargets",
"-jobs", "4",
"-target","ALL_BUILD",
]
else:
arch = ";".join(archs)
buildcmd = [
"xcodebuild",
buildcmd += [
"IPHONEOS_DEPLOYMENT_TARGET=6.0",
"ARCHS=%s" % arch,
]
buildcmd += [
"-sdk", target.lower(),
"-configuration", "Release",
"-parallelizeTargets",
"-jobs", "4"
]
"-jobs", "4",
] + (["-target","ALL_BUILD"] if self.dynamic else [])
return buildcmd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment