This is a total cmake noob question I'm sure.
I'm working on an OpenCV project and wish to test something using the latest beta release. How can I specify the beta libraries without installing them onto my system? My beta opencv has been successfully built in:
/Users/paul/hacking/robotics/opencv/build/lib/ My current cmake has basically been lifted from the opencv samples and looks like this:
# cmake for Stereo Vision App # your opencv/build directory should be in your system PATH # set minimum required version for cmake cmake_minimum_required(VERSION 2.8) # define the project name set(project_name "Stereo") # set the project namee project("${project_name}") # add opencv package to the project find_package( OpenCV REQUIRED ) MESSAGE("OpenCV version : ${OpenCV_VERSION}") # add opencv include directories to the project include_directories( ${OpenCV_INCLUDE_DIRS} ) # add include directory include_directories (${Stereo_SOURCE_DIR}) # add library add_library( CameraCalibrator CameraCalibrator.cpp) # add executable #add_executable( videoprocessing videoprocessing.cpp) #add_executable( tracking tracking.cpp) #add_executable( foreground foreground.cpp) add_executable( calibrate calibrate.cpp) add_executable( rightsideup rightsideup.cpp) add_executable( live live.cpp) add_executable( live2 live2.cpp) add_executable( stereo-tune stereo-tune.cpp) add_executable( project project.cpp) add_executable( stereo_calibrate stereo_calibrate.cpp) add_executable( capture_two_camera_chessboards capture_two_camera_chessboards.cpp) add_executable( capture_stereo_chessboards capture_stereo_chessboards.cpp) # link libraries #target_link_libraries( videoprocessing ${OpenCV_LIBS}) #target_link_libraries( tracking ${OpenCV_LIBS}) #target_link_libraries( foreground ${OpenCV_LIBS}) target_link_libraries( rightsideup ${OpenCV_LIBS}) target_link_libraries( live ${OpenCV_LIBS}) target_link_libraries( live2 ${OpenCV_LIBS}) target_link_libraries( stereo-tune ${OpenCV_LIBS}) target_link_libraries( project ${OpenCV_LIBS}) target_link_libraries( stereo_calibrate ${OpenCV_LIBS}) target_link_libraries( capture_two_camera_chessboards ${OpenCV_LIBS}) target_link_libraries( capture_stereo_chessboards ${OpenCV_LIBS}) target_link_libraries( calibrate ${OpenCV_LIBS} CameraCalibrator) I've tried using link_libraries and setting the version on the find package line to 3.0, however it always finds the system installed libraries 2.4.10
Edit 1:
cmake -DPCL_DIR:PATH="../../pcl/build" -DOpenCV_DIR:PATH="../../opencv/build" .. Is not working for me for some reason. Likewise when I try to set these variables inside the CMake script it also does not work.
set(PCL_DIR "../../pcl/build" CACHE PATH "") set(OpenCV_DIR "../../opencv/build" CACHE PATH "") Many thanks! Paul