From a50efda49d8ecff53c7c17e59025e175f8edc261 Mon Sep 17 00:00:00 2001 From: Dal Rupnik Date: Mon, 23 Jan 2017 17:15:17 +0100 Subject: [PATCH 1/3] Added export functions for ObjC classes --- modules/videoio/include/opencv2/videoio/cap_ios.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/videoio/include/opencv2/videoio/cap_ios.h b/modules/videoio/include/opencv2/videoio/cap_ios.h index c90ad2e73e..93c8a0cbea 100644 --- a/modules/videoio/include/opencv2/videoio/cap_ios.h +++ b/modules/videoio/include/opencv2/videoio/cap_ios.h @@ -32,6 +32,8 @@ #import #include "opencv2/core.hpp" +#define OPENCV_OBJC_EXPORT __attribute__((visibility("default"))) + //! @addtogroup videoio_ios //! @{ @@ -39,7 +41,7 @@ @class CvAbstractCamera; -@interface CvAbstractCamera : NSObject +OPENCV_OBJC_EXPORT @interface CvAbstractCamera : NSObject { UIDeviceOrientation currentDeviceOrientation; @@ -87,7 +89,7 @@ @class CvVideoCamera; -@protocol CvVideoCameraDelegate +OPENCV_OBJC_EXPORT @protocol CvVideoCameraDelegate #ifdef __cplusplus // delegate method for processing image frames @@ -96,7 +98,7 @@ @end -@interface CvVideoCamera : CvAbstractCamera +OPENCV_OBJC_EXPORT @interface CvVideoCamera : CvAbstractCamera { AVCaptureVideoDataOutput *videoDataOutput; @@ -129,14 +131,14 @@ @class CvPhotoCamera; -@protocol CvPhotoCameraDelegate +OPENCV_OBJC_EXPORT @protocol CvPhotoCameraDelegate - (void)photoCamera:(CvPhotoCamera*)photoCamera capturedImage:(UIImage *)image; - (void)photoCameraCancel:(CvPhotoCamera*)photoCamera; @end -@interface CvPhotoCamera : CvAbstractCamera +OPENCV_OBJC_EXPORT @interface CvPhotoCamera : CvAbstractCamera { AVCaptureStillImageOutput *stillImageOutput; } From c10283b2b6d01dc477d6b9f8d264c9eb2ebad124 Mon Sep 17 00:00:00 2001 From: Dal Rupnik Date: Tue, 24 Jan 2017 10:26:19 +0100 Subject: [PATCH 2/3] Replaced macro with built-in OpenCV export --- modules/videoio/include/opencv2/videoio/cap_ios.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/videoio/include/opencv2/videoio/cap_ios.h b/modules/videoio/include/opencv2/videoio/cap_ios.h index 93c8a0cbea..0691420cf7 100644 --- a/modules/videoio/include/opencv2/videoio/cap_ios.h +++ b/modules/videoio/include/opencv2/videoio/cap_ios.h @@ -32,8 +32,6 @@ #import #include "opencv2/core.hpp" -#define OPENCV_OBJC_EXPORT __attribute__((visibility("default"))) - //! @addtogroup videoio_ios //! @{ @@ -41,7 +39,7 @@ @class CvAbstractCamera; -OPENCV_OBJC_EXPORT @interface CvAbstractCamera : NSObject +CV_EXPORTS @interface CvAbstractCamera : NSObject { UIDeviceOrientation currentDeviceOrientation; @@ -89,7 +87,7 @@ OPENCV_OBJC_EXPORT @interface CvAbstractCamera : NSObject @class CvVideoCamera; -OPENCV_OBJC_EXPORT @protocol CvVideoCameraDelegate +CV_EXPORTS @protocol CvVideoCameraDelegate #ifdef __cplusplus // delegate method for processing image frames @@ -98,7 +96,7 @@ OPENCV_OBJC_EXPORT @protocol CvVideoCameraDelegate @end -OPENCV_OBJC_EXPORT @interface CvVideoCamera : CvAbstractCamera +CV_EXPORTS @interface CvVideoCamera : CvAbstractCamera { AVCaptureVideoDataOutput *videoDataOutput; @@ -131,14 +129,14 @@ OPENCV_OBJC_EXPORT @interface CvVideoCamera : CvAbstractCamera +CV_EXPORTS @protocol CvPhotoCameraDelegate - (void)photoCamera:(CvPhotoCamera*)photoCamera capturedImage:(UIImage *)image; - (void)photoCameraCancel:(CvPhotoCamera*)photoCamera; @end -OPENCV_OBJC_EXPORT @interface CvPhotoCamera : CvAbstractCamera +CV_EXPORTS @interface CvPhotoCamera : CvAbstractCamera { AVCaptureStillImageOutput *stillImageOutput; } From 576d43d1c2797ef80e494a27f8518c7855972f95 Mon Sep 17 00:00:00 2001 From: Dal Rupnik Date: Tue, 24 Jan 2017 19:14:50 +0100 Subject: [PATCH 3/3] Fixed build_framework.py script for osx --- platforms/osx/build_framework.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platforms/osx/build_framework.py b/platforms/osx/build_framework.py index 2d39be5f9b..64e73c5490 100644 --- a/platforms/osx/build_framework.py +++ b/platforms/osx/build_framework.py @@ -15,10 +15,10 @@ class OSXBuilder(Builder): def getToolchain(self, arch, target): return None - def getBuildCommand(self, arch, target): + def getBuildCommand(self, archs, target): buildcmd = [ "xcodebuild", - "ARCHS=%s" % arch, + "ARCHS=%s" % archs[0], "-sdk", target.lower(), "-configuration", "Release", "-parallelizeTargets", @@ -39,8 +39,8 @@ if __name__ == "__main__": parser.add_argument('--without', metavar='MODULE', default=[], action='append', help='OpenCV modules to exclude from the framework') args = parser.parse_args() - b = OSXBuilder(args.opencv, args.contrib, args.without, + b = OSXBuilder(args.opencv, args.contrib, False, False, args.without, [ - ("x86_64", "MacOSX") + (["x86_64"], "MacOSX") ]) b.build(args.out)