2
votes

I'm trying to build OpenCV with Cmake on Windows 7. I chose to use the Visual Studio 10 compiler.

I'm getting the following error:

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 (get_filename_component):

get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:2 (PROJECT)

I'm sure the path to OpenCV is correct. Can anyone please guide me as to how to fix this error?

Thanks in advance!!

1
Can you show what is in line 37 of your CMakeLists.txt file? It looks like you are calling the function with an insufficient number of arguments. You need the variable first, then the path, then one of PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH to tell it what to return. See the docsSethMMorton
Thanks for your comment, line 37 is: else(NOT CMAKE_TOOLCHAIN_FILE) Moreover, I haven't made any changes to CMakeLists.txt, I'm using the version that came with the OpenCV download, so I really not sure what can go wrong.GilLevi
I misunderstood the error message. It looks like the error is on line 37 of CMakeCXXInformation.cmake, which seems odd. You haven't changed any CMake files? If you get this error right out of the OpenCV package, I might recommend contacting the OpenCV community.SethMMorton
Yes, I'm getting this error right out of the OpenCV package. I just posted in the OpenCV forums as well. Thanks!!GilLevi

1 Answers