Emile
Emile

Reputation: 11721

Building Opencv 2.4.9 with VS 2012, install generates incorrect header files

I'm trying to build openCV version 2.4.9 from the git repository. I've followed the instructions to run cmake-gui to build a visual studio solution. I've then built the VS studio solution in both relase and debug mode and then run the install build.

The install build puts all of the compiled libs into the install folder along with the include folder.

The problem is the include folder is completely wrong and missing a number of files. When I add the include folder path to a HelloWorld project it can't find any of the opencv methods classes etc.

Its as though the cmake build process has been corrupted in some way and doesn't properly prepare the include folder with the required header files.

I've tried this for both VS 2010 and VS 2012 cmake configurations and got the same result. Everything compiles fine, the header files in the install directory however aren't right.

Copying header files from a pre-built windows installation sort of work, and i'm confused as to why the build process doesn't result in a similar folder structure of header files.

Upvotes: 3

Views: 2790

Answers (2)

obrousse
obrousse

Reputation: 21

I'll just update this post to keep it up-to-date with the latest git version of opencv.

On current release the bug is still there and now located @ line 538 of cmake/OpenCVModule.cmake. The proposed solution is to replace the actual line 538:

if(hdr2 MATCHES "^(opencv2/.*)[^/]+.h(..)?$" AND NOT hdr2 MATCHES "opencv2/${the_module}/private.*")

by

if(NOT hdr2 MATCHES "opencv2/${the_module}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )

Thanks a lot to the author of this patch that saved me a headhake...

Upvotes: 2

karlphillip
karlphillip

Reputation: 93410

This is really a bug and it has been reported twice. The description of the first link provides the fix:

The regex on this line is no longer corect: https://github.com/Itseez/opencv/blob/master/cmake/OpenCVModule.cmake#L520

it should be replaced by: /[/]+.h(..)?$

Upvotes: 2

Related Questions