1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

build: minor changes for cmake 3.30 and some cleanup

This commit is contained in:
Maksim Shabunin
2024-09-03 16:30:49 +03:00
parent 88f99edc65
commit 32d3d6fa97
3 changed files with 29 additions and 71 deletions
+7 -1
View File
@@ -83,6 +83,10 @@ if(NOT DEFINED CMAKE_SIZEOF_VOID_P
AND NOT OPENCV_SUPPRESS_MESSAGE_MISSING_CMAKE_SIZEOF_VOID_P)
message(WARNING "OpenCV: CMAKE_SIZEOF_VOID_P is not defined. Perhaps CMake toolchain is broken")
endif()
if(NOT CMAKE_SIZEOF_VOID_P GREATER 0)
message(FATAL_ERROR "CMake fails to determine the bitness of the target platform.
Please check your CMake and compiler installation. If you are cross-compiling then ensure that your CMake toolchain file correctly sets the compiler details.")
endif()
message(STATUS "Detected processor: ${CMAKE_SYSTEM_PROCESSOR}")
if(OPENCV_SKIP_SYSTEM_PROCESSOR_DETECTION)
@@ -156,8 +160,10 @@ elseif(MSVC)
set(OpenCV_ARCH "ARM")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(OpenCV_ARCH "x64")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(OpenCV_ARCH "x86")
else()
set(OpenCV_ARCH x86)
message(FATAL_ERROR "Failed to determine system architecture")
endif()
if(MSVC_VERSION EQUAL 1400)
+4 -1
View File
@@ -40,11 +40,14 @@ file(REMOVE "${OPENCV_DOWNLOAD_WITH_WGET}")
ocv_check_environment_variables(OPENCV_DOWNLOAD_MIRROR_ID)
function(ocv_init_download_mirror)
if(NOT GIT_FOUND)
return()
endif()
if(NOT DEFINED OPENCV_DOWNLOAD_MIRROR_ID)
# Run `git remote get-url origin` to get remote source
execute_process(
COMMAND
git remote get-url origin
${GIT_EXECUTABLE} remote get-url origin
WORKING_DIRECTORY
${CMAKE_SOURCE_DIR}
RESULT_VARIABLE