CMake error when setting up OpenCV

I am using cmake-gui trying to create opencv but getting 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'm not sure where to go. I looked at the OpenCVGenConfig.cmake file, but I do not understand its syntax. I blew everything, downloaded the opencv tarball again, but still getting the same error. Thus, it does not seem to be a typo / error in the OpenCVGenConfig.cmake file, but in processing the "math" command. I cannot find anything related to the "math" command in the Cmake documentation.

Any ideas?

-Andres

+3
source share
1 answer

It looks like this line

  math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}")

, ${CMAKE_SIZEOF_VOID_P} , . project CMakeLists.txt .

, , CMake. CMake ( 2.8.8), . , CMake ( , ).

, CMake.

CMAKE_SIZEOF_VOID_P ,

  if(NOT CMAKE_SIZEOF_VOID_P)
    set(CMAKE_SIZEOF_VOID_P 4)  # replace 4 with 8 for 64-bit machine
  endif()

cmake/OpenCVGenConfig.cmake 134, math. , , , , OpenCV, .


math,

cmake --help-command math

CMAKE_SIZEOF_VOID_P,

cmake --help-variable CMAKE_SIZEOF_VOID_P
+9

All Articles