Link the Mac Framework File with CMake

While writing program on Mac, sometimes we need to link framework and libraries under OSX folder System/Library/Frameworks. There are so many frameworks like CoreMedia & VideoToolBox, which you will use in FFMpeg or something else someday. In this situation, we have to use find_library as it includes some special handling for frameworks on OSX. Also, don’t use link_directories, CMake use full paths to libraries and it’s not needed. Here’s some simple example with CoreMedia:

OpenCV 2.4.13 compilation under Mac using CMake 3.5

The library versions using in this article: OpenCV2.4.13, FFMpeg 2.8.7, CMake 3.5. First of all, you need to install FFMpeg on Mac OSX first. The step is very easy just like doing it on other Unix/Linux platform. Then download OpenCV 2.4.13 and unzip it to a folder. Enter this folder from terminal and here are basic steps for OpenCV 2.4.13 compilation under Mac: mkdir build cd build cmake -G “Unix Makefiles” .

Compile OpenCV 3.1.0 under Visual Studio 2008

We can build OpenCV under Visual Studio by using CMake under Windows7. It is very easy to do this job using edition OpenCV 2.4.X with Visual Studio 2008. But when I try to build OpenCV 3.1.0 under Visual Studio 2008, there are some errors! The first error is : Error 131 fatal error C1083: Cannot open include file: ‘stdint.h’: No such file or directory g:\setup_files\opencv\windows\opencv-3.1.0\sources\modules\imgcodecs\src\jpeg_exif.hpp 51 To fix this error, just google the stdint.

Add Include Folders to Android Makefile

In Android jni folder, we will always add some C/C++ header file folders. Basically, there are two ways to do this job. Option 1: Add one of the following lines to your Android.mk inside a module of your choice: LOCAL_C_INCLUDES := /path/to/your/includes # ignore previous includes # OR LOCAL_C_INCLUDES += /path/to/your/includes # preserve previous includes If necessary you could create an environment variable pointing at ‘/path/to/your/includes’ and include it like this: