QT using OpenCV and camera with mobile phone
-
How can I set up different library bindings in qmake?
-
You can add configuration blocks to the .pro file of your project for platform-specific settings, e.g. like this:
android { # put settings here for Android configuration } ios { # put settings here for iOS configuration }
You can use this feature to link different libraries for each platform (there are also conditions for other platforms, e.g. win32, macx, ...)
Best,
GT -
I have now added this:
osx{
INCLUDEPATH += /usr/local/Cellar/opencv3/3.2.0/include/
LIBS += -L/usr/local/Cellar/opencv3/3.2.0/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_flann -lopencv_features2d -lopencv_imgcodecs -lopencv_ml -lopencv_video -lopencv_videoio
}ios{
LIBS +=
-F /usr/local/Frameworks/ios
-framework opencv2}
for the OS X part it works fine. But for the IOS it tells me:
.../opencv2 does not contain bitcode.Your must rebuild it with bitcode enabled (Xcode setting EBALE_BITCODE).I tried to open the gilded Xcode project and set the Enable Bitcode to NO. But it won't help
-
Hi,
Did you compile OpenCV for iOS ?
-
I builded the framework like it was said here.
-
Which version of Xcode are you using ?
-
I am using Xcode version 8.2.1 and cmake version 3.6.2
-
cmake or qmake ?
-
cmake! for building the framework. The QT version I am using is QT5.8.0
-
Ok
As for the bitcode problem, I'd modify their python script to ensure that it's building with bitcode enabled.
-
I looked in the '.../opencv/platforms/ios/build_framework.py' file. But which line should I change to enable Bitcode.
In line 47 is the class Builder, if I change 'self.bitcodedisabled = bitcodedisabled' to 'self.bitcodedisabled = 0' should that work?
-
I looked in the '.../opencv/platforms/ios/build_framework.py' file. But which line should I change to enable Bitcode.
In line 47 is the class Builder, if I change 'self.bitcodedisabled = bitcodedisabled' to 'self.bitcodedisabled = 0' should that work?
@Domididongo said in QT using OpenCV and camera with mobile phone:
self.bitcodedisabled = 0
self.bitcodedisabled = False
-
So I changed now in line 276:
parser.add_argument('--disable-bitcode', default=False, dest='bitcodedisabled', action='store_false', help='disable bitcode (enabled by default)')the action='store_true' to action='store_false',
and in line 58:
self.bitcodedisabled = bitcodedisabled to self.bitcodedisabled = Falsebut still getting the same error:
does not contain bitcode...is there somewhere else something i have to change?
-
Try adding
set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "bitcode")
to the iOS.cmake file.