Reputation: 1080
I need to install opencv V3 in a ubuntu 16.04.
I have the packages libopencv-* (opencv 2.4.9) installed and lot of applications and libraries depends of it so I can't remove it.
I can make and install opencv 3.1 from git repos but my doubt is if I do that installation i will have conflicts between both version or even a posterior upgrade from opt-get will overwrite the new ones and make everything unstable.
Is there a way to have both at time, or remove 2.4.9 without uninstall all packages ho depend on it?
Upvotes: 0
Views: 379
Reputation: 150805
The default install folder of OpenCV is /usr/local/
. You can install OpenCV 3.1 to a separate location, say /home/your_username/opencv_3.1
with CMake option
cmake -D CMAKE_INSTALL_PREFIX=/home/your_username/opencv_3.1
To build your project with OpenCV 3.1 using CMake, add
set(OpenCV_DIR /home/your_username/opencv_3.1/share/OpenCV)
to your CMakeLists.txt
, after project(projName)
. You can also link the corresponding libraries/headers manually or with IDE.
Upvotes: 1