1 | initial version |
Create a folder MyCalibration Create a file CMakeLists.txt in this folder Write in this file :
cmake_minimum_required(VERSION 2.8)
PROJECT (MyCalibration) find_package(OpenCV REQUIRED) file(GLOB MyCalibration_SRCS ".h" ".cpp") ADD_EXECUTABLE (MyCalibration ${MyCalibration_SRCS})
if (OpenCV_FOUND) include_directories( ${OpenCV_INCLUDE_DIRS} ) target_link_libraries( MyCalibration ${OpenCV_LIBS} ) else (OpenCV_FOUND) message("PB->OPENCV = ${OpenCV_INCLUDE_DIRS}") endif (OpenCV_FOUND)
Then open CMake In "where is Source Code" give MyCalibration in Where to build the Binaries gives MyCalibration (with full path in both case) Click in configure Click in Generate Click in Open Project (for Cmake >3.7.1)
and build your project.Select sub project myCalibration to run your application
If CMake cannot find Opencv you have to give opencv folder where you download or build opencv.
2 | No.2 Revision |
cmake_minimum_required(VERSION 2.8)
PROJECT (MyCalibration) find_package(OpenCV REQUIRED) file(GLOB MyCalibration_SRCS ".h" ".cpp") ADD_EXECUTABLE (MyCalibration ${MyCalibration_SRCS})
if (OpenCV_FOUND) include_directories( ${OpenCV_INCLUDE_DIRS} ) target_link_libraries( MyCalibration ${OpenCV_LIBS} ) else (OpenCV_FOUND) message("PB->OPENCV = ${OpenCV_INCLUDE_DIRS}") endif (OpenCV_FOUND)
Then open CMake
CMake
In "where is Source Code" give MyCalibration
MyCalibration
in Where to build the Binaries gives MyCalibration (with full path in both case)
case)
Click in configure
configure
Click in Generate
and build your project.Select sub project myCalibration to run your application
If CMake cannot find Opencv you have to give opencv folder where you download or build opencv.
3 | No.3 Revision |
Try like this
cmake_minimum_required(VERSION 2.8)
PROJECT (MyCalibration) find_package(OpenCV REQUIRED) file(GLOB MyCalibration_SRCS ".h" ".cpp") ADD_EXECUTABLE (MyCalibration ${MyCalibration_SRCS})
if (OpenCV_FOUND) include_directories( ${OpenCV_INCLUDE_DIRS} ) target_link_libraries( MyCalibration ${OpenCV_LIBS} ) else (OpenCV_FOUND) message("PB->OPENCV = ${OpenCV_INCLUDE_DIRS}") endif (OpenCV_FOUND)
and build your project.Select sub project myCalibration to run your application
If CMake cannot find Opencv you have to give opencv folder where you download or build opencv.
cmake_minimum_required(VERSION 2.8)
PROJECT (MyCalibration)
find_package(OpenCV REQUIRED)
file(GLOB MyCalibration_SRCS
"*.h"
"*.cpp")
ADD_EXECUTABLE (MyCalibration ${MyCalibration_SRCS})
if (OpenCV_FOUND)
include_directories( ${OpenCV_INCLUDE_DIRS} )
target_link_libraries( MyCalibration ${OpenCV_LIBS} )
else (OpenCV_FOUND)
message("PB->OPENCV = ${OpenCV_INCLUDE_DIRS}")
endif (OpenCV_FOUND)