Ask Your Question

Revision history [back]

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.

  1. Create a folder MyCalibration
  2. Create a file CMakeLists.txt in this folder folder
  3. 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)

  4. Then open CMake CMake

  5. In "where is Source Code" give MyCalibration MyCalibration

  6. in Where to build the Binaries gives MyCalibration (with full path in both case) case)

  7. Click in configure configure

  8. Click in Generate

  9. 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.

Try like this

  1. Create a folder MyCalibration
  2. Create a file CMakeLists.txt in this folder
  3. 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)

    (at the end of the post
  4. Then open CMake

  5. In "where is Source Code" give MyCalibration

  6. in Where to build the Binaries gives MyCalibration (with full path in both case)

  7. Click in configure

  8. Click in Generate

  9. 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.

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)