1. Preparatory work:
1) Complete visual Studio2012 installation;
2) Download and unzip the CMake3.5.0;
3) Download and unzip the OpenCV2.4.12;
4) Download and unzip the Tbb44_20160128oss.
2. Create a OpenCV static link library to compile the target directory for the project.
3. Compile the project by CMake build OpenCV static link library:
1) Double-click the Cmake-gui.exe, delete the configuration cache, select the build platform, as shown in;
2) Select OpenCV2.4.12 Source directory (CMakeLists.txt directory) and the 2nd step to create a static library project target directory;
3) After clicking the Configure option in the GUI, tick WITH_TBB in with, remove the items that are not, and then set the contents of the include in the extracted TBB after configure again, as shown in.
4) Click Configure to remove the BUILD_SHARED_LIBS option in build.
5) Click Generate to build the OpenCV Static Library compilation project under Visual Studio 2012.
4. Use VS2012 to open the OpenCV.sln for compilation, and then the required static library appears under Lib\debug (Release).
Create OpenCV static link library (VS2012+OPENCV2.4.12+TBB) with CMake