Repository: opencv
Issue: Building OpenCV for IOS fails w/ code signing error
Labels: category: build/install,platform: ios/osx

##### System information (version)
- OpenCV => 4.1.0
- Operating System / Platform => MacOS 10.14.4
- XCode => 10.2.1
- Compiler  => AppleClang 10.0.1.10010046
- Cmake => 3.5.2
##### Detailed description

Building OpenCV 4.1.0 for IOS fails. The error that sticks out the most is from 
`build/build-arm64-iphoneos/CMakeFiles/CMakeError.log` (attached) and it states:

`error: An empty identity is not valid when signing a binary for the product type 'Application'`

There is another error in the stdout (attached) that might be related but seems like a red-herring
```
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:188 (message):
  OpenCV 4.x requires C++11
```

It should be noted that the OSX build doesn't not have this issue on my machine, only the IOS one.

Thanks in advance for the help.

##### Steps to reproduce

```
cd $CODE/opencv
git checkout tags/4.1.0

mkdir -p $CODE/opencvbuild

python $CODE/opencv/platforms/ios/build_framework.py \
 	--iphoneos_deployment_target 12.2 \
 	--iphoneos_archs arm64 \
	--opencv $CODE/opencv \
	$CODE/opencvbuild
```
#### STDOUT
```
Using IPHONEOS_DEPLOYMENT_TARGET=12.2
Using iPhoneOS ARCHS=['arm64']
Using iPhoneSimulator ARCHS=['i386', 'x86_64']
Executing: ['cmake', '-GXcode', '-DAPPLE_FRAMEWORK=ON', '-DCMAKE_INSTALL_PREFIX=install', '-DCMAKE_BUILD_TYPE=Release', '-DOPENCV_INCLUDE_INSTALL_PATH=include', '-DOPENCV_3P_LIB_INSTALL_PATH=lib/3rdparty', '-DIOS_ARCH=arm64', '-DCMAKE_TOOLCHAIN_FILE=/Users/cbabraham/code/opencv/platforms/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake', '-DCPU_BASELINE=DETECT', '/Users/cbabraham/code/opencv', '-DCMAKE_C_FLAGS=-fembed-bitcode', '-DCMAKE_CXX_FLAGS=-fembed-bitcode'] in /Users/cbabraham/code/opencvbuild/build/build-arm64-iphoneos
Executing: cmake -GXcode -DAPPLE_FRAMEWORK=ON -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOPENCV_INCLUDE_INSTALL_PATH=include -DOPENCV_3P_LIB_INSTALL_PATH=lib/3rdparty -DIOS_ARCH=arm64 -DCMAKE_TOOLCHAIN_FILE=/Users/cbabraham/code/opencv/platforms/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake -DCPU_BASELINE=DETECT /Users/cbabraham/code/opencv -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode
-- Setting up iPhoneOS toolchain for IOS_ARCH='arm64'
-- iPhoneOS toolchain loaded
-- Setting up iPhoneOS toolchain for IOS_ARCH='arm64'
-- iPhoneOS toolchain loaded
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- The C compiler identification is AppleClang 10.0.1.10010046
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - failed
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting C compile features
-- Detecting C compile features - failed
-- Performing Test HAVE_CXX11 (check file: cmake/checks/cxx11.cpp)
-- Performing Test HAVE_CXX11 - Failed
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:188 (message):
  OpenCV 4.x requires C++11
Call Stack (most recent call first):
  CMakeLists.txt:160 (include)


-- Configuring incomplete, errors occurred!
See also "opencvbuild/build/build-arm64-iphoneos/CMakeFiles/CMakeOutput.log".
See also "opencvbuild/build/build-arm64-iphoneos/CMakeFiles/CMakeError.log".
```

##### opencvbuild/build/build-arm64-iphoneos/CMakeFiles/CMakeError.log
```
Detecting CXX compiler ABI info failed to compile with the following output:
Change Dir: opencvbuild/build/build-arm64-iphoneos/CMakeFiles/CMakeTmp

Run Build Command:"opencvbuild/build/build-arm64-iphoneos/xcodebuild_wrapper" "-project" "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_f2f02" "-configuration" "Debug"
Build settings from command line:
    ARCHS = arm64
    IPHONEOS_DEPLOYMENT_TARGET = 12.2
    SDKROOT = iphoneos12.2

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: An empty identity is not valid when signing a binary for the product type 'Application'. (in target 'cmTC_f2f02')
```