I have installed the OpenCV
package in Ubuntu22.04
by sudo apt-get
.
And the said OpenCV
is one of the dependencies for my project.
The problem is that the target computer does not have installed OpenCV
and it's impossible to use sudo
permission.
How to make the OpenCV
that I am using portable by the install
command of Cmake
? I intend to copy the OpenCV
libraries when make install
is invoked.
What I have tried is seen below.
Here is a portion of the CMakeLists.txt:
find_package( OpenCV REQUIRED )
message("OpenCV_LIBS:")
foreach(lib ${OpenCV_LIBS})
message("${lib}")
endforeach()
install(FILES ${OpenCV_LIBS} TYPE LIB)
Here is the output when cmake ..
is invoked:
OpenCV_LIBS:
opencv_calib3d
opencv_core
opencv_dnn
opencv_features2d
opencv_flann
opencv_highgui
//omits some similar output
Here is the error message when make install
is called:
CMake Error at cmake_install.cmake:130 (file):
file INSTALL cannot find "/home/john/myproject/opencv_calib3d":
No such file or directory.
And what's more, how to only make the libraries that the binary program really needs available to the customer other than sending all the libraries of OpenCV
to the customer?
Tips: the customer uses the same OS.