0
votes

I am trying to build OpenCV based project using CMake GUI but keeps getting an error. I followed this thread but still can not solve my problem.

Following is the message (along with the error) which I got in the GUI:

CMake Warning at C:/SCCH/libs/opencv249_x86_3/OpenCVConfig.cmake:161 (message): 
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.

You should manually point CMake variable OpenCV_DIR to your build of OpenCV library.

Call Stack (most recent call first):
  CMakeLists.txt:9 (FIND_PACKAGE)

CMake Error at CMakeLists.txt:9 (FIND_PACKAGE):
  Found package configuration file:

     C:/SCCH/libs/opencv249_x86_3/OpenCVConfig.cmake
  but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to  be NOT FOUND.

I am using OpenCV 2.49 (x86) built with TBB library using CMake and targeted for Visual Studio 2013 (version 12). Also, I have defined a system variable for OpenCV. And, following is my CMakeLists.txt file which I am using for building (where I am getting the above error) a project solution (.sln) file:

cmake_minimum_required(VERSION 2.8)

project(FlexTex)

SET(OpenCV_DIR "C:/SCCH/libs/opencv249_x86_3")
FIND_PACKAGE(OpenCV REQUIRED)

SET(FLEX_TEX_DLL_FILES ./LibFlexTexDLL/inc/FlexTexDLL.h ./LibFlexTexDLL/src/FlexTexDLL.cpp)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/LibFlexTexDLL/inc/)
ADD_LIBRARY(FlexTexDLL SHARED ${FLEX_TEX_DLL_FILES})
TARGET_LINK_LIBRARIES(FlexTexDLL ${OpenCV_LIBS})

SET(FLEX_TEX_PP_DLL_FILES ./LibFlexTexPPDLL/inc/defines.h ./LibFlexTexPPDLL/inc/FlexTexPPDLL.h ./LibFlexTexPPDLL/inc/FlexTexPPImpl.h   ./LibFlexTexPPDLL/src/FlexTexPPDLL.cpp)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/LibFlexTexPPDLL/inc/)
ADD_LIBRARY(FlexTexPPDLL SHARED ${FLEX_TEX_PP_DLL_FILES})
TARGET_LINK_LIBRARIES(FlexTexPPDLL ${OpenCV_LIBS})

ADD_EXECUTABLE (FlexTexMain FlexTexMain/src/FlexTexMain.cpp )
TARGET_LINK_LIBRARIES(FlexTexMain FlexTexPPDLL )
1

1 Answers

0
votes

Seems you try build your application using vs2013 (version 12) but you have OpenCV distribution built for version vs2012 (version 11). This is the issue.

You can try use Creemple distribution: http://opencv.org/ceemple-opencv-distribution-for-visual-studio.html