Explained Steps When Building OpenCV Libraries Using CMake
I created OpenCV libraries using CMake a couple of times using tutorials available on the web, albeit without fully understanding the process. Here is the process that I am following
- Configure CMake to generate OpenCV binaries (e.g. with QT, TBB, no CUDA, OpenCL, etc.)
- Generating binaries with CMake
- There are several files in the folder where the binaries are created
.sln
. I open the fileOpenCV.sln
and run the projectALL_BUILD
for Debug and Release configurations. - A new folder has been created.
bin
Which contains a library (as.lib
well as.dll
for the release and debug versions. - (Optional) Sometimes I also create a project named
INSTALL
(in the same solution), just out of curiosity. I noticed that it creates a different folder where the library files are stored, in the same pattern as the prebuilt libraries that come with the OpenCV package. Interestingly, my programs in MSVC or Qt work equally well if I link to libraries in the folderINSTALL
or thebin
/ folderlib
.
My questions
- What is the function of the solution
INSTALL
? - How are libraries created by the solution
INSTALL
different from those in thebin
and folderslib
? - Why the solution is
INSTALL
not created when the solution is builtALL_BUILD
source to share
- What is the function of the solution
install
?
It collects / assembles the output of an assembly into a portable set of libraries and headers that you know can be moved around on your machine or another machine.
- How are libraries generated by the solution
install
different from those found in thebin
and folderslib
?
This is not true. You probably created the first common and then (by reconfiguring with cmake) static libraries, but instead of the target install, only the one you currently selected is installed (in your cmake-gui?)
- Why the solution is
install
not created when the solution is builtALL_BUILD
install
is a special target for cmake. In fact, by default, install
target all
is only actually executed when it all
succeeds, but on the contrary does not match true.
source to share