SuperBuild - OpenCV compilation

Description

A IOTA² user report to me an issue about the OpenCV compilation using OTB SuperBuild.

OPENCV-configure-err.log:

CMake Deprecation Warning at CMakeLists.txt:47 (cmake_policy):
  The OLD behavior for policy CMP0022 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:52 (cmake_policy):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:81 (list):
  list GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:91 (include)


CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:82 (list):
  list GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:91 (include)


CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:85 (math):
  math cannot parse the expression: "*100 + ": syntax error, unexpected
  exp_TIMES, expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER
  (1)
Call Stack (most recent call first):
  CMakeLists.txt:91 (include)


CMake Warning at cmake/OpenCVPackaging.cmake:23 (message):
  CPACK_PACKAGE_VERSION does not match version provided by version.hpp
  header!
Call Stack (most recent call first):
  CMakeLists.txt:1108 (include)


CMake Error at cmake/OpenCVPackaging.cmake:127 (if):
  if given arguments:

    "EQUAL" "5"

  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:1108 (include)

It seems to be related to the gcc version (GCC 7) which is not correctly detected by OpenCV.

Edited by Arthur Vincent