I am using cmake-gui trying to build opencv but get this error:
CMake Error at cmake/OpenCVGenConfig.cmake:134 (math):
math cannot parse the expression: "8 * ": syntax error, unexpected $end,
expecting exp_OPENPARENT or exp_NUMBER (4)
Call Stack (most recent call first):
CMakeLists.txt:649 (include)
This is my first experience with cmake so I am not sure where to turn. I have looked at the OpenCVGenConfig.cmake file but I am clueless about its syntax. I blew away everything, downloaded the opencv tarball again, but still get the same error. So it does not appear that it is a typo/error in the OpenCVGenConfig.cmake file but in the processing of the “math” command. I can not seem to find anything relating to a “math” command in the Cmake documentation.
Any ideas?
-Andres
It looks like the line in question is
The problem appears to be that
${CMAKE_SIZEOF_VOID_P}is unset when it shouldindicate the size of a pointer in bytes. It should get set during the invocation of the
projectcommand near the start of the top-level CMakeLists.txt.I’m not sure why it’s not being set, it may even be a bug in CMake. You could try using the latest version of CMake (currently 2.8.8) if you’re not already. Also, running CMake from the command line may make a difference (it shouldn’t, but you never know).
If this doesn’t help, your best bet is to ask for advice on the CMake mailing list.
As an absolute last resort, you could set the appropriate value for
CMAKE_SIZEOF_VOID_Pon your machine by addingto cmake/OpenCVGenConfig.cmake just before line 134 where the
mathcall is made. This is a horrible hack and I certainly don’t recommend it, but it could let you build OpenCV whileseeking a proper answer on the mailing list.
You can get info on the
mathcommand by runningand on
CMAKE_SIZEOF_VOID_Pby running