* Fixed issue #41619

* More descriptive error message
This commit is contained in:
Ilya Lavrenov 2020-10-29 12:50:46 +03:00 committed by GitHub
parent f1cf207663
commit 51f97c4a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -227,7 +227,7 @@ if (ENABLE_OPENCV)
set(OPENCV_SUFFIX "debian9arm")
elseif (LINUX_OS_NAME STREQUAL "CentOS 7" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
set(OPENCV_SUFFIX "centos7")
elseif (LINUX_OS_NAME STREQUAL "CentOS 8" OR LINUX_OS_NAME MATCHES "Red 8")
elseif (LINUX_OS_NAME MATCHES "CentOS 8")
set(OPENCV_SUFFIX "centos8")
elseif (LINUX_OS_NAME STREQUAL "Ubuntu 16.04")
set(OPENCV_SUFFIX "ubuntu16")
@ -236,7 +236,7 @@ if (ENABLE_OPENCV)
elseif (LINUX_OS_NAME STREQUAL "Ubuntu 20.04")
set(OPENCV_SUFFIX "ubuntu20")
else()
message(FATAL_ERROR "OpenCV is not available on current platform")
message(FATAL_ERROR "OpenCV is not available on current platform (${LINUX_OS_NAME})")
endif()
RESOLVE_DEPENDENCY(OPENCV
ARCHIVE_LIN "opencv/opencv_${OPENCV_VERSION}-${OPENCV_BUILD}_${OPENCV_SUFFIX}.txz"

View File

@ -7,6 +7,7 @@ if (LINUX)
if (NOT EXISTS "/etc/lsb-release")
execute_process(COMMAND find -L /etc/ -maxdepth 1 -type f -name *-release -exec cat {} \;
OUTPUT_VARIABLE release_data RESULT_VARIABLE result)
string(REPLACE "Red Hat" "CentOS" release_data "${release_data}")
set(name_regex "NAME=\"([^ \"\n]*).*\"\n")
set(version_regex "VERSION=\"([0-9]+(\\.[0-9]+)?)[^\n]*\"")
else ()