-4

Possible Duplicate:
cmake is not working in opencv c++ project

I have a huge problem in CMake and I posted a question but it didn't help.

I keep getting unreasonable errors and me and my partners just can't solve it. Here are the files:

http://dl.dropbox.com/u/62218293/royshil-FoodcamClassifier-4ba20bb.zip

I'm using Visual Studio 2010 on Windows 7. I'm getting the following errors: does anyone have any idea how can I fix this problem ?

'CMake Error: Unable to open cache file for save. C:/Program Files/CMake 2.8/bin/CMakeCache.txt
CMake Error at CMakeLists.txt:4 (FIND_PACKAGE):
  Could not find module FindOpenCV.cmake or a configuration file for package
  OpenCV.

  Adjust CMAKE_MODULE_PATH to find FindOpenCV.cmake or set OpenCV_DIR to the
  directory containing a CMake configuration file for OpenCV.  The file will
  have one of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake



OpenCV_DIR-NOTFOUND
Configuring incomplete, errors occurred!
CMake Error: Unable to open cache file for save. C:/Program Files/CMake 2.8/bin/CMakeCache.txt
CMake Error: : System Error: Permission denied
CMake Error: : System Error: Permission denied'
Community
  • 1
  • 1
SafeY
  • 287
  • 2
  • 6
  • 18
  • 1
    sorry, but I'm not going to download a zip file, re-compile it for you and upload it. I do want to help but you will need to post more details, like where openCV is installed, etc. – cbrulak Mar 23 '12 at 20:36
  • it's installed on C hard disk – SafeY Mar 23 '12 at 20:41
  • 2
    this is a forum about q&a, not a bunch of guys willing to do work for you. – Castilho Mar 23 '12 at 20:52
  • I'm really sorry but I posted a question here [link]http://stackoverflow.com/questions/9742052/cmake-is-not-working-in-opencv-c-project and no one helping me if you tell me how can I fix this problem I'll be so thankful ... – SafeY Mar 23 '12 at 20:57
  • 1
    See http://stackoverflow.com/q/7011238/583570 – markgz Mar 23 '12 at 21:01
  • so you post the same thing again? Read the FAQ. – cbrulak Mar 23 '12 at 21:15
  • 1
    I'm sorry, but in its current form this is simply not a question. At least not one that belongs here. I have therefor voted accordingly. – Bart Mar 23 '12 at 21:15

1 Answers1

4

Have you tried actually setting the environment variables (CMAKE_MODULE_PATH and/or OpenCV_DIR) the error message tells you to set?

You can do that from Control Panel > System > Advanced System Settings > Environment Variables

See if they exist (and point to the correct path), otherwise just create them...

sonicwave
  • 5,952
  • 2
  • 33
  • 49
  • do you mean the path where the opencv is installed ? I've added C:\Program Files\OpenCV but OPENCV_DIR which the cmake keeps saying that it doesn't exist in all the errors I don't know where i can find it to add it to the path – SafeY Mar 23 '12 at 21:35
  • 3
    Look for a folder containing OpenCVConfig.cmake or opencv-config.cmake, and use the path to that folder for the OpenCV_DIR variable - just like the error message says. – sonicwave Mar 23 '12 at 21:39
  • I've changed the path of "where to build the binaries" and I'm getting another errors but yet still can't find the OPENCV_DIR ?? where I'm supposed to find it ? – SafeY Mar 23 '12 at 21:51
  • Go into the folder where you've installed OpenCV, and do a search for *.cmake - you should find one of the listed files, possibly in a subdirectory, which you should use for the variable value. If that still doesn't get you any further, have a look at the link posted by markgz in a comment to your original question. It contains a full guide for installing OpenCV in Visual Studio. – sonicwave Mar 23 '12 at 22:05
  • what path should I give to the cmake GUI in "where to build the binaries" bar ? – SafeY Mar 23 '12 at 22:13
  • I typically use a 'build' subfolder inside the application folder (so OpenCV/build). You'll need to have write access to the folder though, so either build it somewhere in your Win7 User folder, or run the compilation with administrative privileges. – sonicwave Mar 23 '12 at 22:21
  • [link ]http://tinypic.com/r/2saayqu/5 :( – SafeY Mar 23 '12 at 22:46
  • It says so directly in the screenshot - OpenCV_DIR is not set. You can even set it directly from cmake - it shouldn't be too hard. If you still can't succeed, once again, have a look at the link posted by markgz: http://stackoverflow.com/q/7011238/583570 – sonicwave Mar 24 '12 at 11:48