How to use the right version of OpenCV, if there is more?

I have an application using OpenCV 2.4.9, and now I want to test OpenCV 3.0.0-beta. I changed the 3.0.0 beta tag and built the library. I installed it and now I have 3 versions of OpenCV installed 2.4.8, 2.4.9 and 3.0.0 beta. Is there any way to choose the version I want?

The application is written in C ++ and built using cmake. This is the part of the code that makes the link:

# ...
find_package(OpenCV REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(${EXECUTABLE_NAME}
    # ...
)

target_link_libraries(${EXECUTABLE_NAME} ${OpenCV_LIBS})
# ...

Any help choosing an OpenCV version please?

+4
source share
1 answer

In the find_package () command, specify the version you need:

find_package (requires OpenCV 3.0.0)

eg.

See the CMake doc for find_package for more details .

+3
source

Source: https://habr.com/ru/post/1568000/


All Articles