osx - Tell cmake take another version of the package -


i have opencv , opencv3 installed via homebrew.

opencv linked , can reached cmake via

/usr/local/share/opencv 

opencv3 not linked , located here

/usr/local/cellar/opencv3/3.0.0 

i have cmakelists.txt file:

cmake_minimum_required(version 2.8) project( displayimage ) find_package( opencv required ) add_executable( displayimage displayimage.cpp ) target_link_libraries( displayimage ${opencv_libs} ) 

when run cmake, uses first version of opencv. how can tell cmake use second package?

update:

i tried specify

set(cmake_module_path ${cmake_module_path} "/usr/local/cellar/opencv3/3.0.0/share/opencv") find_package( opencv required ) 

and

set(cmake_module_path ${cmake_module_path} "/usr/local/cellar/opencv3/3.0.0/share/") find_package( opencv required ) 

but in cmakecache.txt still see this:

opencv_config_path:filepath=/usr/local/share/opencv 

which again not need..

thank you.

there couple of options.

option 1

use:

cmake_prefix_path=/usr/local/cellar/opencv3  cmake ... 

option 2

replace

find_package( opencv required ) 

with

find_package(opencv hints /usr/local/opt/opencv3 /usr/local/cellar/opencv3 required) 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

wso2esb - How to concatenate JSON array values in WSO2 ESB? -